HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Trigger Question

11-13-2002, 01:59 AM#1
Guest
I have a question. For my map I want a player to type in a chat message to pick a hero at the beginning. I want the player to have only the hero he picks though. So i got it
event player types in chat message
action spawn hero at region

what condition or how would I change the trigger so when the player already gets a hero, but types it in again he doesnt get another hero? Thanks
11-13-2002, 02:13 AM#2
Guest
I'm assuming you have a seperate trigger for each player. If this is not the case then make a seperate trigger for each player just like you have above and at the end of the trigger create an action that turns the trigger off. This will prevent the trigger from being run again. Example:

Event
- Player types in Chat message

Action
- Spawn hero at region
- Trigger - Turn off (This trigger)
11-13-2002, 02:14 AM#3
The_Cyberdemon1
Well, you can make a boolean variable for the player (if you made a VARIABLE ARRAY, it saves time)
We will call the variable, GotHero

So, we will enter this for our condition.

Boolean - GotHero[Player Stuff] equal to False

For PLAYER STUFF, you will put in (Player Number of (triggering player)).

This will do nothing unless you make this in the same trigger. It will be an action.

Set variable GotHero[(Player Number of(Triggering player))] = TRUE

This will make it so the player cannot get another hero.
You will have to set the variable for every player to false at map initilization. Did that help?
11-13-2002, 02:16 AM#4
The_Cyberdemon1
[glow=stregnth]Dark Jojo's idea will work, but if there is more than one player, you will have to make a trigger for every player[/glow]
11-13-2002, 02:42 AM#5
Guest
Which I noted in my post
11-13-2002, 04:56 AM#6
Guest
yeah it did help thanks. I have a map where to get money you have to build a building next to certain buildings scattered across the map. There is a repeating timer for every 2 mins. So every 2 mins the player gets 1 gold for each building he built next to. so if he had 10 buildings he gets 10 gold. Now it works perfectly fine. But I have 40 something buildings with 8 players. And I dont understand too much of variables. I finished player 1 and I had to manually do all those triggers
action- turn expires
condition- number of units in units owned by player 1 red of type village = to 1
event- add 1 gold to player 1 current gold

So is there a faster way of doing this instead of manually doing this same trigger 40 times? Thanks for the help =P
11-13-2002, 09:49 AM#7
Guest
Can anyone help me with this?
11-13-2002, 11:03 AM#8
Insaniteus
Make an integer variable NumberofBuildings

Set Numberofbuildings = number of units owned by player equal to (Whatever)
Add NumberofBuildings to player _'s gold

Narly everything time saving involves variables like this.

-Insaniteus-
11-13-2002, 08:13 PM#9
DKSlayer
Hey dude, hope the Commander is going good, Anyways I can help out on the map if you want. Just let me look at it then I can update give it back and delete map. I understand how it bites to feel there is a better way for it to work. So email it to me if you want. And I can optimise it.
11-14-2002, 01:40 AM#10
xttocs
Cyberdemon -
i realize that the glowie text does kick, but dont type [glow=strength=4,color=orange]EVERYTHING[/glow] in it
11-14-2002, 09:25 AM#11
Aiursrage2k
Event:
Player1 types a chat message containing d00dString as an exact
.
.
.
Playerx types a chat message containing d00dString as an exact

message
Condtion:
If PlayerHero[(PlayerNumberof(TriggeringPlayer))] == 0
Action:
Create 1 d00d at region y for player[(PlayerNumberof(TriggeringPlayer))]
Set PlayerHero[(PlayerNumberof(TriggeringPlayer))] = 1

Where x is the number of players you want this trigger to occur for, and d00dString is the String match, and d00d is the unit type.

Bah it seems you already solved this...
Trigger Question - Wc3C.net