Loading...
  OR  Zero-K Name:    Password:   

Post edit history

unit_cannot_Damage_unit.lua

To display differences between versions, select one or more edits in the list using checkboxes and click "diff selected"
Post edit history
Date Editor Before After
9/11/2018 1:12:13 AMPLrankAdminSprung before revert after revert
9/11/2018 12:57:28 AMPLrankAdminSprung before revert after revert
Before After
1 [quote]So I installed the sample mod but it doesn't have any "Gadgets" folder. I'm assuming I copy the source code directory structure so I made \LuaRules\Gadgets under the mode name folder (LuaRules is at the same level as Units).[/quote] 1 [quote]So I installed the sample mod but it doesn't have any "Gadgets" folder. I'm assuming I copy the source code directory structure so I made \LuaRules\Gadgets under the mode name folder (LuaRules is at the same level as Units).[/quote]
2 Yes. 2 Yes.
3 \n 3 \n
4 [quote]If that's correct then I just need to create my lua file and stick it in there, right?[/quote] 4 [quote]If that's correct then I just need to create my lua file and stick it in there, right?[/quote]
5 Yes. 5 Yes.
6 \n 6 \n
7 [quote]How does the engine know when to call the method I will write?[/quote] 7 [quote]How does the engine know when to call the method I will write?[/quote]
8 Events. For starters look at other gadgets' code, specifically search for methods defined in `gadget:`. For example in `unit_cannot_damage_unit.lua` you can see the method is called `gadget:UnitPreDamaged` which is the event for when unit is damaged. 8 Events. For starters look at other gadgets' code, specifically search for methods defined in `gadget:`. For example in `unit_cannot_damage_unit.lua` you can see the method is called `gadget:UnitPreDamaged` which is the event for when unit is damaged.
9 \n 9 \n
10 [quote]Is there a mod 3example that creates widgets?[/quote] 10 [quote]Is there a mod 3example that creates widgets?[/quote]
11 I assume by "mod" you mean a client-side piece of code and by "widgets" you mean GUI panels (unfortunately, in the Spring engine world, "widget" is the term for "clientside mod" as originally they were meant for GUI panels, but have since evolved to do various other tasks, for example automating unit orders). 11 I assume by "mod" you mean a client-side piece of code and by "widgets" you mean GUI panels (unfortunately, in the Spring engine world, "widget" is the term for "clientside mod" as originally they were meant for GUI panels, but have since evolved to do various other tasks, for example automating unit orders).
12 \n 12 \n
13 I don't think there are any tutorial examples for those but you can look through the widgets provided in the game repository. Check out `LuaUI/Widgets`, especially the ones with names `gui_chili_*. lua` as Chili is our framework for working with GUI panels. These are also event based, like gadgets. 13 I don't think there are any tutorial examples for those but you can look through the widgets provided in the game repository, this contains almost the entire default ZK GUI. Check out `LuaUI/Widgets`, especially the ones with names `gui_chili_*. lua` as Chili is our framework for working with GUI panels. These are also event based, like gadgets.