Jump to content


Photo

Toggle Weapon

toggle

  • Please log in to reply
3 replies to this topic

#1 Felipe Roll-st

Felipe Roll-st

    Talion

  • Members
  • 83 posts

Posted 21 November 2017 - 07:06 AM

Hi, I have a problem with my new hero, I added a azog model which uses lurtz skeletons and animations, now, azog's model obviously doesn't use a bow but only a maze, what part of code do I have to modifiy so when he's spawned he has his sword instead of the bow, (I removed the toggle ability from his commandset)



#2 NewErr

NewErr

    Elf-friend

  • Project Team
  • 2,177 posts
  • Location:Romania
  • Projects:Wars of The Firstborn
  •  World Wide Artist

Posted 26 November 2017 - 09:25 PM

Well to be able to do that you need to interchange the WEAPONSET_TOGGLE_1 flag for all animations, basically removing from sword and give it to bow. Also you need to change the WeaponSet. This is a wee tedious process.
Another option would be to give your unit a upgrade when he is spawned and by that upgrade you change it's WeaponSet (so basically a auto-toggle on spawn). This is more elegant,faster and avoids to batter your head to the wall when your anims are screwed up using the first method. :D



#3 Felipe Roll-st

Felipe Roll-st

    Talion

  • Members
  • 83 posts

Posted 28 November 2017 - 05:03 AM

thanks for your help NewErr, I did it with the first method and it worked, it's a bit tedious though, the other way seems way simpler but idk the specific code for doing that, now two things, one is, azog has lurtz carnage ability but he can not use it, I removed the conditions in the weaponset & behaviour, I added the upgrage to exp levels but it doesn't work :/, also with isildur he has a special power called narsil, it gives aragorn's anduril FX to his sword, I wan't the FX to disappear when the ability finishes but I haven't been able, any idea, ( I tried to add a timer in the FXlist.ini , didn't work, or I didn't do it properly) :(



#4 NewErr

NewErr

    Elf-friend

  • Project Team
  • 2,177 posts
  • Location:Romania
  • Projects:Wars of The Firstborn
  •  World Wide Artist

Posted 02 December 2017 - 05:33 PM

In any case, I've seen the Mountain Troll has such behavior.
 

    // When created, automatically switch to rock-throwing
    Behavior = DoCommandUpgrade Module_DoCommandUpgrade    
        TriggeredBy = Upgrade_SwitchToRockThrowing
        GetUpgradeCommandButtonName = Command_ToggleMountainTrollRockThrow
    End

EDIT: While I feel that I was not detailed enough with the second option and have tried this myself, I will elaborate a bit.

First of all the above behavior will 'trigger' a button, so that means the upgrade in TriggeredBy will trigger the button you specify in GetUpgradeCommandButtonName. That means you need to get the upgrade as soon as the unit is spawned, for example at the first level in the experiencelevels.ini. It can be any simple object Upgrade, or you can use any existent one (I used a CAH toggle one for example). The commandButton must be a valid command that is also present in the unit's commandset (it can be on any slot, so if you place it on 7+ it won't even be visible). So you need to add a TOGGLE_WEAPONSET command and attach it to the commandset.

Hope this helps even more.


Edited by NewErr, 04 December 2017 - 10:29 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users