Model issues

Discussion in 'Starcraft 2 (SC2) Editor Help' started by DonMushroom, Mar 27, 2012.

  1. DonMushroom

    DonMushroom Member

    I am looking to morph/switch model of a unit at the end up a upgrade on top of the upgrade itself.

    So for example if i have a few zerglings out and a roach. When i get the zergling speed upgrade the zerglings upgrade as normal and the roachs model morphs/cwitches into a queen but stays a roach in all other aspects. :)

    Oh and how to change there portrait at the same time :)
  2. Dave312

    Dave312 Censored for your safe viewing

    You need to use actor events to change the model. You need to add 3 actor events: one which upgrades all existing units to the new model when the upgrade is completed; one which upgrades units to the new model when the unit is trained/created if the upgrade has been completed; and the last one changes the units death model if the upgrade has been completed.
    Code:
    Upgrade.<Your_Upgrade>.Add
       ModelSwap <Upgraded_Model>
    
    ActorCreation
       ValidateUnit <Unit_Upgraded>
       ModelSwap <Upgraded_Model>
    
    UnitDeathCustomize
       ValidateUnit <Unit_Upgraded>
       DeathCustomized Upgrade
    
    <Upgraded_Model> is the new model that you want to be used for the unit.
    <Unit_Upgraded> is a validator which checks if the player has researched the upgrade.

    In the last event, the action is DeathCustomize Upgrade. In order to get this to work, you need to add a new customized death to the unit and call it upgrade. To do this, go to the Actor for the unit and open up the Combat: Custom Death +. Add a new index to the box at the top and set the Model value to the death model for your new unit model and set the Name value to type Custom and string Upgrade.

    Look at the actor events for when the zergling unit is upgraded if you want a reference.


    You should be able to use a similar process to also upgrade the portrait as well:
    Code:
    UnitPortrait.*.Customize
       ValidateUnit <Unit_Upgraded>
       PortraitCustomize <Upgraded_Portrait> _Unit

    Let me know if you need further assistance or if I have glossed over something you don't understand.
  3. DonMushroom

    DonMushroom Member

    Model works great :D Thanks

    Cant seem to get the portrait working though :(
  4. DonMushroom

    DonMushroom Member

  5. DonMushroom

    DonMushroom Member

    I have tried everything i can think of. :(

    I just cant get the portrait to change at the end of the upgrade. I have tried using Upgrade effects, Tried using Actor event effects and i just cant seem to get it to change.

    Has anyone tried changing a portrait at the end of a upgrade before?
  6. Dave312

    Dave312 Censored for your safe viewing

    Sorry it has taken me so long to get back to you about this. I have meaning meaning to look into this further but haven't had a chance/forgotten about it until now.

    There was a minor error in the event that I posted for the customized portrait. When setting the portrait, you want to leave the Actor parameter blank. It should now look like this:
    Code:
    UnitPortrait.*.Customize
       ValidateUnit <Unit_Upgraded>
       PortraitCustomize <Upgraded_Portrait>
  7. DonMushroom

    DonMushroom Member

    Still cant seem to get it to work :(
  8. Dave312

    Dave312 Censored for your safe viewing

    Is the event exactly the same as what I posted? What happens if you delete the Term (the middle line)?

    I have tested what I posted so I know it works.
  9. DonMushroom

    DonMushroom Member

    If i delete the Term it changes from the start so that bit works. :)

    The term is the same as the model swap though and that works perfectly. So why would it not be working? :(
  10. Dave312

    Dave312 Censored for your safe viewing

    That is a good question, but it has to be the Term that is causing it. My suggestion is to try playing around with it. Change which validator you are using (try Life > 3/4 HP and see what happens). Unfortunately I can't replicate your problem so I don't know what else I can tell you to do.
  11. DonMushroom

    DonMushroom Member

    Thanks again for all the help :)

    Will see what i can do.

Share This Page