Home   Help Search Login Register  

Author Topic: not aloud  (Read 1146 times)

0 Members and 1 Guest are viewing this topic.

Offline 456820

  • Contributing Member
  • **
not aloud
« on: 04 Mar 2005, 19:40:01 »
can you make a trigger set as something like 150 and 150 and make it so the east isnt aloud outside of that trigger area and also the same but with east players not aloud in the trigger area. and if so how would i do this

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re:not aloud
« Reply #1 on: 04 Mar 2005, 19:55:33 »
What do you want to happen if they leave the trigger area? Do you want to kill/delete them?? Or do you want to prevent them from moving outside the area???
OFPEC | Intel Depot
RETARDED Ooops... Retired!

Offline 456820

  • Contributing Member
  • **
Re:not aloud
« Reply #2 on: 04 Mar 2005, 19:59:37 »
i just whant to prevent them from leaving the area and if thats not possible i wouldnt ming just making it so they get setpos back into the trigger

Offline ACF

  • Members
  • *
  • Llama?? Ain't that French for tanks?
Re:not aloud
« Reply #3 on: 04 Mar 2005, 20:08:31 »
For the Easties, who are presumably a predefined collection of units and/or groups, it might be easier having a monitoring (looping) script that checks them all every 30s or so.  If they are more than 150m from a handy object or marker, simply Move or DoMove them back to the centre; less brutal than SetPossing them.

The West troops would be better off with a trigger - when they activate it you can List them and DoMove them somewhere else.

Offline RujiK

  • Members
  • *
  • KoKo Puh-Fizzles!
Re:not aloud
« Reply #4 on: 04 Mar 2005, 20:14:01 »
Or you could just do the really simple.
Make a hold waypoint.
I like your approach, lets see your departure.
Download the New Flashlight Script!

Offline 456820

  • Contributing Member
  • **
Re:not aloud
« Reply #5 on: 04 Mar 2005, 20:14:39 »
right thanks for the post but the thing is im pretty much useless at scripting so if you could make a script or give a step by step way of doing this
Thanks

Offline ACF

  • Members
  • *
  • Llama?? Ain't that French for tanks?
Re:not aloud
« Reply #6 on: 04 Mar 2005, 21:09:49 »
Code: [Select]
; dontgoaway.sqs
; this is a remark if it starts with a semi-colon
; most of my remarks are half-arsed so it's apt
; but OFP will ignore the line so it's good for explaining things
; one day you will find a line and wonder why you wrote it!

; anyway, open wordpad, copy all of this down to the 'exit' and paste it in.
; save in text format as dontgoaway.sqs - make sure it isn't dontgoaway.sqs.txt !
; then move the file to your mission folder in Flashpoint\...\Users\youridentity\missions\mymissionnamefolder

; this is a quick exercise in scripting:
; place an Invisible H OBJECT at the centre of your area and name it: mycentrepoint
; type: [] Exec "dontgoaway.sqs" in the init field of the player or any other unit to run the script

; first set up an ARRAY of the units you want on a lead:

; type the names of your single units in the brackets :
_myloneeastieswhoiwanttocontrol = [eunit1,eunit2,eunit3]

; type the names of your groups in the brackets :
_mygroupedeastieswhoiwanttocontrol = Units egroup1 + Units egroup2

; add them all together in one array:
_allmyeastieswhoiwanttocontrol = _myloneeastieswhoiwanttocontrol + _mygroupedeastieswhoiwanttocontrol

; put a bookmark so we know where to restart the check on all units
#startcheck

; wait 30s because they are going to start in the area so we can ignore them for a bit
; we need a PAUSE or the script will run so fast your PC will not do anything else and get a little laggy
~30

; set the initial value for the loop
_index = 0

; set the maximum value so we know when to stop the loop
_unitcount = Count _allmyeastieswhoiwanttocontrol

; put a bookmark so we know where to loop to
#startoftheloop

; pick the unit from the array
_unittocheck = _allmyeastieswhoiwanttocontrol Select _index

; next is the bit where we stop them wandering off
; it's an IF-THEN statement in OFP shorthand
; in the command reference, find the COMMAND to complete the CONDITION in the brackets
; that measures the DISTANCE between _unittocheck and mycentrepoint (there is a CLUE!)

?(WORKOUTWHATGOESHERE > 150): _unittocheck DoMove GetPos mycentrepoint

; next unit
_index = _index + 1

; exit the loop if we've done everybody
?(_index >=  _unitcount): Goto "startcheck"

; if not, loop to the next unit
Goto "startoftheloop"

exit

Here's a little exercise - sit down with the command reference and see if you can make sense of the above. You know what you want to do so it should make sense.  It's only 14 lines of code amongst the notes so it's manageable.

The commands are not just for script scripting - you can use most of them in trigger or waypoint conditions as well. Or in the 'on activation' fields to get a unit to do something.

Actually, I've left one command out so you'll have to use the comref to find it and give yourself a bit of confidence!  We've all learned from our mistakes so the sooner you stop worrying about making them the bettter!  In fact, I haven't tested this so it may be more of a learning experience than we've both bargained for.  Good luck.

Offline 456820

  • Contributing Member
  • **
Re:not aloud
« Reply #7 on: 04 Mar 2005, 21:32:42 »
thanks alot for the post ACF havent tried it yet but i make a bit of sense of it im just searching for that code at the moment and then i will test it thanks

Offline 456820

  • Contributing Member
  • **
Re:not aloud
« Reply #8 on: 05 Mar 2005, 17:22:34 »
right i think i found the command

a > b
Operand types:
    a: Number
    b: Number
Type of returned value:
    Boolean
Description:
    a greater than b

Example:
    counter > 4

that was copied out of the com ref it looks like its right im just checking with you if it is