• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

help wit gate

Status
Not open for further replies.
Level 2
Joined
Dec 31, 2005
Messages
10
ok in village builder silver there is a way were u can use an ability to open up gates and close the gates. ive spent hours tryin to figure it out and i dont get how tht guy did it. ive messed around wit triggers but wen i use the triggers they r only for specific gates. i just want to kno if there is a way were i can open and close gates using an ability. and the gate in village builder silver is unit and the ability tht is used to open and close the gate is based off of bear transform but since the guy removed da triggers and etc. i dont kno if he used triggers to make it. if someone can help just give ne advice
 
Level 7
Joined
Jul 30, 2004
Messages
451
i suppose theres several options

1) region based
premise: set up different regions around doors, when a unit casts 'whatever' within that region open the door

2) pick based
premise: when a unit casts 'whatever' it selects all the doors (pick destructables) and opens the ones that are picked

3) target based
premise: 'whatever' has a target of destructables (ie doors), open or close targeted door when casted

4) theres plenty more...
 
Level 3
Joined
Nov 8, 2005
Messages
51
OH found it alrdy here

Event - whenever player 1 types -close(/open)

Actions

Unit group - pick every unit in region (region near gate)
If - Owner of picked unit is equal to triggering player
Then - Destructible Close(/Open) gate
Else - Do nothing

( you can put Player 1 to player 12 in the event so it works for all players )
 
Level 7
Joined
Jul 30, 2004
Messages
451
Flaming said:
OH found it alrdy here

Event - whenever player 1 types -close(/open)

Actions

Unit group - pick every unit in region (region near gate)
If - Owner of picked unit is equal to triggering player
Then - Destructible Close(/Open) gate
Else - Do nothing

( you can put Player 1 to player 12 in the event so it works for all players )

thats um, a low-quality form of the region premise i pointed out
that doesn't work so well when multiple units are in a region, much simpler to use a boolean comparison as opposed to a pick statement in that case, it also doesn't use an ability like he asked (although arguably the event can be changed easily)... and if u really are gonna use something like that i'd clean the unit-group pointer at the end, but it might be ok since it won't be done a million times

the only thing with the region method, is you'll need a whole slew of regions and statements, unless you put it all into an array and just loop it but i'm not gonna go into that in this post
 
Level 2
Joined
Dec 31, 2005
Messages
10
hmm thx for da suggestions but wat if i have a unit to build the gates. would tht trigger be able to open the gates tht my worker builds?
 
Level 2
Joined
Dec 31, 2005
Messages
10
i want to use

2) pick based
premise: when a unit casts 'whatever' it selects all the doors (pick destructables) and opens the ones that are picked


but i want to kno how to set tht up and as for the pick destructibles part. is there a way to pick all? cuz sometimes wen i see sumthin like this it only allows me to pick 1
 
Level 7
Joined
Jul 30, 2004
Messages
451
E:
unit starts the effect of an ability
C:
ability = XYZ
A:
pick all destructables in (256 range of (casting unit) ) and do
-- if destructable type = door OR etc etc...
-- -- open/close destructable

something like that
 
Level 2
Joined
Dec 31, 2005
Messages
10
im tryin to make tht trigger but im stuck on this part u wrote here

-- if destructable type = door OR etc etc...
-- -- open/close destructable

something like that
 
Level 7
Joined
Jul 30, 2004
Messages
451
this is a direct copy from a demo trig i made just now, the // are comments i added, this is just a reference guide

Code:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
        Or - Any (Conditions) are true
            Conditions
                ((Picked destructible) is alive) Equal to True
                (Destructible-type of (Picked destructible)) Equal to Gate (Diagonal 1)
                (Destructible-type of (Picked destructible)) Equal to Gate (Diagonal 2)
                //etc...
    Then - Actions
        Destructible - Open (Picked destructible)
        //a little more work has to be done here in order to do both opening
        //and closing, my suggestion would be to use a destructable group
        //and, when a door is opened add the destructable to the group
        //so when you check to open or close you check if the dest. is in
        //the group, but thats beyond the scope of what i'm writing
        //(or i'm just lazy right now)
    Else - Actions
        Do nothing
 
Level 18
Joined
Mar 7, 2005
Messages
824
lol its funny to read ur posts, and nice that some people help the others in all things they can... anyway the ideass are good but its pretty simple if u want dabum2 i can make u the gate builable so that u can build it with an builder or worker and u can open it like in village builder... just pm me if u want my help =)
 
Status
Not open for further replies.
Top