Klofkac Posted May 17, 2021 Share Posted May 17, 2021 (edited) Hello all, so finally I got into Dune 2000 patching and fixing up things and adding new features! I had a talk with FunkyFr3sh and got some useful information and stuff needed for continuation of game pathing. I'm going to use the latest FunkyFr3sh's Cncnet version as a base (not the Gruntmods version which is not the latest one and can miss some important features), which should be fine and work well. I'm using the same patching methods and tools, which is pretty easy to use and only Dune2000.exe needs to be distributed. The latest version of cncnet's ddraw.dll needs to be used so I'm putting it in the zip file as well. I would also like to say many thanks to Tomsons26 and The Code Conqueors team for his hard work on reverse engineering Dune2000 with IDA, which helped me very much with seeing and understanding the code and which made game patching easier than it ever could be. Patching, which is practically kind of "source code modding" is lot of fun and can bring lot of new possibilities into the game. Download here: dune2000-sp-patches_2022-06-30.7z D2kEditor version 2.11 with support for the new game features: D2kEditorv2.11.7z Feature list: 1) New mapping possibilities - You can place any building (even specific version - i.e. Atreides, Harkonnen, Ordos) for any side with special values from range 8192 - 16383. The building type, side and other properties are coded in special value directly, no need to set them up in TILEDATA.BIN. D2kEditor provides GUI in the new Advanced structures mode. - You can place refinery which does not receive new harvester delivery upon starting a mission - You can place specific building as primary - For turrets, you can specify initial barrel direction (4 directions: up, right, down, left) - Tagged property: for use in events which refer to specific building(s) - You can place any unit (even specific version, i.e. Atreides, Harkonnen, Ordos tank) for any side with special values from range 16384 - 32767. The unit type, side and other properties are coded in special value directly, no need to set them up in TILEDATA.BIN. D2kEditor provides GUI in the new Advanced structures mode. - You can specify initial unit direction (8 basic directions) - You can place any unit as stealth - Tagged property: for use in events which refer to specific unit(s) - You can place static crates with special values from range 32768 - 65534. D2kEditor provides GUI in Advanced structures mode. - You can directly place thin spice, thick spice and real destructible concrete for any side out of the box as a direct tile property without use of any special value or tiles with specific pre-set tile attributes. You can place any building or unit on top of them. 2) Crates system - Added support for static pre-placed crates in maps + extended crates functionality and customization - Crates can be pre-placed using special values - You can place any crate/spice bloom types using any of 8 available graphics (4 crate sprites, 4 spice bloom sprites) - Extended Cash crate: Can give you customizable amount of money (multiplies by 100) - Extended Explosion crate: You can specify which "weapon" is used, crate can be detonated by shooting on it - Extended Reveal map crate: It can reveal a circle (same as Reveal map event) in relative position near to the crate - Extended Unit crate: You can specify which unit exactly it will give, for infantry it can give either 1 or 5 - Extended Stealth crate: Has more unit-powerup functions (heal unit, change unit type), customizable range and pickup animation - Extended Spice blooms: More spice bloom types (classic, instant circle/square, Dune 2 style) and customizable range - New crate type: Execute event! You can go wild and execute any event or chain of events you like. - Fixed disappearing crates and spice blooms when AI-controlled units are nearby. AI can actively collect crates. - AI won't collect customized explosive crates or crates with image 4 - How to use extended crates is described below 3) Events system 3a) General changes - Extended limits to maximum of 1024 events and 256 conditions (needed to extend MIS file format) - Added "Auto-block" and "Blocked" event property. If "Blocked" flag is set, the event won't execute even if all conditions are true for that event. If "Auto-block" is set, then event will automatically block itself when it is executed. The "Auto-block" is basically "Execute once" behavior without using an additional "Flag" condition and "Set Flag" event, the flag is integrated into the event itself. - Added "or" mode into event's condition list (event will trigger if at least one condition is true) - Added "generic value operation" option to some of existing as well as new events of type "Set Something". You can not only set the property to a static value, but also add or substract from existing value. There are many different operations such as multiply, modulo, cap min/max, bit operations as well as randomization operations. - Added "generic data manipulation" events which are generalized events of type "Set Some Property". For example instead of "Set Build Rate" event you can use a generalized event "Set AI Property" where you can select any AI property you want to change from the list. - Added "object manipulation" events with "object filters". You can do specific actions on Units, Buildings, Crates and Tiles, and you can easily select which objects should get affected using filters with many different criteria. For example you can select units with the position on map, unit type, health, and many different properties. You can combine more criteria with an/or operators. - Added debug events which can show internal data in real time on screen. These are just for development and testing and are there to help understanding internal game logic and troubleshooting. For example "Show Unit Data", "Show Building Data" etc. 3b) Original event type changes Starport Delivery: Added "Delay" parameter (T minus messages will play during that time) Allegiance: Added "Both-sided" option so you can change diplomacy in both directions within a single event Play Sound: Can now have two types: "Global" (original behavior) and "Point" (will make sound at specific coordinates) Added Force option (only for Global sound), which will forcelully stop currently playing sound Set Cash: Should work without crashes Set Tech: Added option to immediately update available buildings and units Set Build Rate/Attack Building Rate/Tech/Cash: added generic value operation Reveal map: Radius 0 (reveal whole map) will properly reveal radar map Show Timer: Changed to "Set Timer", added generic value operation Show Message: Customizable message duration (the Unknown value is now used as duration in ticks) Added "Sound mode" parameter (default sound, no sound, custom sound selection) Added Reference ID, positioning, color, and type-on mode (see New messages system) Unit Spawn: Added "Facing" and "Tag" parameter for initial direction and tag 3c) New event types Switch My Side: You can now change the side you play as (like the Debug feature) in the middle of mission. You can also turn off AI on side you switch to and turn on AI on side you switch from. "Reveal Base" option will also reveal tiles seen by buildings of the target side. Hide Map: Hides all map (like Hide Map crate type). If executed periodically, it can be used to simulate "Fog of War" mechanics - useful to mimic "darkness" (like inside caves). Un/block Event: Changes the "blocked" state of specific event Damage Tiles: Will cause damage to specific tile, like it was hit by specified weapon, without shooting a projectile. "Player": The side which gets score for killing buildings/units. "Pixel position": Pixel-precise target coordinates: [16 , 16] = center of tile, [0 , 0] = top-left, [31 , 31] = bottom-right "Rand. spread": Random inaccuracy (like Death Hand) in X and Y axis in pixels (32 = 1 tile) "Spread type": Random distribution in either square (rectangle) or circe (ellipse) shape "Hit explosion": Whether to show weapon's hit animation at target point Add Unit: Add a single unit at specified place. The unit can move in any direction after it is spawned: "Random": works is same way as when a building is destroyed/sold and infantry coming out of it will move in random direction Specific direction: works in same way as when a unit comes out of barracks/factory Add Building: Adds building at specified place. You can add building either with or without concrete, either instantly or with buildup animation, and also add refinery without a harvester coming with it. Add Projectile: Shoots projectile of a specific weapon from source position to target position. Source position is always center of specified tile. For target position you can specify "Pixel position" and "Rand. spread" in same way "Play sound": Whether to play weapon's firing sound from source tile Note that the distance from source to target is limited due to computation limitations to about 70 tiles. Add Explosion: Makes an animation at specified position. "Player" will specify color of deviator dust. You can specify "Pixel position" and "Rand. spread" in same way. "Play sound": Whether to play explosion's sound from the tile Add Crate: Add any type of crate during game. "Ext. data": Extension data, have different meaning for each crate type "Respawns": Number of respawns of Spice Bloom Spawner "Expiration": Time in ticks after which crate will disappear or spice bloom rises/explodes Add Concrete: Add concrete for specific side. If "Tile bitmask" is zero, it fills specified area with concrete (only buildable tiles). If "Tile bitmask" is nonzero, it places concrete of defined shape (up to 4*4 size, only buildable tiles) and reveals the tiles. Spice Bloom: Simulates explosion of a spice bloom crate at specified place. Shake Screen: Shakes screen for specified duration of ticks Center Viewport: Centers camera view at specified place. If executed periodically, it locks the screen. Change Map Block: Changes tiles at specified place to different tiles. Maximum is 12 tiles in single event due to data size limitation (i.e. 4*3 area, 2*6 area). If the target tile is not buildable, buildings and concrete on it will be destroyed (except buildings which do not require concrete). If target tile does not have "drive on" attribute, vehicles on it will be destroyed. If target tile does not have "walk on" attribute, infantry on it will be killed. If target tile does not have "sandy" attribute, spice on it will be removed. If target tile has "occupied by building/unit/infantry" attribute, units on it will be killed respectively. Tile attributes will be changed to target tile's attributes, but building/unit owner will be preserved. Transform Tiles: Similar to "Change Map Block", but you can globally change specific tiles across whole map into their target counterparts. You can specify up to 6 "from-to" tile pairs. Add Building Destruction: Simulates building destruction animation + spawns debris (technically adds a building and destroys it immediately) Activate Timer: If an "Interval", "Timer" or "Random interval" condition is set as Inactive, this event will activate it. The condition starts counting its time from the time of activation rather than from start of mission, so you can make a specific delay after some event happens. If already active condition is activated again, it resets and starts counting again from time of activation. So you can make repeatable chains of events. Remove Message: Remove a message with given Reference ID or multiple chat messages. Set Message Color: Change a predefined color. Also affects all currently shown messages using that color. There's support for fancy effects like gradient colors or color changing in time. Side manipulation events (40-45): Transfer Credits, Set Building Upgrades, Set Starport Stock, Set Starport Cost, Change Starport Unit, Show Side Data AI manipulation events (46-47): Set AI Property, Show AI Data Memory manipulation events (48-49): Set Memory Data, Show Memory Data Unit manipulation events (50-59): Destroy Unit, Damage/Heal Unit, Change Unit Owner, Change Unit Type, Set Unit Flag, Set Unit Property, Select Unit, Airlift Unit, Show Unit Data Building manipulation events (60-69): Destroy Building, Damage/Heal Building, Change Building Owner, Change Building Type, Set Building Flag, Set Building Property, Select Building, Show Building Data Crate manipulation events (70-73): Remove Crate, Pickup Crate, Set Crate Property, Show Crate Data Tile manipulation events (74-79): Change Tile, Set Tile Attribute, Set Tile Damage, Reveal Tile, Hide Tile, Show Tile Data Order events (80-109): You can make orders like a player would do with mouse and keyboard input, like ordering units to move, attack etc., repair, sell buildings etc., as well as clicking on sidebar to build buildings, units, upgrades, order from starport etc. Before making some orders you need to select units/buildings you want give order to. Use in combination with "Select Unit" or "Select Building" event. When order is given, the selection can be restored, so it would not interfere with player's interface. 3d) Original condition type changes Interval: Added "Inactive" property (can be activated/reset by "Activate Timer" event) Added rule "intervalsAreOffByOneTick" which is "Yes" by default to keep vanilla behavior. If set to "No", the times specified are exact times without need to substract one tick. Timer: Added "Inactive" property (can be activated/reset by "Activate Timer" event) Added "Shift" property to be used with "%" operation (triggers always "Shift" ticks earlier) Spice Harvested: Added possibility to specify a side to check for its credits (vanilla supports only My side) Added possibility to check for total credits, cash, spice or spice storage 3e) New condition types Random Chance: Can evaluate as True or False based on randomness. Has three parameters: "Range", "Min value" and "Max value". A random number within specified range (from 1 to "Range") is generated and condition is true if the generated number falls between Min and Max value. The generated random number is shared by all "Random Chance" conditions at same time, so you can make "multiple choice" behavior with each option having its probability by using multiple conditions with adjacent ranges. The condition can work in two modes: "dynamic" and "fixed", determined by "fixed result" parameter. If it is set to 0, then each tick a different random number is generated so condition evaluates differently each tick. If it is set to a nonzero value, then the random number is generated once in the beginning of mission and condition gives always same result through whole gameplay. Different "fixed result" value uses independent fixed random number. Random interval: Works in similar way as "Interval" condition, but instead of exact delay between runs you specify "Min delay" and "Max delay". Different delay is picked randomly within the range for each run. After "Start delay" passes, condition does not trigger, but there's also additional random delay before the first run. Can be activated/reset by "Activate Timer" event. Diplomacy: Check for current diplomacy between any two sides Difficulty: Check for current difficulty setting (easy, normal or hard) Object/environment checking conditions: Check Units, Check Buildings, Check Crates, Check Tiles Very flexible conditions where you can use same criteria as with object manipulation events. Spice in Area: Check how much spice blobs are left in specified rectangle area in total (thin = 2, thick = 4) Damage in Area: Check for sum of total damage caused to tiles in specified rectangle area Side-related conditions: Power, Building Upgrades, Starport Stock, Starport Cost, Starport Pick, Starport Delivery, Sidebar build icon status conditions: Building Icon, Unit Icon, Upgrade Icon Stats conditions: Spice Harvested, Units Built, Buildings Built, Units Lost, Buildings Lost Units Killed, Buildings Killed Generic data conditions: AI Property, Memory Value 4) Bug fixes - Fixed: Building upgrade tooltip now shows correct cost for easy and hard difficulty - Fixed: Exploding barrel, sardaukar and grenadier death damage is now properly dealt in the middle of building/unit - Fixed: Missing devastator self-destruct sound - Fixed: Damaged unit speed (units with red health bar are now slower than units with yellow health bar) - Fixed: MCV could be deployed on crates - Fixed: Error messages when winning/losing as side > 2 - Fixed: Infantry rarely remaining invulnerable after being released from a destroyed building - Fixed: AI getting stuck in infinite loop building and cancelling concrete when it's about to (re)build a building - Fixed: AI starting building upgrade with zero credits causing upgrade stuck in HOLD state - Fixed: AI losing ability to order units from starport after it tries to order a unit with low cash - Fixed: Practice AI won't go/turn off berserk mode if it receives a MCV later during mission - Fixed: Increased the message duration to 400 ticks also for built-in messages (neutral became hostile etc) - Fixed: In-game briefing UI lockup, custom briefing will always show for any mission number or side - Fixed: When you change side you play as using Debug menu, it will restore to original after restarting map (does not work when you save game with the side changed and load it back) - Fixed: Excluded OPTIONS.AUD and SCORE.AUD music tracks from random music rotation - Fixed: Exploding barrel building should not deal damage when it is sold or captured by engineer - Fixed: When some units are picked before placing order and starport is sold, the credits are returned twice - Fixed: Returning wrong amount of credits from cancelled second and third building upgrade - Fixed: Units keeping firing on allied sandworm even after it was killed and put on sleep - Fixed: Sleeping sandworm should not take damage - prevents turning neutral to hostile - Fixed: Tile attribures not properly set after removing buildings not requiring concrete - Fixed: AI units getting stuck on targeting a cloaked unit (when doing harvester protection) - Fixed: When tech is lowered by event, running building upgrades which are no longer possible should get cancelled - Fixed: Improper cursor over enemy building when only armed engineer/saboteur is selected - Fixed: Improper cursor (engineer/saboteur/sell) when building has infiltrated flag - Fixed: Missing check for unit type availability when ordered to build such unit type - Fixed: Do not target invulnerable carryalls which bring a delivery - Fixed: Sounds with cooldown not playing after restarting or loading game 5) Extensions and improvements - Extended maximum length of in-game briefing loaded from mission ini file (from 4096 to 65536 characters) - Added support for different type of infantry released from destroyed/sold building for different side (This is driven by Owner side setting for unit types - the first infantry owned by a side matches) - Added custumizable max. number of infantry to be released from destroyed/sold building and customizable chance (This is driven by "infantryReleaseLimit" and "infantryReleaseChance" rules) - Preserve original tiles beneath spice, concrete and building skirt tiles after spice/concrete/building is removed - Concrete pre-paced on map using specific tiles having "concrete" attribute will be indestructible - Spice works properly in tilesets where spice and buildings can be placed on same tiles (i.e. Red Alert) (you cannot place buildings on spice but can place them where it was harvested, spice blooms won't create spice underneath buildings) - Added rule "buildingsAlwaysNeedPrerequisites": if turned on, a building will be available to build only when its prerequisites are present, and become unavailable when its prerequisite is destroyed or sold (like how it works for units). - Added rule "returnCreditsToSpiceStorage": if turned on, credits from cancelled builds and starport orders will be returned as spice into silo storage capacity (if not enough capacity, remaining credits will be given as cash and won't be lost). This makes the starport exploit unusable. Does not apply to selling buildings and bonus cash crates. - Added new AI property "DontFaceUnitsAwayFromConYard": if turned on, units for a side with active AI won't be set to face away from construction yard at the start of mission. - Guard mode radius can be customized by map rule "guardModeRadius" - Always show radar map if rule "alwaysShowRadar" is set to true - Made all tiles count tile damage (previously it was done only for sand and rock tiles) - Crates can be picked up by a carryall dropping a unit on them - Allow infantry to move on tile where some infantry is already standing (with Alt key) - Made top row of map buildable - Added new rules for customized cost and build speed percentage for Easy and Hard difficulty: "costPercentageEasy", "costPercentageHard", "buildSpeedPercentageEasy", "buildSpeedPercentageHard" - Increased sound size limit (.WAV file inside SOUND.RS and .AUD file) to 512 kilobytes - Added rule "uncloakRemainingStealthUnit" to toggle this functionality - Added unit and building terrain restrictions. That makes possible to allow placing buildings / moving units only on specific type of tiles (defined by terrain type attributes), like for example water. - Added Max Distance setting on buildings to define how far it can be built from existing side's structures. - Added force option to Play Sound event and Show Message custom sound, prevent non-forced sounds from being lost 6) New messages system: - Messages can have a reference ID, used to replace a message with another one with same ID or remove message. - Messages with nonzero reference ID and zero duration will last forever (for zero ref. ID duration is 400 ticks). - Messages can be positioned anywhere on screen, with defined horizontal and vertical alignment. - Maximum number of messages shown in chat can be changed by "maxChatMessages" rule. - Added Type-on mode: message is typed on screen letter by letter. - Added colored messages: message text can be shown in one of 16 predefined colors. - Multiple colors can be used within one message by changing color with special character (^) followed by number 0-9 or letter A-F to select one of 16 possible colors. - A predefined color can be changed dynamically by "Set Message Color" event, which affects all messages using that color. There's support for fancy effects like gradient colors or color changing in time. - Maximum total number of messages that can be shown at same time is 32. D2kEditor Version 2.1 changelog ------------------------------- Added support for newly implemented features in singleplayer game modding. Added: Advanced Structures mode (place any unit, building or crate on map, with additional properties) Added: Extended Events and Conditions UI for new game features, made events configurable with ini files, increased event and condition limits Added: Convert structures to advanced mode option Added: Structures editor: Added unit upgrade type field Added: Export and Import Events feature Fixed: Sound name lockup Added: Mark events using negated condition with different color Added: Marking of events and conditions of selected type Changed: Increased sound size limit from 64kB to 512kB D2kEditor Version 2.11 changelog ------------------------------- Added: Deactivate Ctrl+X shortcut when on Briefing text box Added: Show empty lines in event/condition lists. Controlled by "EventGridShowEmptyLines" setting in D2kEditor.ini. Added: Unit and building terrain restriction fields in structures editor (new features in Dune 2000 mod) Added: New event types and rules (new features in Dune 2000 mod) How to place crates with special values: Spoiler For the basic crate types you can simply use predefined low-number special values. These are selectible in the editor's Misc objects list (i.e. special value 6 = cash crate, 7 = explosion crate etc). The basic crates have predefined graphics sprite. For the extended crates you use "generalized" special values. The special value is used as a 16-bit bitfield, where specific bits determine crate type, sprite and other values. The 16 bits are used in this way: 1TTTTSSSEEEEEEEE - The leftmost bit needs to be set to 1 - T (4 bits, values 0-10) = Crate type - S (3 bits, values 0-7) = Crate sprite - E (8 bits) = Extension data, these are specific for each crate type Crate types: 0 = Cash 1 = Explosion 2 = Show map 3 = Hide map 4 = Unit 5 = Powerup (originally Stealth) 6 = Execute event 7 = Spice Bloom spawner 8 = Spice Bloom (small) 9 = Spice Bloom (medium) 10 = Spice Bloom (large) Crate sprites: 0 = Blue crate 1 = Red crate 2 = Green crate 3 = Purple crate 4 = Invisible (one white pixel) 5 = Spice Bloom (small) 6 = Spice Bloom (medium) 7 = Spice Bloom (large) Cash crate: - Amount of cash = Extension data * 100 - If extension data is 0, then default amount of cash (1000), which is determined by "CrateCash" rule, is used - Possible cash amount range: from 100 to 25500 Explosion crate: - Extension data bitfield: DAWWWWWW D = Can be destroyed when shot? (1 = yes, 0 = no) A = Area of effect (0 = center of tile, 1 = edge of tile nearest to the unit picking up the crate) W = Weapon type (0-63) - Use default crate weapon (default behavior) if extension data is zero Reveal map crate: - Extension data bitfield: XXXYYYRR X = Relative X-offset (3-bit value, possible offsets: 0, 4, 8, 12, -16, -12, -8, -4) Y = Relative Y-offset (3-bit value, possible offsets: 0, 4, 8, 12, -16, -12, -8, -4) R = Range (2-bit value, possible ranges: 4, 5, 6, 7) - Reveal all map (default behavior) if extension data is zero Unit crate: - Extension data bitfield: VIUUUUUU V = Call MyVersionOfUnit? (1 = yes, 0 = no) I = Infantry amount (0 = one infantry, 1 = five infantry) U = Unit type (0-59) - Give random unit (default behavior) if extension data is zero - If "V" bit is 1, then "U" value specifies item from "Unit types" list in structures editor i.e. value 9 will give you either Atr, Ord or Hark combat tank depending on side you play as - If "V" bit is 0, then "U" value specifies item from "Units" list in structures editor i.e. value 9 will give you Atr tank, 10 Hark tank, 11 Ord tank Powerup crate: - Originally Stealth crate - Extension data bitfield: SP-MMMEE S = Play pickup animation and sound? (1 = yes, 0 = no) P = Always pickup? (0 = Pickup the crate only if it has any actual effect, 1 = Pick up crate always) - = Unused (reserved) M = Powerup mode: 0 = Make unit stealth 1 = Restore full health 2 = Restore 50% health 3 = Restore 25% health 4 = Change unit type: The target type for specific unit type is specified in unit definition in templates.bin: byte 0xAB: UnitUpgradeAllowed (1 = yes, 0 = no) byte 0xAC: UnitUpgradeTargetType 5, 6, 7 = Unused (reserved) E = Range of effect (0 = only the unit picking up crate, 1/2/3 = units max. 1/2/3 tiles far from the crate) - You can have different pickup animation for different powerup mode. You can set the explosion you want in Structures editor under Other tab and set respective explosion for "E Unit powerup crate (...)" field - Make units stealth in range of 2, always pickup, EX_CRATESTEALTH animation (default behavior) if extension data is zero Execute event crate: - Extension data is the number of event to execute. - Event will be executed regardless its conditions. If you want a specific event to be run only after picking up a crate, you will give it any condition that would never become true during gameplay. - If you want to execute more events at once, you would run "Set flag" event by picking up a crate. Spice blooms: - Extension data: DUMMRRRR D = Can NOT be destroyed when shot? (1 = yes, 0 = no) U = Always destroy unit which moved on spice bloom? (1 = yes, 0 = no) M = Spice bloom mode: 0 = Classic spice bloom 1 = Instant spice bloom: square, do not create thick spice, no sound 2 = Instant spice bloom: circle, do not create thick spice, no sound 3 = Instant spice bloom (Dune 2 style): circle, create thick spice when overlap with existing spice, screen shakes, play sound R = Custom range For classic spice bloom it can be 0-15 (4 bits) For instant spice bloom it can be 0-7 (3 bits) For instant spice bloom the 4th bit functions as randomizer (spice will be randomly scattered rather than filling whole area) If crate type is Medium spice bloom then range is increased by 1 If crate type is Large spice bloom then range is increased by 2 For instant circle spice blooms the maximum range is 7 (limitation of CIRCLES.BIN) For classic spice bloom the maximum range that can be specified is 17 (15 + 2 if Large spice bloom) - Classic spice bloom (default behavior) if extension data is zero Spice bloom spawner: - Always the graphics sprite number 4 (invisible, one-white-pixel) is used - The three bits for specifying graphics are used for different purpose: bit 1: Respawning? (0 = spawn spice bloom only once, 1 = respawn again after spice bloom is destroyed) bit 2, bit3: Mode (values 0-3) 0 = Do not place spice on the tile, the spawner will spawn a spice bloom after some time 1 = Place thin spice on the tile, the spawner will spawn a spice bloom after some time after spice is harvested 2 = Place thick spice on the tile, the spawner will spawn a spice bloom after some time after spice is harvested 3 = Do not place spice on the tile, the spawner will spawn a spice bloom immediately - The extension data are applicable to spice bloom spawned by the spawner. Examples of use: Special value = 32768 + (crate type * 2048) + (crate sprite * 256) + extension data Example 1: Cash crate, Purple sprite, gives 3000 credits Special value = 32768 + (0 * 2048) + (3 * 256) + 30 = 33566 Example 2: Unit crate, Red sprite, gives Ordos tank Special value = 32768 + (4 * 2048) + (1 * 256) + 11 = 41227 Example 3: Unit crate, Blue sprite, gives 5 non-stealth Fremen: Special value = 32768 + (4 * 2048) + (0 * 256) + 64 + 22 = 41046 (without MyVersionOfUnit) Special value = 32768 + (4 * 2048) + (0 * 256) + 128 + 64 + 19 = 41171 (with MyVersionOfUnit) Example 4: Explosion crate, Small Bloom sprite, uses "DEVASTATOR" weapon and its hit explosion Special value = 32768 + (1 * 2048) + (5 * 256) + 128 + 64 + 18 = 36306 How to use building and unit terrain restrictions: Spoiler Terrain 1, 2, 3, 4, 5, 6, 7 restricts movement to tiles with the exact terrain type. Terrain type is determined by the last three tile attributes: So, if terrain type bit 1 and bit 3 is selected, it makes number of 5, and "Terrain 5" restriction will allow units to move only on tiles where terrain bits 1,2,3 are set exactly 1-0-1. "Terrain 7" is where all three bits are selected, like 1-1-1. However, the other restrictions, "Ter.bit 1", "Ter.bit 1+2" means that the mentioned bits need to be selected, but the other bits don't matter. So for example "Ter.bit 1+2" will allow unit move to tile with bits set to 1-1-0 as well as 1-1-1, which are terrain types 3 and 7. This way you can make more complex combinations of where buildings or units can be placed. The best example is, that imagine you want naval buildings to be placed only on clean water tiles, but want to allow naval units to move on clean water tiles as well as border coast tiles (i.e. tiles with half water and half coast). So you give clean water tiles terrain type of 7 (bits 1-1-1) and coast tiles terrain type of 6 (bits 0-1-1). Then you give restriction "Terrain 7" to buildings, and restriction "Ter.bit 2+3" to units. "Ter.bit 2+3" will allow units to move on tiles with terrain type 6 (0-1-1) and 7 (1-1-1). Please test the new features and let me know if you see any problems. Here is github repository with my own added patches: https://github.com/jkoncick/dune2000-sp-patches Edited June 30, 2022 by Klofkac 4 Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.