HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Trying to make a Castle Gate with a Open/Close Function.

04-16-2004, 09:16 PM#1
MaxDamage
Well after hours of testing, PMing someone who helped me before, and screwing around I still can't figure it out. Maybe it's because I'm somewhat new and don't know too much about triggers, or maybe it just can't be done.

What I'm trying to do is have a Custom Unit, A Gate.. and have it have an open/close ability. The Closed would be of course the closed model.. and the Opened would be the "Death Alternate" one. The only way I've seen this done is where you have to type in "-open gate" or whatever.. but I'm not too fond of that.. I'd either like to have it be an upgrade.. where you can click it then click an Open button and then Close button as many times as you want, or maybe even have a switch unit like in the campaigns... or anything else that's somewhat simple.. like a clickable item or something. o_O I'd also like to be able to build it if the original castle gate gets destroyed and have it be repairable.. not just a doodad.

So.. what I'm wondering is if this can be done.. and if it can, can anyone please help me? If so.. please try to be as detailed as possible with the trigger explaination.. that's the only part of the editor I'm still not too familiar with.

Any help would be very much appreciated! :D
04-16-2004, 11:17 PM#2
johnfn
OK i think i know what you are talking about; the problem is that you didnt really tell me your problem ... (um... what?)

I think you want to know how to make it so when you press the button you kill the gate. You could do one of two things:
  1. Make an ability to open the gate.
  2. Make a unit to train to open the gate
The first one is harder but looks better. The second one is easier and still works fine. Im going w/ the second one. Ill just list some steps.
  1. Make a new custom unit. Doesnt matter what you base it off of.
  2. Call it Open Gate.
  3. Make the gate unit be able to train the Open Gate unit.
  4. Write a trigger with the following:
Code:
  
[b]Events[/b]
A unit is trained
[b]Conditions[/b]
Unit type of unit equal to Open Gate
[b]Actions[/b]
Unit - Kill (your gate)


And then you need to do the same thing for the Close gate, except bring the gate-unit back to life.
04-16-2004, 11:59 PM#3
ThyFlame
Before you say you don't want it dead, also realize that when its dead, it uses the 'open' gate, and when alive it uses the closed.
04-17-2004, 12:11 AM#4
13layde
Well somthing very simple might be if a unit comes close to the gate then it opens and when they move away it closes. to do that,
1) Make a rectangular region around the gate but not too big
2) in the trigger editor, make trigger
Event

A unit enters (region you made)

Action
(search the word 'gate' in action making menu)
Open (the gate)

And then make a second trigger

Event

A unit leaves (region you made)

Action

Close (the gate)

hope that's simple enough heheh