HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Simple Array trigger help

06-02-2004, 01:39 AM#1
2nickelstripper
Howdy:

I am having some array trouble.

What im trying to do is have an array mark if a player is in a region or not and record how much gold he has when he enters. If the player in the region types a messsage and he has enough gold, an upgrade happens.

I have two triggers, one that sets the array values when he enters, and one that checks what the values are after he types a message.

But it is not working.

I think my error is in calling the array value back, but im not sure.

Here are a couple of test triggers i am using rather than posting the very long one in my map with many ifs and such:


Unit enters Area Trigger
Quote:
Entering Area Test

Entering Area Copy

Events
Unit - A unit enters Test Region <gen>

Conditions

Actions
Set Int_Test_Array[(Player number of (Triggering player))] = 1
Set NEupgradeGold[(Player number of (Triggering player))] = ((Triggering player) Current gold)

Unit Types chat line
Quote:
chat line test

Events
Player - Player 2 (Blue) types a chat message containing -test as An exact match

Conditions
Int_Test_Array[(Player number of (Triggering player))] Equal to 1
NEupgradeGold[(Player number of (Triggering player))] Greater than or equal to ((Triggering player) Current gold)

Actions
Game - Display to (All allies of Player 1 (Red)) for 20.00 seconds the text: It works


Could anybody tell me what I am doing wrong? I would be very gratefull :D
06-02-2004, 02:30 AM#2
Shimrra
OK, I belive your problem is that your using two conditions. From what I've heard, should mean that only one has to be true. Try using the function "and". Also, please don't post any inappropriate language on this site. We need to keep it clean. Thank you.
06-02-2004, 02:37 AM#3
2nickelstripper
oh geeze, sorry about that, i forgot the text thing.

I tried adding an add condition and it did not work :(

Any other thoughts anybody?
06-02-2004, 02:56 AM#4
Shimrra
Are yu playing as Player 1 or 2? Your event says Player 2 types a message, so if your Player one, it wouldn't work.
06-02-2004, 03:05 AM#5
2nickelstripper
Just tested it, i am playing as player 2.

However, i tried altering the array abit. I put the postion to 1 instead of (player number of triggering player) and it worked EXCEPT, it does not give me the function i am hopeing for.

A player on the other side of the map on the same team could type in the message (after i add more text events for more players) and trigger the upgrade as long as someone was in the region.

It must be the command im using to set the location in the array, but i dont know what else there is?