Changing model with upgrade?

Blazer-X

New Member
Reaction score
0
Hey, I was wondering how to change a unit's in-game model to another following another. I was trying to get the Battlecruiser to change its model to that of the Merc BC via the weapon refit upgrade. I've looked at the marine combat shield upgrade as reference and so far managed to change the icon and portrait, but I can't seem to get the actual model to change. Help?

Thanks.
 
Look in the events for the unit's actor. Model Swap should do the trick. I don't have much time to give extensive details right now, but I'll come back if you need more help.
 
Well, it kinda did the trick. All battlecruisers made beforehand are fine. However, any battlecruisers I created after the upgrade used the old model. Granted, all I did was added model swap as an extra event after upgrade, so I might be doing something wrong. Please elaborate?

Thanks
 
that's a good start. Keep that event.

To fix it so that every BC created after the upgrade has the right model, you need a new Validator and another event in the actor. The Validator will check if you have the upgrade. The event will be Actor Creation - Term Validate Player [the validator you just made] - Model Swap.

Look up validators like Has Marine Shield Upgrade or Missing Marine Shield Upgrade to get an idea of how to make yours. Validate - Player should be Player Origin though.


You may also need to add the validator you specific events to make sure the right animations, etc are playing for both models. It's up to you how detailed you want to make it.

Good luck!
 
Well, I got the battlecruisers to come out as the merc model, but now I'm running into 2 issues.

1) Yamato Gun charging is screwed up with the new model. Its using the regular BC one, I'm guessing. For some reason, its always pointing either up or down. Is there a way to switch the charging actor to that of the merc BC's?

2) Death animation is still using the regular BC's. Is there a way to switch that as well?

In addition, by just switching the model, could I get the BC to use the same "rotating cannon attack" animation that the merc BC uses? Or would I need to add that animation in as well?

I think all in all, what I need might actually be an actor swap than just a model swap. If possible, please explain to me how the whole actor event stuff work?

Thank you
 
(It can be done with one actor. All you need to do is figure out which events will give the results you want for both models, and which won't. For the ones that won't you must create duplicate events for, and check for the Term - ValidatePlayer - PlayerHasUpgrade and Term - ValidatePlayer - PlayerNotHaveUpgrade, to make sure the correct event is triggered depending on which model you know will be present.)

You can also do an actor swap if you'd rather want that. To do this, replace the model swaps you've made with destroy. Now this actor will be removed whenever you have upgraded to the new battle cruiser. Create another actor for the new battle cruiser. Set up and event in this new actor that will create this actor on unit birth - playerHasUpgrade.
To change models already created when you get the upgrade you should make an event in the old actor. PlayerGetsUpgrade - Create:NewActorName. This is all pseudocode, so don't take it literally.

Let me know if you can't get the new actor to line up with the old. It can be fixed, but I think it will if you use the right bases for your actors.


As for explaining the actor events, the basics are simple, but it's a big subject so I can't go into it all without you asking for more specific information. I'll try help you out though. An event's first line tells what the actor watches for to happen. If you add a term, the action will only be taken if the term is true, like a condition. The action that follows will be taken on the unit that the actor was created for, usually. You can make complex events as well though, but I won't go into that. Just think that by default, an action will always affect the unit that the actor was created for.
 
Well, my main issue right now is the death animation. From what I can see, each actor is linked to one model only (in the combat tab). So how should I get it so that it changes to play the proper death animation?
 
Make an actor for your alternate death animation if you don't have one already. Set it up with model, animation on creation and actor destruction when animation is over. Actor type could for example be Model - ModelAnimationStyleOneShotNoOrphan.

Go back to the actor for the unit you're working with. Add an event UnitCustomDeath.[UnitName] - Validate that it's upgraded - Create custom death actor (the actor for the new death animation you just created)

Edit: I'm not sompletely sure about this one, but I hope it will do the job.
 
The death animation thing worked! Thanks!

Got a little side-problem. Its not really related to changing models anymore. I'm trying to add an extra attack to the unit after it has been upgraded. I tried having the attack initially disabled, and ten enabling it through the "upgrades - effect" tab. Problem is, the BCs that are created before the upgrade still has the weapon disabled, while all the new BCs are fine. I'm sure this is not supposed to be a hard process, but I'm just not sure how to get this to work.

Edit: Nevermind, I found another approach: Using a validator on the weapon effect itself to require the BC to be upgraded. Otherwise, even though the BC technically has the weapon, it cannot "use it".
 
Glad your model changes correctly now :)

As for your other problem, I'm not sure how to do that without either using triggers (find all battlecruisers and do the updates), or having every battlecruiser spawn with a behavior that periodically checks if the player has the upgrade or not. Having so many periodically checks doesn't seem efficient to me, but maybe the SC2 engine handles stuff like that just fine.

The workaround doesn't sound too bad either. Could even be good to be able to see what you can get by upgrading next. Depends on how you want it to be presented.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    Check out my new teeth in my profile pic :)
  • The Helper The Helper:
    Fucking bionic
  • The Helper The Helper:
    Zirconium
  • V-SNES V-SNES:
    Looks great!
    +1
  • The Helper The Helper:
    Happy Thursday!
    +1
  • The Helper The Helper:
    Added new Crab Bisque Soup recipe - which is badass by the way - Crab Bisque - https://www.thehelper.net/threads/soup-crab-bisque.196085/
  • The Helper The Helper:
    I feel like we need to all meet up somewhere sometime. Maybe like in Vegas :)
    +2
  • The Helper The Helper:
    Would love to go to Vegas I have never been and it would be an adventure! Who is in?
  • The Helper The Helper:
    at least the full on bot attack has stopped it was getting ridiculous there for a while and we use cloudflare and everything
  • jonas jonas:
    I'm sure my wife would not be happy if I went to Vegas, but don't let that stop you guys - would be hard for me to attend anyways
    +1
  • jonas jonas:
    Do you know why the bot attack stopped?
  • The Helper The Helper:
    maybe they finally got everything lol
  • Ghan Ghan:
    There's lots of good food in Vegas.
  • Ghan Ghan:
    Everything tends to be pretty expensive though so bring your wallet.
    +1
  • The Helper The Helper:
    I have to wait longer if I am going for food because my teeth are still messed up from the work and I still cannot eat right. Going to be a couple more months before that gets better
    +1
  • The Helper The Helper:
    I would immediately hitting the dispensary though :)
    +1
  • Varine Varine:
    My Xbox account got hijacked, and apparently I have a different one from like 10 years ago that Microsoft keeps telling me is the right one
  • Varine Varine:
    Like NO, I mean for some reason that one is attached to my email, but it's not the right one
  • Varine Varine:
    I have a different one, and that one has my credit card attached to it and I would like that credit card to not be attached to it if I can't get it back
  • Varine Varine:
    Anyway Microsoft is not very helpful with this, they just keep telling me to fill out the Account Recovery form, but that just redirects me to the other account
  • The Helper The Helper:
    They should not allow you to put a credit card on a account that does not have human customer service you can call
  • Varine Varine:
    That's the only thing that got hijacked at least. I don't totally know how these integrate together, but it seems like I should be able to do this via the gamertag. Like my email is still mine, but they changed the email to that account I'm guessing.
    +1
  • Blackveiled Blackveiled:
    I went to Vegas a few weeks ago to visit my mom. I had never been either, lol! But I'm working in Salt Lake City at the moment so it's not a far trip.
    +1
  • The Helper The Helper:
    I have never been to Vegas and it is on the bucket list so...

      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