HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Trigger Problem: Please HELP!

08-23-2003, 12:13 AM#1
LiableSu5pect
OK first ill tell you what i want the trigger to do, I need a trigger that whenever a player enters a certain region that it will create a certain item if the item isnt present... now ive tried many different triggers and this is what i have so far but it dosent work:

Pistol1
Events
Unit - A unit enters Pistol1 <gen>
Conditions
Actions
Item - Pick every item in Pistol1 <gen> and do (Wait 0.00 seconds)
If ((Item-type of (Picked item)) Equal to Pistol) then do (Do nothing) else do (Trigger - Turn on Pistol1 Pt2 <gen>)

2nd Trigger:
Pistol1 Pt2
Events
Conditions
Actions
Item - Create Pistol at (Center of Pistol1 <gen>)
Trigger - Turn off (This trigger)


If someone could tell me an alternate triger, or a way to fix this trigger than that would be great!
08-23-2003, 12:28 AM#2
Guest
ok you will need to know variables(i think) to do whut you need to do go here and look for the part about opening the door with the keys and you should get the picture and use it solve your problem

EDIT: ok i read throu the link a little more and found that it dosnt help that much. try adding

Event: unit enters regionX
Conditon: HeroX has itemX equl to false
Action: creat itemX at center of regionX

it should work but i wont know beacus i dont have my Tft disk with me:(
08-23-2003, 12:30 AM#3
Norbo
This assumes you know how to use variables.. who knows, maybe that tutorial will become useful for you.

This replaces both previous triggers.

PistolSpawnArea is the region name of the region I used.
NumberOfPistols is an integer value, default value 0.
Pistol is the item name of the item I assume is a pistol.
Code:
Pistolage
    Events
        Unit - A unit enters PistolSpawnArea <gen>
    Conditions
    Actions
        Item - Pick every item in PistolSpawnArea <gen> and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Item-type of (Picked item)) Equal to Pistol
                    Then - Actions
                        Set NumberOfPistols = (NumberOfPistols + 1)
                    Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        NumberOfPistols Equal to 0
                    Then - Actions
                        Item - Create Pistol at (Center of PistolSpawnArea <gen>)
                    Else - Actions
                        Set NumberOfPistols = 0
08-23-2003, 01:00 AM#4
LiableSu5pect
Quote:
ok you will need to know variables(i think) to do whut you need to do go here and look for the part about opening the door with the keys and you should get the picture and use it solve your problem


thing about whut ur saying to me is something ive already tried, and it didnt work either, jus kept creating the item even if it was there...so the answers to your variables suggestion is wrong, unless i used the variables wrong. Check out this trigger i used with variables:

Sun Key in Region ItemLocation
Events
Unit - A unit leaves ItemLocation <gen>
Conditions
Actions
Set booleanItemChecker = True
Item - Pick every item in ItemLocation <gen> and do (If ((Item-type of (Picked item)) Equal to Sun Key) then do (Set booleanItemChecker = True) else do (Do nothing))
If (booleanItemChecker Equal to False) then do (Item - Create Sun Key at (Center of ItemLocation <gen>)) else do (Do nothing)

Maybe I just did it wrong, but anyway Norbo the problem with the continious if-then triggers is ive already tried that to and it did the same thing as the other trigger I have...well anyway thaks for the help
08-23-2003, 01:06 AM#5
Norbo
You sure? That trigger would, in theory, work.. Gotta put this if's within the Picked Item loop..

I don't see any logical reason why, if copied exactly, that wouldn't work.

Although, WC3 doesn't always seem to obey logic on the surface.
08-23-2003, 01:58 AM#6
LiableSu5pect
oh sorry norbo when i was writing that i was writing it in response to the first post you wrote, havent tried second thing yet ill do it right now to see
08-23-2003, 02:24 AM#7
LiableSu5pect
NORBO YOU ARE MY GOD.... Thank you now I can continue with all my other triggers... If i ever need help Ill PM U Thanks man!