FakeFishGames / Barotrauma

A 2D online multiplayer game taking place in a submarine travelling through the icy depths of Jupiter's moon Europa.
http://www.barotraumagame.com/
1.67k stars 394 forks source link

TagAction improvements #13974

Closed dakkhuza closed 1 month ago

dakkhuza commented 1 month ago

The first in a series of PR's based on requests from some XML modders.

Improves the TagAction to allow for better tagging, mainly:

Example XML for testing

<ScriptedEvent identifier="tag_test">
    <SpawnAction speciesname="Crawler"/>
    <SpawnAction npcsetidentifier="outpostnpcs1" npcidentifier="commoner" spawnlocation="Outpost" teamid="None" />
    <SpawnAction npcsetidentifier="outpostnpcs1" npcidentifier="commoner" spawnlocation="Outpost" teamid="Team1" />
    <SpawnAction npcsetidentifier="outpostnpcs1" npcidentifier="commoner" spawnlocation="Outpost" teamid="Team2" />
    <SpawnAction npcsetidentifier="outpostnpcs1" npcidentifier="commoner" spawnlocation="Outpost" teamid="FriendlyNPC" />
    <TagAction criteria="speciesname:Crawler" tag="allcrawlers" />
    <TagAction criteria="speciesname:Human" tag="allhumans" />
    <TagAction criteria="players" tag="players" />
    <TagAction criteria="humanprefabidentifier:commoner" tag="team_none_commner" team="None" />
    <TagAction criteria="jobidentifier:mechanic" tag="team1_mechanic" team="Team1" />
    <TagAction criteria="humanprefabidentifier:commoner" tag="team2_commoner" team="Team2" />
    <TagAction criteria="humanprefabidentifier:commoner" tag="friendlynpc_commoner" team="FriendlyNPC"/>
</ScriptedEvent>
Regalis11 commented 1 month ago

Read through the changes and gave the new features a test, and everything seems to work as expected. Merged this to our private repo now https://github.com/FakeFishGames/Barotrauma-development/commit/748b63d834bfd0ad68543169d8973d3b8906e43d. Thank you for your contribution! :)