Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/03/2022 in all areas

  1. Update from 2022-05-04: 3) Events system 3a) General changes - 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) Set Build Rate/Attack Building Rate/Tech/Cash: added generic value operation Show Timer: Changed to "Set Timer", added generic value operation Show Message: Added "Sound mode" parameter (default sound, no sound, custom sound selection) Unit Spawn: Added "Facing" and "Tag" parameter for initial direction and tag 3c) New event types Add Building Destruction: Simulates building destruction animation + spawns debris (technically adds a building and destroys it immediately) 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 Spice Harvested: Added possibility to check for total credits, cash, spice or spice storage 3e) New condition types 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: 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 5) Extensions and improvements - 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 to 512 kilobytes 6) New D2kEditor features - Show advanced mode buildings/units special property markers (tagged, primary, no harv) - Mark events using negated condition with different color - Added marking of events and conditions of selected type First post edited and download link updated.
    1 point
  2. > Extended limits to maximum of 1024 events and 256 conditions (needed to extend MIS file format) It is refreshing to see someone achieve what I could not. It looks like you have also handled the support for the old capacity and format. Great work! The theoretical limit to the number of different types of events and conditions should be 255 (0xFE) or 256 (0xFF), because that is storage of the type is one byte. The game has an internal check for the event and condition ID so as to produce an error if the read ID exceeds the old limit, but the patch can easily override that. The rest is a matter of developing the switch behavior. Some additional suggestions based on my rusty knowledge, and what I had wanted to do before: - In Event 12 / 0x0C - Switch My Side, there is the option of setting the enable AI. I suggest that we keep that option as it is, but also create an event to set only the AI for a house (similar to Event 06 / 0x06 - Set Build Rate and similar events). I guess it can be called Set AI, and the parameters can even be extended to include House and AI Enabled for a start, but also allow the future inclusion of EnablePractice, BuyUnits, UpgradeBuildings, RebuildBuildings, DontSell, GuardBase and GuardBuildings (more if you are willing to use the full set of 48 bytes in the event to its full potential). A possible favorite for mappers and scripts could be the SpecialWeaponDelay, but that may take up several bytes. - In Event 08 / 0x08 - Set Cash, a good expansion to the event is a switch (we can use the byte reserved for Deploy Action in Reinforcement / Unit Spawn) to determine different behaviors, such as: > 00 - Convert Spice to Cash and Set Cash (the default behavior, spice is set to zero / silos are emptied and the cash amount is set) > 01 - Preserve Spice and Set Cash (preserve the spice amount, and set Cash to the value - Spice, unless there is not enough Cash, then deduct from Spice) > 02 - Convert Spice to Cash and Add Cash (spice is set to zero / silos are emptied, the previous spice amount is added to cash, and the value is added to Cash) > 03 - Convert Spice to Cash and Subtract Cash (spice is set to zero / silos are emptied, the previous spice amount is added to cash, and the value is subtracted from Cash down to 0) > 04 - Convert Spice to Cash and Add Spice (spice is set to zero / silos are emptied, the previous spice amount is added to cash, and the value is added to Spice. Spice may be lost in case of insufficient spice storage) > 05 - Preserve Spice and Add Cash (preserve the spice amount, and the value is added to Cash) > 06 - Preserve Spice and Subtract Cash (preserve the spice amount,, and the value is subtracted from Cash down to 0) > 07 - Preserve Spice and Add Spice (preserve the spice amount, and the value is added to Spice. Spice may be lost in case of insufficient spice storage) > 08 - Preserve Spice and Subtract Spice (preserve the spice amount, and the value is subtracted from Spice down to 0) - Add Event "Add Unit to Starport Shop" (or a similar name), with two parameters: Amount and ID, to add the specified quantity to a unit availability on the Starport order tab. The IDs on the original game shall be: 00=Trike, 01=Quad, 02=Harvester, 03=Combat Tank, 04=MCV, 05=Missile Tank, 06=Siege Tank, 07=Carryall, but can change if Templates.bin is modded. This gives some control over the Starport shop to the mission creator. - In Conditions 00 - Building Exists and 01 - Unit Exists, I do not know how feasible it is, but we can see if conditions Building Count and Unit Count can be made. The search algorithm has to be retrieved from the XX Exists function and studied so it can be made to count instead. XX Exists will be a special case of XX Count where the required count is 1. This can be useful to enforce a defense of several bases (e.g. Protect all 5 Refineries) without consuming precious house allocations to implement via Building Exists. - For the following conditions, possible use of a special House value -1 (0xFF) as "Any House" to indicate a full map search inclusive of all 8 house players (implementation could simply be to run the function 8 times, one for each house and stop on success): > 00 - Building Exists, > 01 - Unit Exists, > 08 - Spice Harvested (if the specific side is shown) - Add Condition "Spice Storage", to compare the amount of Spice Storage similar to "Spice Harvested". This could be useful to enforce fail conditions where the player has lost the ability to acquire new silos to meet a certain "Spice Harvested" quota. - Several more conditions can be made if the in-game statistics can be read. Possibilities include: > "Buildings Destroyed" > "Buildings Lost" > "Units Killed" > "Units Lost" > "XX Building Owned" > "XX Unit Owned" - Outside of the events mechanism, I think it may be possible to allow larger reveal radii by extending CIRCLES.bin. But it also involves a patch into the EXE so that it reads more of CIRCLES.bin than the present 8 entries. As a refresher, CIRCLES.bin comprises of 8 sets of masks (00 - within circle, FF - outside circle), when read from the front, spells the values for 1x1, 3x3, 5x5, 7x7, 9x9, 11x11, 13x13, and 15x15 (radius 7). This could impact sight radius and map reveal events.
    1 point
  3. Update from 2021-09-13: 2) Events system 2a) General changes - 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. 2b) Original event type changes 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) Set Cash: Should work without crashes, added three operations: "Set", "Plus" and "Minus" Set Tech: Added option to immediately update available buildings and units Reveal map: Radius 0 (reveal whole map) will properly reveal radar map Show Message: Customizable message duration (the Unknown value is now used as duration in ticks) 2c) 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 in respective way. 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. Change Tile Attributes: You can change attributes of tiles in specified map area. Either set attributes to absolute balue, or add or remove specified attributes. Change Tile Damage: Manipulates with tile's "Damage" property. The rock and sand craters are driven by tile's damage property (the more damage the bigger craters). You can set damage of tiles in specified map area to specific value or add/substract specific amount of damage. The damage range is 0 (healthy) to 255 (biggest craters). 3) Bug fixes - 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) - Exclude OPTIONS.AUD and SCORE.AUD music tracks from random music rotation 4) Extensions and improvements - 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) First post edited and download link updated.
    1 point
×
×
  • Create New...