Home   Help Search Login Register  

Author Topic: Shut Down Power...... :-)  (Read 593 times)

0 Members and 1 Guest are viewing this topic.

Kilo11

  • Guest
Shut Down Power...... :-)
« on: 02 Nov 2003, 20:20:55 »
Hey all, whats up.  I am currently making a mission and I would like to add a little spic to it.  Its a basic raid the town and get the officer type mission, but I would like an objective to be "Shut Down Power".  YOu need to get to 2 different building and when you get there you will have the option to "Shut Down power", and in turn, it will turn off all the street lights inside the town.  So I got two problems:

-I need to know how to make the "Action Buttons" that would activate the "power.sqs"

-And second, I need to know what to put in the power.sqs.

I do not know how to use the "lightison" command properly, so if anyone oculd help me and make an easy example mission , I would grealtly appreciate it.  Thank you.  Also any advice, tips, or whatever please post them too :-)


-=Kilo=-

mikeb

  • Guest
Re:Shut Down Power...... :-)
« Reply #1 on: 03 Nov 2003, 11:58:32 »
what i recommend is getting hold of the mapfact barracks addon.  it has a power switch that acts just like a door on a power terminal.  as it acts like a door you can detect it's two positions (0 and 1) and then have it so it switches off once the player has switched it.

otherwise what you do is the following:

POWERACTION = player addaction ["Turn off power", power.sqs"]

; put that in a trigger that acts repeatedly whever the player enters the area you want that action to become available.  Then make a slightly larger repeated trigger activated when the player is not present and put the following in it:

player removeaction POWERACTION

;make a file called power.sqs and simply put the following it it:

player removeaction POWERACTION
(object XXXXX) switchlight "off"

; instead of the XXX put the number that corrsponds to the light you want to switch off.  do this by clicking on show ids on the editor screen (need resistance, otherwise do the nearest object command - see command ref)  and finding the number.  repeat that last line for all the lights you want to power down.

; oh, also might be a good idea to put a condition in that first trigger like POWERON and then have it that this variable is made false in the power.sqs to stop the action becoming available if the power is already off.  also rather than using triggers (as you could end up getting mulitple action lines) you might want to use the distance command which i always find a bit better.

;anyway you get the idea right?  This doesn't let you turn the stuff back on using the player but you can see how that may be done.  also you could have it so that after a while the enmy try and turn it back on so you have to try and stop them by shooting the runner as he makes for the switch.... ok thinking a loud now!


EDIT:

oh btw i notice you say 2 buildings?  just use variables to make sure the player has visited both if that's what you mean (or 2 switches, each with a variable that when BOTH are switched it goes to "power.sqs")
« Last Edit: 03 Nov 2003, 12:00:12 by mikeb »

Offline SilentHunter

  • Members
  • *
  • frozen leg'o'lamb (every gamers most loved weapon)
Re:Shut Down Power...... :-)
« Reply #2 on: 03 Nov 2003, 18:00:39 »
I like the idea,  :)

So here's what i'll do, if you still intrested i'll fix up a sample mission, with a dialog or somthing.

just 2 things:

1. what building where you planing to use for a powerplant.

2. what map and towns.

ps: (if you send me what you've got now then i'll finish it up to that point)


[size=4.5]NERDS HAVE FEELINGS TOO! [/size] [size=2.5]*adjusts glasses*[/size]

Kilo11

  • Guest
Re:Shut Down Power...... :-)
« Reply #3 on: 04 Nov 2003, 22:43:07 »
Will the p"player" variable work online with multiple players? Or will I have to name each individual player and have a trigger or line for each unit playable???  Thanks so much, realy helpful!

-=Kilo=-