User Tools

Site Tools


ixe:mapmaking:custom

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ixe:mapmaking:custom [2024/12/09 15:59] – expounded Karsten75ixe:mapmaking:custom [2025/02/14 14:57] (current) – external edit 127.0.0.1
Line 3: Line 3:
   * image (typically a JPEG or PNG file) - how the unit looks   * image (typically a JPEG or PNG file) - how the unit looks
   * description (JSON file) - what components and behaviors go with the unit   * description (JSON file) - what components and behaviors go with the unit
-  * behavior ([[IRPL]]file - what the unit does (if the unit is decorative, this is optional). In some instances, a pre-defined behavior may be all that is needed. These pre-defined behaviors can be described by a [[controller]] - a controller can be specified in the JSON, making the script [[IRPL]] file unnecessary.+  * behavior ([[ixe:irpl:start|IRPL]] file - what the unit does (if the unit is decorative, this is optional). In some instances, a pre-defined behavior may be all that is needed. These pre-defined behaviors can be described by a [[ixe:controller:start|controller]] - a controller can be specified in the JSON, making the script [[ixe:irpl:start|IRPL]] file unnecessary.
  
 A more complex unit can have multiple components, where each component is named in the base or root JSON, and each component can be made up the same as the root or base component.  A more complex unit can have multiple components, where each component is named in the base or root JSON, and each component can be made up the same as the root or base component. 
Line 10: Line 10:
  
 ===== Unit Image ===== ===== Unit Image =====
-The unit image is an image file, at time of writing we have just been using png files, we do not yet know what other (if any) image formats are supported.  Every 2x2 area of ship pixels will correspond to a single tile of terrain.  So if your image is 39 pixels wide and 15 pixels tall, your ship will be 20 terrain tiles wide and 8 terrain tiles tall.  Also note that the bigger the ship the higher the build cost will be.+The unit image is an image file, at time of writing we do not yet have a list of what image formats are supported and have mostly been using png files.  Every 2x2 area of ship pixels will correspond to a single tile of terrain.  So if your image is 39 pixels wide and 15 pixels tall, your ship will be 20 terrain tiles wide and 8 terrain tiles tall.  Also note that the bigger the ship the higher the build cost will be.
  
 You want a program that can make pixel art png files, including deleting pixels so you can have non-rectangular shapes. You want a program that can make pixel art png files, including deleting pixels so you can have non-rectangular shapes.
Line 22: Line 22:
 { {
     "type": "unit",     "type": "unit",
-    "displayname": "", +    "displayname": "My Awesome Unit", 
-    "image": "",+    "image": "body.png",
     "position": [0, 0],     "position": [0, 0],
     "pivot": [0.5, 0.5],     "pivot": [0.5, 0.5],
- "maxammo":+    "maxammo": 100
- "movable": true,+    "maxcammo": 3000, 
 +    "ammorequesttime": 6, 
 +    "cammorequesttime": 6, 
 +    "permanentinventory": true, 
 +    "movable": true,
     "parts": [     "parts": [
  
-             ],     +    ],       
-   +    "controllers":
-    "controllers":+        
-                        +            "name": "ondestroy_sandexplosion", 
-                            "name": "ondestroy_sandexplosion", +            "amt": 500, 
-                            "amt": 500, +            "minvelocity": 1.5, 
-                            "minvelocity": 1.5, +            "maxvelocity": 3, 
-                            "maxvelocity": 3, +            "color0":[0.2, 0.4, 2], 
-                            "color0":[0.2, 0.4, 2], +            "color1":[0.2, 0.6, 2], 
-                            "color1":[0.2, 0.6, 2], +            "sandtype": 98, 
-                            "sandtype": 98, +        
-                        +    ],
-                    ],+
 } }
 </file> </file>
Line 49: Line 52:
   - "displayname" is the name of the unit.  Place the name between the quotes after the colon.   - "displayname" is the name of the unit.  Place the name between the quotes after the colon.
   - "image" is the image file name (including .png).  Place the name between the quotes after the colon.  Note that if the image is in a different folder you can write the path using the map folder as a base or $/ to use the IXE homepath for base game units.   - "image" is the image file name (including .png).  Place the name between the quotes after the colon.  Note that if the image is in a different folder you can write the path using the map folder as a base or $/ to use the IXE homepath for base game units.
-  - "maxammo" is the ammount of ammo the unit can carry, this needs to be at least one for certain parts to load.  Place the number between the colon and the comma.+  - "maxammo" is the amount of ammo the unit can carry, this needs to be at least one for certain parts to load.  Place the number between the colon and the comma. Don't include this parameter at all if the unit isn't supposed to carry ammunition. 
 +  - "maxcammo" is the number of Anticreeper the unit can carry. Don't include this parameter at all if the unit isn't supposed to store AC. 
 +  - "ammorequesttime" is the minimum time in frames between ammo requests. The lower the number, the faster this unit will receive ammo. 
 +  - "cammorequesttime" is the minimum time in frames between AC ammo requests. The lower the number, the faster this unit will receive AC. 
 +  - "permanentinventory" when true, the unit will go to the inventory upon destruction.
  
 All that remains is to add the parts; below the "parts" line, paste any of the following to add that part to your ship.  Don't worry about position yet, it is easier to position the weapons once the unit is placed in game. All that remains is to add the parts; below the "parts" line, paste any of the following to add that part to your ship.  Don't worry about position yet, it is easier to position the weapons once the unit is placed in game.
Line 61: Line 68:
 <tabbox Lathe> <tabbox Lathe>
 <code>                {"part": "$/weapon_lathe/weapon_lathe.json", "position": [0, 0]},</code> <code>                {"part": "$/weapon_lathe/weapon_lathe.json", "position": [0, 0]},</code>
 +
 +<tabbox Freeze Cannon>
 +<code>                {"part": "$/weapon_freeze/weapon_freeze.json", "position": [0, 0]},</code>
  
 <tabbox Sentinel Cannon> <tabbox Sentinel Cannon>
Line 70: Line 80:
 <tabbox Sanddropper> <tabbox Sanddropper>
 <code>                {"part": "$/module_sanddropper/module_sanddropper.json", "position": [0, 0]},</code> <code>                {"part": "$/module_sanddropper/module_sanddropper.json", "position": [0, 0]},</code>
 +
 +<tabbox Maker>
 +<code>                {"part": "$/weapon_maker/weapon_maker.json", "position": [0, 0]},</code>
  
 </tabbox> </tabbox>
  
 Save the file name as what you want your ship to be named in code (make sure to use the extension .json) and place that file with the image from the first step. Save the file name as what you want your ship to be named in code (make sure to use the extension .json) and place that file with the image from the first step.
 +
 +===== Global JSON =====
 +To add a global script to your map - one that will run without the need of a unit - you need to add a global.json file to the root of your project with the following content
 +
 +<file json global.json>
 +{
 +    "type": "global",
 +    "scripts": [
 +        {"name": "mission.irpl", "run_when_paused" : false},
 +    ]
 +}
 +</file>
 +
 +===== Scripting =====
  
 ===== Final Touches ===== ===== Final Touches =====
Line 81: Line 108:
  
 And with that, congratulations!  You have made your own ship. And with that, congratulations!  You have made your own ship.
 +
 +
 +To see how all of the base game ships are constructed, you can check them out here [[ixe:mapmaking:unitreference|Unit Reference]]
  
ixe/mapmaking/custom.1733759987.txt.gz · Last modified: 2025/02/14 14:56 (external edit)