User Tools

Site Tools


besiege:modding:logic

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
besiege:modding:logic [2018/06/27 13:55]
spaar [Activating Triggers]
besiege:modding:logic [2018/06/27 13:57] (current)
spaar [Adding Events]
Line 73: Line 73:
 Events are also first declared in the mod manifest. Events are also first declared in the mod manifest.
  
-''​xml <Mod> ...<​Events>​ <​Event>​ <​Name>​Some Event</​Name>​ <​ID>​someId</​ID>​ <Icon name="​some-icon"​ /> <​Properties>​ <​NumberInput name="​numberinput"​ title="​Test"​ /> </​Properties>​ </​Event>​ </​Events>​ </​Mod>​''​+<​code ​xml
 +<Mod> 
 +    ​... 
 +    ​<​Events>​ 
 +        ​<​Event>​ 
 +            ​<​Name>​Some Event</​Name>​ 
 +            ​<​ID>​someId</​ID>​ 
 +            ​<Icon name="​some-icon"​ /> 
 +            ​<​Properties>​ 
 +                ​<​NumberInput name="​numberinput"​ title="​Test"​ /> 
 +            ​</​Properties>​ 
 +        ​</​Event>​ 
 +    ​</​Events>​ 
 +</​Mod>​ 
 +</​code>​
  
 The ''​Name''​ and ''​ID''​ elements work similarly to their Trigger equivalents. The ''​Icon''​ element specifies an icon to be displayed ain the mapper when the event is selected. The ''​Name''​ and ''​ID''​ elements work similarly to their Trigger equivalents. The ''​Icon''​ element specifies an icon to be displayed ain the mapper when the event is selected.
Line 81: Line 95:
 Because the declaration for events with many properties can get quite long and complex, it is possible to instead define an event in its own XML file, similar to how Blocks and Entities work. To do so, reference the file in the mod manifest like this: Because the declaration for events with many properties can get quite long and complex, it is possible to instead define an event in its own XML file, similar to how Blocks and Entities work. To do so, reference the file in the mod manifest like this:
  
-''​xml <Mod> ... <​Events>​ <Event path="​SomeEvent.xml"​ /> </​Events>​ </​Mod>​''​+<​code ​xml
 +<Mod> 
 +    ​... 
 +    ​<​Events>​ 
 +        ​<Event path="​SomeEvent.xml"​ /> 
 +    ​</​Events>​ 
 +</​Mod>​ 
 +</​code>​
  
 The ''​path''​ attribute is relative to the mod's directory, i.e. the directory that contains the Mod.xml file. The ''​SomeEvent.xml''​ file would then have to contain the complete ''​Event''​ element as described above. The ''​path''​ attribute is relative to the mod's directory, i.e. the directory that contains the Mod.xml file. The ''​SomeEvent.xml''​ file would then have to contain the complete ''​Event''​ element as described above.
besiege/modding/logic.txt · Last modified: 2018/06/27 13:57 by spaar