After a little bit of research I have found out what Action137 is used for. It is basically used to spawn in objects that are PlaceAtStart false based on an event rather than the timer it defaults to. This is used in Dominion to spawn in the base shields based on what team is controlling the base.
There are four values that you set when you use Action137.
- ObjectReference. This is the candy spawner object itself. Not sure if it can be used in regular candy spawner obejets or not. Useually used with Iterator.CandySpawnerObject
- Bool: This bool is used to indicate weather or not the object can spawn. If false, the object will never spawn. You must set this back to true to enable spawning.
- Bool: This bool will instantly spawn the object if enabled. I equate this to object is enabled. Does nothing if the first bool is false.
- PlayerReference: This is the player that caused the spawn. If the object is a vehicle, it will force the player into the vehicle. Does nothing if the first bool is false.
To use this, you need a couple things first.
You obviously need a object filter. Here is the one I am using while testing.
<Filter labelIndex="candy_obj" name="candy_obj" />
Then you need to add a GameObjectFilters section under the normal object filters and add a reference to the normal ObjectFilters section then add a reference to that object filter.
<GameObjectFilters> <Filter type="CandySpawner" labelIndex="candy_obj" name="candy_obj" /> </GameObjectFilters>
now you are setup to use Candy Objects. To use them you would put this in the sections where you want to spawn the object. Set both of the bools to false to make sure it will not spawn, both true to spawn the object.
<E type="Action" name="ActivateTrigger"> <Param type="TriggerReference"> <T type="Trigger" trigType="Subroutine" execMode="OnCandySpawnerFilter" name="Trigger7_Subroutine26"> <GameObject type="CandySpawner" filter="candy_obj" /> <Elements> <E type="Action" name="Action137"> <Param type="ObjectReference" varRefType="ExplicitObjectType" dataType="Iterator.CandySpawnerObject" /> <Param type="Bool">True</Param> <Param type="Bool">True</Param> <Param type="PlayerReference" varRefType="ExplicitPlayerType" dataType="NONE" /> </E> </Elements> </T> </Param></E>
If you would like to make things easier on yourself, I propose going into the ksoft documents and adding a name to action 137 to be used later easier. It will also make everything you decompile show that name instead of Action317 which makes it easier to read.
To do this, go to the folder where you have KSoft installed, and then go into Games/Halo4/Definitions/ and open MegaloScriptDatabase.xml in your favorite text editor. Then Search for
<Action DBID="137" template="ObjectBase"> <!--candy spawner related--> <Param sigID="1" type="Bool" name="Bool" /> <Param sigID="2" type="Bool" name="Bool" /> <Param sigID="3" type="PlayerReference" name="Player" /> </Action>
<Action DBID="137" name="ObjectSetSpawnEnabled" template="ObjectBase"> <!--Fruit Spawner--> <Param sigID="1" type="Bool" name="Bool" /> <!--Weather or not the object will spawn--> <Param sigID="2" type="Bool" name="Bool" /><!--If the previous is true, set weather or not the object is instant spawn--> <Param sigID="3" type="PlayerReference" name="Player" /><!--The player that spawned the object.--> </Action>