Home   Help Search Login Register  

Author Topic: Hazardous Area  (Read 1672 times)

0 Members and 1 Guest are viewing this topic.

Offline Evan Scown

  • Members
  • *
Hazardous Area
« on: 31 Aug 2006, 09:47:30 »
Hey,

Okies my idea is, I'd like to make this hazardous area, kinda the napalm or like hazardous materials in an area, and I'd like for it to kill, or more deduct a persons health so that over time they pack it in (Die) it would also be cool if there was gas and alike....

A) Is this possible

B) How would/or has there been scripts made to make this possible?

Thankies!

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Hazardous Area
« Reply #1 on: 31 Aug 2006, 10:05:33 »
a) yes, it's possible

b) you'll need to read up on the drop command to produce the gas-cloud effect, you'll need a trigger covering the area affected to capture all units entering it, and you'll need a script which setdamages them in very small amounts over time.

as to whether there's already a script out there which does this, i dunno.

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: Hazardous Area
« Reply #2 on: 01 Sep 2006, 00:36:39 »
There was a script that did this in the depot before the big crash...
urp!

Offline rhysduk

  • Former Staff
  • ****
Re: Hazardous Area
« Reply #3 on: 01 Sep 2006, 01:11:57 »
To kill a unit straight off the line:

Code: [Select]
this setdammage 1 is usually used.

For what you want use the below method.

Typical Scenario:

  • Put a West trigger over an area of land.
  • In the On Activation field of each unit you dont want entering the area put
Code: [Select]
this exec "kill.sqs"
  • Make a .sqs file called kill (Note spelling and no upper case characters) and put it in the mission folder.
  • In the script file put:
Code: [Select]
_list = (List killtrig)

~2

@ _this in List killtrig

_this setDammage 1

Exit

    I know it works because ive tested it. If you get any problems let me know. I have an example mission if you'd like it.

     :wave:
    Rhys
    Reviewed Missions Board: Please Read the User's Guide before posting!

    Pride and Joy 1 (HW100-T)

    Offline Raptorsaurus

    • Editors Depot Staff
    • *****
    Re: Hazardous Area
    « Reply #4 on: 01 Sep 2006, 01:41:48 »
    If you want it to kill slowly then change the script posted by rhysduk thusly:

    Code: [Select]
    _list = (List killtrig)

    ~2

    #loop

    ? _this in _list : _this setDamage ((damage _this) + .05)
    ~ .1
    ? alive _this : goto "loop"

    Exit

    If you want to change the rate at which a unit loses health, change the .05 to a different value.

    Offline Chris Death

    • Former Staff
    • ****
    • Finally Death's gonna get ya
      • OFPEC
    Re: Hazardous Area
    « Reply #5 on: 01 Sep 2006, 01:59:27 »
    Would work Rhysduk sure (if he named the trigger: killtrig)...

    ...but it would be very CPU stressing, running a script for each single unit to do that.

    Here's another way to do it with a trigger and one single script:

    Put a trigger over the area you need;

    Activation: west / present / once
    name: killtrig
    condition: this
    onActivation: [] exec "kill.sqs"

    Now you must take care:
    In the first unit's init field, which you place on the map put following code:
    killlist = []

    And into each unit's inti field, which should die when entering the area put following code:
    killlist = killist + [this]

    :note - the init fields of the units will be executed according to first placed first runs
    this means the init field of the first unit being placed onto the map will become executed first.
    Therefore you need to initialize the array 'killlist' from that unit's inti field.
    Now if the first unit being placed should be included to the list also you can change the code
    i said above into: killlist = [this]
    If not, just make it: killlist = []

    Now the script - make kill.sqs file in your missionfolder and put following code inside:

    Code: [Select]
    #loop
    "if _x in list killtrig then {_x setdammage 1}" foreach killlist
    ~0.5
    goto "loop"

    :note - this script will every 0.5 seconds kill anybody who is included in the killlist AND inside the
    trigger's area.
    If you think you don't need this every 0.5 seconds, just change the ~0.5 into ~whatever_you_need.

    I would recommend increasing the delay so that you again can save cpu power since it's usually not necessary
    to check every half of a second for something like this (5 seconds should do it aswell).

    ::note - there's way more methods to do so, but this was the first one i've been thinking about and while posting
    there came at least 3 or 4 more into my mind but we will see  ;)

    ~S~ CD
    Dont argue with idiots....they will bring you down to their level and beat you there with experience.

    How to use Waypoint type Scripted

    Offline rhysduk

    • Former Staff
    • ****
    Re: Hazardous Area
    « Reply #6 on: 01 Sep 2006, 02:01:42 »
    Thanks CD,

    I tried this method to begin with, but couldnt get it too work unfortunately  :no:

    Thanks for that  :thumbsup:

    Rhys
    Reviewed Missions Board: Please Read the User's Guide before posting!

    Pride and Joy 1 (HW100-T)

    Offline Evan Scown

    • Members
    • *
    Re: Hazardous Area
    « Reply #7 on: 08 Sep 2006, 22:11:50 »
    Just a question, looking back to the cloud thing. How do you work the drop array? I've been trying to work it out but I can't. I just want one to sit there for the entire mission. If anyone can help, that would be hot.

    Offline rhysduk

    • Former Staff
    • ****
    Re: Hazardous Area
    « Reply #8 on: 08 Sep 2006, 22:25:27 »
    Evan,

    Try this link: Drop Tutorial by Vecktorborson.

    Havent used it myself unfortunately.

    Rhys
    Reviewed Missions Board: Please Read the User's Guide before posting!

    Pride and Joy 1 (HW100-T)

    Offline bedges

    • Administrator
    • *****
      • OFPEC The Editing Center
    Re: Hazardous Area
    « Reply #9 on: 08 Sep 2006, 22:29:12 »
    that would be my suggestion too. it's probably the best (if not only) tute on the subject. my own tips would be
    • use the examples he gives as a starting point - copy/paste
    • change only one of the values at a time until you understand what's going on

    Offline Evan Scown

    • Members
    • *
    Re: Hazardous Area
    « Reply #10 on: 08 Sep 2006, 23:05:42 »
    YESSSSSsssss...thanks guys!