Warriors of Darkness Forum

Welcome to Clan WoD's Forum!
 
HomeHome  FAQFAQ  SearchSearch  RegisterRegister  MemberlistMemberlist  UsergroupsUsergroups  Log in  

Share | 
 

 Need help with triggering hero abilities

Go down 
AuthorMessage
TheSpartan
Member
avatar

Number of posts : 50
Username : TheSpartan
Clan : Clan SL
Registration date : 2008-01-26

PostSubject: Need help with triggering hero abilities   Sun Feb 17, 2008 11:00 am

If someone could, could they help me with triggering abilities Question

Thanks!
Back to top Go down
View user profile
HamAma
Global Moderator


Number of posts : 227
Username : HamAma
Clan : Clan BS
Registration date : 2008-01-25

PostSubject: Re: Need help with triggering hero abilities   Sun Feb 17, 2008 4:40 pm

Elaborate.

Tell us what exactly you need help with. For example, you could say something like "ooh I have this cool idea in my head it consists of lots of explosions and a flame strike and omg a lot of other stuff but I dont know how to do it". But that would be horrible, due to little capitalization and no punctuation. But I'm sure you get the point.
Back to top Go down
View user profile
Alex
World Editor Mod
avatar

Number of posts : 44
Username : SirAlexander
Registration date : 2008-01-26

PostSubject: Re: Need help with triggering hero abilities   Tue Feb 19, 2008 3:43 pm

I would gladly help, just ask and I will help you, but remeber I may always not be able to help you because my rpg is at the basics and I need to fix it up some more.
Just either say what you need here or p.m me.
Back to top Go down
View user profile
TheSpartan
Member
avatar

Number of posts : 50
Username : TheSpartan
Clan : Clan SL
Registration date : 2008-01-26

PostSubject: Re: Need help with triggering hero abilities   Fri Feb 22, 2008 6:54 pm

Like for starters, How would you make the rage ability on the vampire? (The one where after killing X amount of enemies you'll gain att speed and arm for X amount of time).
Back to top Go down
View user profile
Alex
World Editor Mod
avatar

Number of posts : 44
Username : SirAlexander
Registration date : 2008-01-26

PostSubject: Re: Need help with triggering hero abilities   Fri Feb 22, 2008 8:00 pm

That would require triggering, and so your saying If I killed lets say 6 units I would gain a buff?

Ok well, I have come up with this little code.
Variables
1. Kills = Integer
2. Hero = Unit

Abilitys
1. (Your Buff) = Just make a buff that increases the stats of one you want, like if you want attack speed just make the buff Endurance aura and make sure you make the icon invisible.

Triggers
1. Initi
Code:
Start up
    Events
        Unit - A unit Dies
    Conditions
        (Killing unit) Equal to Hero
    Actions
        Set Kills = (Kills + 1)

2. Buff
Code:
Finnishing
    Events
        Unit - A unit Dies
    Conditions
        (Killing unit) Equal to Hero
        Kills Equal to 5
    Actions
        Unit - Add (Your Buff) to (Killing unit)
        Wait 5.00 seconds
        Unit - Remove (Your Buff) from (Killing unit)
        Set Kills = 0

That should do I, and im sure Zero does Blood Spiral differently from what I do, but that should work fine.
Back to top Go down
View user profile
ZeroX2)Fire
Administrator
avatar

Number of posts : 578
Username : ZeroX2)Fire
Registration date : 2008-01-24

PostSubject: Re: Need help with triggering hero abilities   Fri Feb 22, 2008 8:12 pm

Like Blood Spiral on Vampire? (HamAma made it) so he can help you I guess.

_________________

Back to top Go down
View user profile http://clanwod.quickbb.net
TheSpartan
Member
avatar

Number of posts : 50
Username : TheSpartan
Clan : Clan SL
Registration date : 2008-01-26

PostSubject: Re: Need help with triggering hero abilities   Fri Feb 22, 2008 8:15 pm

Alex,

EXACTLY! but for a limited amount of time.
Back to top Go down
View user profile
Alex
World Editor Mod
avatar

Number of posts : 44
Username : SirAlexander
Registration date : 2008-01-26

PostSubject: Re: Need help with triggering hero abilities   Fri Feb 22, 2008 8:17 pm

There ya go I edited my post before.
Back to top Go down
View user profile
HamAma
Global Moderator


Number of posts : 227
Username : HamAma
Clan : Clan BS
Registration date : 2008-01-25

PostSubject: Re: Need help with triggering hero abilities   Sat Feb 23, 2008 5:59 am

Blood Spiral is actually the most difficult spell I've made (all on my own) at the moment. However, that doesn't speak for much, because it's relatively simple. In fact, it's so simple that I guess just about anyone could do it. So I'll copy and paste the trigger here so that you can see how I do it.

Code:
Blood Spiral
    Events
        Unit - A unit Dies
    Conditions
        (Level of Blood Spiral  for (Killing unit)) Greater than or equal to 1
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Killing unit) has buff Blood Spiral ) Equal to True
            Then - Actions
            Else - Actions
                Set SprlCt[(Player number of (Owner of (Killing unit)))] = 0
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Random integer number between 1 and 100) Greater than ((Level of Blood Spiral  for (Killing unit)) + 5)
                    Then - Actions
                        Skip remaining actions
                    Else - Actions
        Set SprlPt = (Position of (Killing unit))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                SprlCt[(Player number of (Owner of (Killing unit)))] Equal to ((Level of Blood Spiral  for (Killing unit)) x 3)
            Then - Actions
            Else - Actions
                Set SprlCt[(Player number of (Owner of (Killing unit)))] = (SprlCt[(Player number of (Owner of (Killing unit)))] + 1)
        Unit - Create 1 Dummy Unit for (Owner of (Killing unit)) at SprlPt facing Default building facing degrees
        Unit - Set level of Roar dummy for (Last created unit) to SprlCt[(Player number of (Owner of (Killing unit)))]
        Unit - Order (Last created unit) to Night Elf Druid Of The Claw - Roar
        Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
        Custom script:  call RemoveLocation (udg_SprlPt)

Code:
Variables used:
SprlCt - Integer Array (9)
SprlPt - Point

Okay, that actually looks more complicated than it really is, because I just make my triggers all sorts of messy. Blood Spiral in this state is far from being "the most effective possible", but it serves the purposes just well enough for me. I tried my very best to narrow it down to one trigger, which is how this came about. There are other ways to do it, though.

In order to understand how the trigger works, first I have to explain the variables. The variables are all listed not too far up, and the former is an array in order to make the skill multi-instancable (or whatever the proper term is). You can actually replace the 9 with the amount of players usable in the game. Note that Blood Spiral doesn't work properly if a player has more than ONE Vampire. But in Zero's RPG, you're not supposed to have more than 1 of any Hero, anyway, so... I don't care! =D

Code:
    Events
        Unit - A unit Dies
    Conditions
        (Level of Blood Spiral  for (Killing unit)) Greater than or equal to 1

We start off with the simple part. The event is "Unit - A unit dies". Simply put, it causes the trigger to be activated when any unit dies. And the condition checks whether the killing unit has Blood Spiral learned (level equal to 1 or greater). Note that I don't remember whether this can leak, which is why I didn't use a variable for "Killing unit". >_>

Code:

    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Killing unit) has buff Blood Spiral ) Equal to True
            Then - Actions
            Else - Actions
                Set SprlCt[(Player number of (Owner of (Killing unit)))] = 0
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Random integer number between 1 and 100) Greater than ((Level of Blood Spiral  for (Killing unit)) + 5)
                    Then - Actions
                        Skip remaining actions
                    Else - Actions

Okay, then we move on to the first part of the actions. This is an if/then/else with an if/then/else inside it. Which is not really good practice, but it works for a lazy person like me, so there. First of all, this checks whether the killing unit has Blood Spiral. Why? Because if it has "Blood Spiral" (buff), then I don't even need to check whether Blood Spiral (ability) will trigger.

If it doesn't have that buff, however, then I make a random integer. If the player isn't lucky enough to get a number which matches the chance of triggering Blood Spiral at that level, then it's just too bad for him, because I'll skip the remaining actions which are the ones that provide Blood Spiral with its actual effects. I also set SprlCt for the killing player to be 0 here, because it means that Blood Spiral must have either 1. never triggered on this Vampire or 2. faded from this Vampire already, and I want SprlCt to reset from 0 units in both cases.

Code:
        Set SprlPt = (Position of (Killing unit))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                SprlCt[(Player number of (Owner of (Killing unit)))] Equal to ((Level of Blood Spiral  for (Killing unit)) x 3)
            Then - Actions
            Else - Actions
                Set SprlCt[(Player number of (Owner of (Killing unit)))] = (SprlCt[(Player number of (Owner of (Killing unit)))] + 1)

How annoying. More if/then/elses! Well, anyway, first of all, we define SprlPt here because using an event response in the trigger will just leak. So we can save a lot of leaks by having SprlPt here.

Then, we operate the third If/Then/Else in this trigger. We ensure that the killing Vampire's Blood Spiral isn't already at the unit cap according to the level of his Blood Spiral ability. If it is at the cap, then we do nothing. If it's not at the cap, then we add one to it, to show that we're increasing the effect of Blood Spiral by 1 level.

Code:
        Unit - Create 1 Dummy Unit for (Owner of (Killing unit)) at SprlPt facing Default building facing degrees
        Unit - Set level of Roar dummy for (Last created unit) to SprlCt[(Player number of (Owner of (Killing unit)))]
        Unit - Order (Last created unit) to Night Elf Druid Of The Claw - Roar
        Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
        Custom script:  call RemoveLocation (udg_SprlPt)

Then we create a dummy unit for the killing unit at where the Vampire is. The trigger then levels up its Roar ability to match the amount of units recently killed by the Vampire. Then we order the dummy unit to Roar, giving the Vampire the damage and armor buff. We then add a 2 second generic expiration timer to the dummy unit, so that he disappears in due time. Byebye!

Oh, and we also remove SprlPt so that it doesn't take up memory when this trigger isn't running. Yeah. SprlCt needs to stay in memory because it'll be referred to every time this trigger runs and succeeds.

Note that Roar will require a max level equal to the max amount of times Blood Spiral can stack up, and should affect either:
- 2 units, Hero, Ground, Allied, 0 AoE
- 1 unit, Hero, Not Self, 0 AoE

Yeah.

If you still have any queries, shoot. Don't feel bad about it, it's because I suck at explaining stuff.
Back to top Go down
View user profile
Sponsored content




PostSubject: Re: Need help with triggering hero abilities   

Back to top Go down
 
Need help with triggering hero abilities
Back to top 
Page 1 of 1
 Similar topics
-
» Knight's (Hero') Armour
» Marvel Super Hero Mashers
» Chess Hero (Chess Training Program)
» Hero Factory 3.0
» Pikmin0207's Hero Factory Gun Kit 1.0 (for LDD)

Permissions in this forum:You cannot reply to topics in this forum
Warriors of Darkness Forum :: Warcraft III :: Mapmaking-
Jump to: