The 3rd Age

Gladiator Heroes

Gladiator Heroes

6 heroes are remade with powerful new spells

Button for The 3rd AgeButton for The Dwarf HoldsButton for The Elven AllianceButton for Helm's Deep Last HopeButton for GothmogtheOrcButton for BFME+Button for The Four AgesButton for HDR HeadquartersButton for Middle Earth CenterButton for Project Perfect Mod

Become an affiliate!

   

Quick Lists

Top Rated Popular New Updated Last Comments Users

Register and log in to move these advertisements down

The Power of the DoCommandUpgrade Behavior

Avatar of modboy451

modboy451

Category: Code
Level: Beginner
Created: Tuesday December 14, 2010 - 11:57
Updated: Thursday November 3, 2016 - 17:53
Views: 4585
Summary: A neat behavior that is will show you

Rating

Staff says

3.0

Members say

-

Average

3.0/5.0

1 vote

Page 1 2 3 4
You can use the docommandupgrade to do a neat trick with toggle weapons.

When a Hero/CAH/Unit Is built you can have him start with as he has just toggled weapon!

This is what the CAH Archer class uses so it starts with a Bow out instead of a sword...
              
Code

Behavior = DoCommandUpgrade ModuleTag_CreateAHeroMakeSureArcherUsesBowInitially
TriggeredBy                        = Upgrade_CreateAHero_ClassArcher
GetUpgradeCommandButtonName        = Command_CreateAHero_A_ToggleWeapon
RemoveUpgradeCommandButtonName    = Command_CreateAHero_A_ToggleWeapon
    End

what this Code is saying is that if if you are using the CAH class archer:
we want you to put the toggle button on the commandset if its not already there and do the toggle once and then take it of the commandset, unless it was already there.

(the character starts with a sword so if you removed the code createahero.ini he/she would start with a sword instead)


BUT.........................


If you were using this on say...faramir then it might look like this
              
Code

Behavior = DoCommandUpgrade ModuleTag_UseSwordInitially
TriggeredBy = Upgrade_StartWithSword
GetUpgradeCommandButtonName = Command_ToggleFaramirWeapon
End

(MUST put Upgrade_StartWithSword in the Proper Experience Level and define it in upgrade.ini, it dosent have to be Upgrade_StartWithSword it can be anything you want)
Basically This Code is Saying that when he is built he will automatcally toggle weapon once.

You still With Me???

Now... say you took the toggleweapon command off of faramir's commandset but you wanted to have him start with a sword (starts with bow by default)
you would need to add this line in the docommandupgrade behavior:
              
Code

RemoveUpgradeCommandButtonName    = Command_ToggleFaramirWeapon


so it would look like this:
              
Code

Behavior = DoCommandUpgrade ModuleTag_UseSwordInitially
TriggeredBy = Upgrade_StartWithSword
GetUpgradeCommandButtonName = Command_ToggleFaramirWeapon
RemoveUpgradeCommandButtonName    = Command_ToggleFaramirWeapon
End


you could also just put the toggle weapon in the commandset assinged to a button number that is 7+

EX:
              
Code

CommandSet GondorFaramirCommandSet
1 = Command_ToggleStance
2 = Command_xxxxxxxxxxxxxxxxxxxxxx ; <<<command that replaces toggle weapon goes here
3 = Command_SpecialAbilityWoundArrow
4 = Command_ToggleMounted
5 = Command_FaramirFakeLeadershipButton
6 = Command_SpecialAbilityCaptainOfGondor
7 = Command_ToggleFaramirWeapon ; <<<<<toggle weapon goes in slot 7+ therefore does not appear in palantir
12 = Command_CaptureBuilding
13 = Command_AttackMove
14 = Command_Stop
16 = Command_SetStanceBattle
17 = Command_SetStanceAggressive
18 = Command_SetStanceHoldGround
End


if you did it like this you would not need the line:
              
Code

RemoveUpgradeCommandButtonName    = Command_ToggleFaramirWeapon



That's it for toggle weapon!
the next page is shorter

Next Up: Triggering Powers

Comments

Display order: Newest first

modboy451 - Thursday December 16, 2010 - 8:31

Yes, im sure there are other uses

clank234 - Thursday December 16, 2010 - 5:39

so this teaches you how to use a power straight away without cicking it???

Go to top

 

"One site to rule them all, one site to find them,
one site to host them all, and on the network bind them."

 
0:21:50