HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Help with a trigger

10-10-2004, 05:25 AM#1
badomen
ok heres what i need:

A trigger that changes the owner of a selected building from player (N passive) to who ever triggered it

I would like the event to be triggered by the up arrow on key board

Also it would cost 10 gold

So it would have to check:
That player X has <10 gold
That the building is owned by player (N passive)

And it would have to:
Change unit to player x
Remove 10 gold from player x

i cant get it to work and it doesnt help that i d/l the advanced editor and cant seem to find anything anymore

Can anyone help me?
10-10-2004, 05:40 AM#2
Guest
Code:
event A unit casts a spell
condtion spell equal to....get a house??
actions turn on different trigger
turn on another trigger

(different trigger)
event triggering Player has 9 or less gold
condition
event do nothing


(another trigger)
triggering Player  has 10 or more gold
condtion
action- give unit to owner of casting unit (or triggering player)
remove 10 gold from (triggering player) owner of csting unit
.
Sorry about any types and stuff I didnt have WE on at the moment but tahts bsiclly it
10-10-2004, 05:42 AM#3
Guest
Oops just reread the up thingy then it sahould be like this
Code:
player presses the up key
condtion
actions turn on different trigger
turn on another trigger

(different trigger)
event triggering Player has 9 or less gold
condition
event do nothing


(another trigger)
triggering Player  has 10 or more gold
condtion
action- give (bulding) to owner of casting unit (or triggering player)
remove 10 gold from (triggering player) owner of casting unit


oh and read my sig ^_^
10-10-2004, 05:43 AM#4
Rafael Br
Use a trigger like this:
Code:
Events
    Player - Player 1 (Red) Presses the Up Arrow key - Do this for all players
Conditions
    ((Your unit) is selected by (Triggering player)) Equal to True
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
        ((Triggering player) Current gold) Greater than 10
    Then - Actions
        Unit - Change ownership of (Your unit) to (Triggering player) and Change color
        Player - Set (Triggering player) Current gold to (((Triggering player) Current gold) - 10)
    Else - Actions
        Game - Display to (Player group((Triggering player))) the text: You don't have enou...
10-10-2004, 05:51 AM#5
Guest
Quote:
Originally Posted by Rafael Br
Use a trigger like this:
Code:
Events
    Player - Player 1 (Red) Presses the Up Arrow key - Do this for all players
Conditions
    ((Your unit) is selected by (Triggering player)) Equal to True
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
        ((Triggering player) Current gold) Greater than 10
    Then - Actions
        Unit - Change ownership of (Your unit) to (Triggering player) and Change color
        Player - Set (Triggering player) Current gold to (((Triggering player) Current gold) - 10)
    Else - Actions
        Game - Display to (Player group((Triggering player))) the text: You don't have enou...

Take the spotlight would you...im trying to earn some rep cant you see!!
10-10-2004, 05:55 AM#6
Rafael Br
Quote:
Originally Posted by rtm_is_back
Take the spotlight would you...im trying to earn some rep cant you see!!
I just posted one minute after you, your post wasnt was there before I started typing , I alredy did this before, and nobody cared about it.Anyway, let's let badomen decide wich solution will he use... The main purpose is helping him...Isn't It?
10-10-2004, 06:04 AM#7
badomen
Conditions
((Your unit) is selected by (Triggering player)) Equal to True

there are 4 types of buildings these can be done to(changeing ownership trigger) so i cant do (unit-type of unit) and i cant pick a spicific unit so what would it be?

if you dont understand i can send you a map so u understand what im talking about
10-10-2004, 06:15 AM#8
Rafael Br
Just make a "Or - Any conditions are true", then check it for all 4 ones, then, since the owner of the unit is not the selecting player, he can't be selecting more than one unit, then the new trigger would be like this:
Code:
Events
    Player - Player 1 (Red) Presses the Up Arrow key
Conditions - None -They are useless now
Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        If - Conditions
            Or - Any (Conditions) are true
                Conditions
                    (Unit-type of (Random unit from (Units currently selected by (Triggering player)))) Equal to (Your unit Type) - Do this for all 4 ones, don't forget to put them on the or.
        Then - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                If - Conditions
                    ((Triggering player) Current gold) Greater than 10
                Then - Actions
                    Unit - Change ownership of (Random unit from (Units currently selected by (Triggering player)) to (Triggering player) and Change color
                    Player - Set (Triggering player) Current gold to (((Triggering player) Current gold) - 10)
                Else - Actions
                    Game - Display to (Player group((Triggering player))) the text: You don't have enou...
        Else - Actions
10-10-2004, 08:13 AM#9
Dead-Inside
Rafael, why do you use "Random" in his selection? He's only selecting one you just need to check what it is (If he's selecting the building that is).

Badomen if you give the map to me (Host it somewhere and PM me the link) I'll fix it for you. I'm guessing you want to give the unit back to a neutral player once the player who "bought" the house is done with it? Or is it a permanent buy?

Lastly, @rtm is back,
You know, you're way off with your triggers, and you didn't even need to use more then one trigger in the first place. There's not such event as "Player has XX gold". Nor does it EVEN RUN THE EVENTS if you run the trigger from another trigger. So really, earning reps like that isn't exactly the best idea.

Regards
Dead-Inside
10-10-2004, 08:33 AM#10
badomen
...but i fixed it with alot of conditions ect just took some shuffling and a few things here and there so thatnks anyway but i got it :)