HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Few Trigger questions

06-12-2003, 01:38 AM#1
combatken
1. How would I disable exp for everyone. Not just a unit, but every unit owned by every player?

2. Can someone help me with this exp trigger? All it does right now is display which players were near the killed unit when it dies.

E: A unit owned by player 12 dies.

A: For each (integer A) from 1 to 11, do

If all units of (units owned by PlayerVariable(Integer A)) are in (Region centered at (position of (triggering unit) with size (1200,1200) equal to true, then do (game - Display to (All players) the text: Exp Gained by player + Name of Playervariable(IntegerA) else do nothing.

When I kill things, the trigger displays "Exp gained by player" 11 times, but no player number after it, and units out of the range of the killed unit (and players that dont exist) shouldnt activate the message. I'm sorta new at triggers, so what can I do to fix that, so it displays the exp gained message for all players who were near the killed unit?
06-12-2003, 02:16 AM#2
ChrydGod
Why don't you just (at least for non-preplaced heros) disable every hero entering the playable map aera's experience gain ?

it would look like :

Code:
Events :
A unit enters (playable map aera)

Conditions :
(Owner of (Entering Unit) not equal to Player 12)
((Entering unit Is A Hero) Equal to True

Actions :
Hero - Disable experience gain for (Entering unit)


Regards
06-12-2003, 03:07 AM#3
combatken
Thx. That fixes the easy problem :D

But for the second one..

E: A unit owned by player 12 dies

A: For each (Int B) from 1 to 100 do

If (Unit-type of (triggering unit) equal to Creeptype[Int B] then do (set Creepnumber = Integer B) else do nothing.

This is just an array of creeps, and whatever creep just died it assigns Creepnumber to that value.

A: For each (Int A) from 1 to 11 do

If (All units of (units owned by Player(Int A))) are in region (centered at position of (triggering unit) with size (1200, 1200) equal to true) then do Game - display to all players the text: Player + string(PHero(Int A)) + received credit for defeating (String(Creeptype[Creepnumber])).

So basically, when a unit dies, it simply displays a message that everyone near it got credit for the kill. When I get this working I'll have the action instead add exp to an "exp" variable.

The creepnumber part works fine. I've made and assigned a few creeps and exp values to 2 paralell arrays. But the player credit thing is a bit off. Everytime something dies it displays the above message 6 times. (Down from 11, and I have 6 PC slots in the map, so I'm assuming it knows something about the PCs existing). Problem is, it says player0 6 times, and I dunno what to do about that. Help would be appreciated for making this work *puppy eyes*

[Edit: BTW, how do you copy triggers from the editor to a text box? Just easier then manually typing most of it out.]
06-12-2003, 12:17 PM#4
ChrydGod
... but what is PHero(IntA) ???

Oh and about the "code", i just type it all between [ c o d e ] [ / c o d e ] without the spaces

Regards
06-12-2003, 03:33 PM#5
combatken
Ah, got it working I think. (Region sizes are kinda difficult to figure out though) Just had to change a few things, and make PHero a different variable type.

And I meant how can you copy events and stuff from the trigger editor to..here?