Changing model with upgrade?

Blazer-X

New Member
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.
 

Builder Bob

Live free or don't
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.
 

Blazer-X

New Member
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
 

Builder Bob

Live free or don't
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!
 

Blazer-X

New Member
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
 

Builder Bob

Live free or don't
(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.
 

Blazer-X

New Member
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?
 

Builder Bob

Live free or don't
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.
 

Blazer-X

New Member
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".
 

Builder Bob

Live free or don't
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:
    Friday Yay!
  • mgarcia mgarcia:
    did you guys catch Carl's interview? https://www.youtube.com/watch?v=kuHiMXABkGs
  • mgarcia mgarcia:
    he's the one that informed me about the DVD's working!
  • mgarcia mgarcia:
    he also mentioned the progress on the controllers!
  • The Helper The Helper:
    I did actually it was cool to see the NUON mention
  • The Helper The Helper:
    https://discord.com/channels/985377399338332202/985377399950696481 you can still use this chat too we are two fisted now :)
  • thewrongvine thewrongvine:
    costs me $80 to fill gas tank sad face
  • Ghan Ghan:
    Oof
  • The Helper The Helper:
    Yeah that gas is some expensive stuff :)
  • The Helper The Helper:
    ghan does not have to worry about it he has a tesla and I have a small tank so it does not cost me usually more than 50
  • The Helper The Helper:
    fyi Ghan we are getting an error trying to access stats or world editor tutorials Error 526 Ray ID: 72128c6bf99f6707 • 2022-06-26 02:35:15 UTCInvalid SSL certificate
  • Ghan Ghan:
    An artifact of switching to Cloudflare... the Let's Encrypt certs can't autorenew through Cloudflare.
  • Ghan Ghan:
    I got the forum updated before things expired but there were some other casualties.
  • Ghan Ghan:
    Everything should be fixed now....
  • The Helper The Helper:
    Thank you Ghan!
  • The Helper The Helper:
    Happy Monday!
  • The Helper The Helper:
    new NUON forum mod cubanral!
    +1
  • The Helper The Helper:
  • tom_mai78101 tom_mai78101:
    Started learning how to make tools-assisted speedruns, so I'm lately busy.
  • tom_mai78101 tom_mai78101:
    Here's my current project.
    +3
  • O Old Mountain Shadow:
    that was pretty good!
  • jonas jonas:
    really cool! I saw the game before but always thought it's just a half as good double dragon. Now I realize it actually has a lot of depth!
  • The Helper The Helper:
    I just saw a bunch of running and jumping past all the enemies look like it was scripted as he said I guess I should have watched the whole thing. I only got a couple of minutes in. You should post that video in the forum Tom
  • Darthfett Darthfett:
    "Hi in the chat!"
    +2
  • tom_mai78101 tom_mai78101:
    Currently busy with making the run even better, so I'll post that new one once I'm done. Right now, I had to modify the emulator itself, the tools that makes this video, and some RAM address disassembling / reverse-engineering to get the right values, and such.
    +1

    Staff online

    Members online

    Affiliates

    Hive Workshop NUON Dome World Editor Tutorials

    Network Sponsors

    Apex Steel Pipe - Buys and sells Steel Pipe.
    Top