Actor Trouble with newly created units.

Terrabull

Veteran Member (Done that)
Reaction score
38
I am using the ModelSwap actor event to change a unit's model when a certain upgrade is researched. This works for units that are already on the field, but when I spawn more units with a trigger they have the upgrade, but not the modelswap.
Here is an example of what I am doing:

Upgrade.UnitLevel3.Add
ModelSwap DominionKillTeam


I've also tried it without the ".Add" and I have the same effect. Any help would be appreciated.
 

Dave312

Censored for your safe viewing
Reaction score
269
The reason this is occuring is because the model swap only occurs when the 'research completed' event occurs. You need to add another event which occurs on actor creation that checks if the research has been completed and then runs the model swap event. Something like this should do it:
Code:
ActorCreation
ValidatePlayer.HasUnitLevel3
ModelSwap DominionKillTeam

Note that you will need to create the validator HasUnitLevel3 which checks if the player has researched your upgrade.
 

Terrabull

Veteran Member (Done that)
Reaction score
38
I tried your method and surprisingly it has the same effect as before. It works on the existing units, but the ones who are made later don't transform.

EDIT: Okay, turns out that's not what happened, somehow I screwed up my validator. I couldn't think of any way to do it besides Player Requirement. I'm still not sure what I need to put in the requirement to get this thing to work right.
 

Dave312

Censored for your safe viewing
Reaction score
269
Your validator will need to be of the type Player Requirement and you will need to create a requirement. On the requirement property of the requirement, under the use folder, add a node and set the type to Count Upgrade, Alias to the name of the upgrade and State to Completed. Now make sure your validator is linked to the requirement you have just created. Hopefully that should get it working.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top