HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Some Trigger help

10-22-2004, 03:43 PM#1
Slugge
1. player types text, kill all heroes of triggering units, spawn unit at region
2. player picks up item and drop in certain region, add 10 gold each 10 seconds for players team


If u type the codes it would be more helpful :D
And i post alll the triggers i need help with here in the feature too not make so many threads... :)
10-22-2004, 05:31 PM#2
AFB-DieHard
Code:
function Trig_first_trigger_Func001001002 takes nothing returns boolean
    return ( IsUnitIdType(GetUnitTypeId(GetFilterUnit()), UNIT_TYPE_HERO) == true )
endfunction

function Trig_first_trigger_Func001002 takes nothing returns nothing
    call KillUnit( GetEnumUnit() )
endfunction

function Trig_first_trigger_Actions takes nothing returns nothing
    call ForGroupBJ( GetUnitsOfPlayerMatching(GetTriggerPlayer(), Condition(function Trig_first_trigger_Func001001002)), function Trig_first_trigger_Func001002 )
    call CreateNUnitsAtLocFacingLocBJ( 1, 0, GetTriggerPlayer(), GetRectCenter(YOURRECT), GetRectCenter(GetPlayableMapRect()) )
endfunction

//===========================================================================
function InitTrig_first_trigger takes nothing returns nothing
    set gg_trg_first_trigger = CreateTrigger(  )
    call TriggerRegisterPlayerChatEvent( gg_trg_first_trigger, PLAYERTOINPUTTEXT, STRING TO BE PUT IN, false )
    call TriggerAddAction( gg_trg_first_trigger, function Trig_first_trigger_Actions )
endfunction

for 2. can you maybe be a bit more accurate?
10-22-2004, 06:22 PM#3
Slugge
Okay, in this map im making its gonna be a flag in the middle, when a hero captures the flag and drops it in their town the player's team will get 10 gold per 10 second.

Understood that?

And what program u use for making map? some wierd codes there :P but i figured the hero kill thingy myself :P
10-22-2004, 06:49 PM#4
AFB-DieHard
Lol ok the standard editor, thats jass, that comes up when you select a trigger and choose "convert to custom text".
I don't exactly know how you mean by "10 gold per 10 second" but to just add 10 gold this trigger should work.

Code:
FLAG CAPTURED
    Events
        Unit - A unit Loses an item
    Conditions
        (Item being manipulated) Equal to THE FLAG
        Or - Any (Conditions) are true
            Conditions
                And - All (Conditions) are true
                    Conditions
                        (TEAM A RECT contains (Hero manipulating item)) Equal to True
                        ((Owner of (Hero manipulating item)) is in (All allies of Player 1 (Red))) Equal to True
                And - All (Conditions) are true
                    Conditions
                        (TEAM 2 RECT contains (Hero manipulating item)) Equal to True
                        ((Owner of (Hero manipulating item)) is in (All enemies of Player 1 (Red))) Equal to True
    Actions
        Player Group - Pick every player in (All allies of (Owner of (Hero manipulating item))) and do (Player - Add 10 to (Picked player) Current gold)
10-22-2004, 07:09 PM#5
-={tWiStÄr}=-
ok, im not gonna give you the triggers because its better if you figure them out yourself.
what you need to do, is every 10 seconds check if the item is in the region or check if any items of the right type are in the reagion. if it is in the region, then add 10 gold to the team.
also, PLEASE don't post all of you're questions in 1 thread, no one cares about having lots of threads. its worse to have to search through a 5 page thread to see when someone said something.. just whenever you have a string of questions AT 1 TIME post them in one thread not like 6 threads at the same time.