Home   Help Search Login Register  

Author Topic: snYpir-How to make tougher units  (Read 873 times)

0 Members and 1 Guest are viewing this topic.

Lamerlot

  • Guest
snYpir-How to make tougher units
« on: 26 Feb 2004, 07:00:05 »
New to scripting so please go easy on me :)

I was able to use snYpir tougher units script by using the OFP mission editor, init line.  Question,  if I wan to apply this all units in the game, do I have to add [this,2] exec "toughunit.sqs"  to the init box in the ofp mission editor for all units ?  too time consuming and too much work.  Is there a way to apply this script globally ?  I would like to make infantry much toughter to simulate some effect of cover.    

Thanks,
Lamerlot

This script allows you make units in the game harder to kill. This is done by reducing the damage taken by a unit during the game.

A call to this script would typically be made in the init field of a guy who you want to make tougher.

It is called as follows:

[name of object, damage factor] exec "toughunit.sqs"

the name of the object would be 'this' if u are using the call in an init field of an object.

the damage factor is the divisor for the damage taken. if this value is 2, for example, the dude will be twice as tough (damage will be halved). this allows you to have different levels of toughness for different soldiers if you want. Don't forget that this script will work for any object, not just soldiers.

so, a typical call to this script would be:

[this,2] exec "toughunit.sqs"

In the script file itself, if you look at the top of the file you can see a section with variables that you can change. These are described below.

_pause = 0.5

This sets the time interval between loops. Should be less than one.

_damageFactor = _this select 1

By default, the damage factor is set by the second parameter in the call to the script. If you wanted to make all units who run this script have the same damage factor you could change this value.

_noResurrection = false

If you change this line to true a unit will die as soon as it's damage is greater than one. So if a huge explosion instantly kills a unit, the damage will not be reduced and the unit will stay dead. If this value is false (default) the damage will be halved even if the unit is dead, effectively bringing the unit back to life.

NOTE

Although this script will make the player tougher if this is used, the player unit cannot be brought back to life. So if the player suffers heavy damage, the mission will end even though it will appear the player is alive.

8 Ball

  • Guest
Re:snYpir-How to make tougher units
« Reply #1 on: 26 Feb 2004, 09:15:35 »
Put a trigger on the map, and set the size to 50000 by 50000. This should cover the whole map. Set the activation to "Anybody", and put in the "On Activation" field:

{[_x,2] exec "toughunit.sqs"} foreach thislist

That will exec the script for all units in the trigger area.

EDIT: This is in the wrong part of the fourm. This should be under the Editing:General section
« Last Edit: 26 Feb 2004, 09:22:47 by 8Ball »

paper plane

  • Guest
Re:snYpir-How to make tougher units
« Reply #2 on: 23 Mar 2004, 08:32:52 »
  anyone can help me? I already put the "toughunit.sqs" file in my mission flode.but it didn't work. an show me this:
 scripts toughunit.sqs not found  

please tell me what happen  ???

Offline Marvin

  • Members
  • *
  • One day they will come
Re:snYpir-How to make tougher units
« Reply #3 on: 23 Mar 2004, 13:35:16 »
How you initalaze the script?
Is there any games than Flashpoint?

paper plane

  • Guest
Re:snYpir-How to make tougher units
« Reply #4 on: 23 Mar 2004, 15:54:21 »
I want to put it in a team of soldiers, so writer it in the sordiers's initfiled:
  [this,2] exec "toughunit.sqs"
I try it use object name eg: [inv1,2] exec "......"
and try to use tigger, but it also didn't work
(I also check the file name and it's correct)  :(

Offline rhysduk

  • Former Staff
  • ****
Re:snYpir-How to make tougher units
« Reply #5 on: 23 Mar 2004, 17:35:51 »
Can you show us the complete script plz.. then "we" can help you a bit more efficently :)

Rhys..

PS:- You know you are executing the script with [this,2] ? Have you got to thingys in your script like so :-

something = _this select 0 --- This refers to "this" in the executing arguements!

AND

somethingelse = _this select 1 --- Refers to  the number in the executing arguements..

I think they are arguements.. but dont quote me :)

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

Pride and Joy 1 (HW100-T)

paper plane

  • Guest
Re:snYpir-How to make tougher units
« Reply #6 on: 24 Mar 2004, 13:38:20 »
I download the scripts from the "DITORS DEPOT" but it not a sqs file. and I first save it to a txt file then change it to sqs file by DOS mode.

Offline Hawkins

  • Former Staff
  • ****
  • Team 2-2
Re:snYpir-How to make tougher units
« Reply #7 on: 10 Apr 2004, 07:30:52 »
Is the script in another folder inside the mission folder? Are you sure it's not named *.sqs.txt ?
« Last Edit: 10 Apr 2004, 07:31:13 by Hawkins »