User Tools

Site Tools


besiege:modding:example-guides:creatingevent

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:example-guides:creatingevent [2018/06/18 16:51]
von
besiege:modding:example-guides:creatingevent [2018/07/10 16:30] (current)
spaar
Line 13: Line 13:
   * Add the event to the mod manifest.   * Add the event to the mod manifest.
  
-''​xml <Mod> ... <​Events> ​<​Event> ​<!-- To define the event directly in the manifest. --> ... </​Event> ​<Event path="​SomeEvent.xml"​ /> <!-- To define the event in its own file. --> </​Events>​ </​Mod>​''​+<​code ​xml
 +<Mod> 
 +    ​... 
 +    ​<​Events>​ 
 +        ​<!-- To define the event directly in the manifest. --> 
 +        <​Event>​ 
 +            ​... 
 +        ​</​Event>​ 
 +         
 +        ​<!-- To define the event in its own file. --> ​ 
 +        <Event path="​SomeEvent.xml"​ /> 
 +    ​</​Events>​ 
 +</​Mod>​ 
 +</​code>​
  
 When defining an event in its own file, the file must contain an ''​Event''​ element as its root element which is equivalent to the ''​Event''​ element in the manifest when defining it inline. When defining an event in its own file, the file must contain an ''​Event''​ element as its root element which is equivalent to the ''​Event''​ element in the manifest when defining it inline.
Line 21: Line 34:
 3 elements are sufficient to define an event: A name, an ID and an icon. The ID must uniquely identify the event among all events in the same mod; the easiest way to handle this is to just use sequential IDs (1, 2, 3, ...). 3 elements are sufficient to define an event: A name, an ID and an icon. The ID must uniquely identify the event among all events in the same mod; the easiest way to handle this is to just use sequential IDs (1, 2, 3, ...).
  
-''​xml <​Event>​ <​Name>​Some Event</​Name>​ <​ID>​1</​ID>​ <Icon name="​some-event-icon"​ /> </​Event>​''​+<​code ​xml
 +<​Event>​ 
 +    ​<​Name>​Some Event</​Name>​ 
 +    ​<​ID>​1</​ID>​ 
 +    ​<Icon name="​some-event-icon"​ /> 
 +</​Event>​ 
 +</​code>​
  
 The ''​Icon''​ element is a reference to a texture defined in the mod manifest, see [[..:​moddevelopment#​resource handling|Resource Handling]] and [[..:​xml-elements:​Common#​texture|the Texture element]] for more information. The ''​Icon''​ element is a reference to a texture defined in the mod manifest, see [[..:​moddevelopment#​resource handling|Resource Handling]] and [[..:​xml-elements:​Common#​texture|the Texture element]] for more information.
besiege/modding/example-guides/creatingevent.txt · Last modified: 2018/07/10 16:30 by spaar