Home   Help Search Login Register  

Author Topic: Toadlife's PatrolDebug  (Read 476 times)

0 Members and 1 Guest are viewing this topic.

rOk

  • Guest
Toadlife's PatrolDebug
« on: 11 May 2004, 17:52:43 »
Hi!

How can I set up the script so it will run from the action menu?
IE; when I want too?
Her's the critter:

Code: [Select]
; Patrol/Group Debug Script (Advanced)
; by toadlife (toadlife@hotmail.com)
; http://www.toadlife.net/ofp/
; Init variables: [[groupname1,groupname2],checkinterval,cameradistance,cameraheight,camrotationspeed] exec "patroldebug.sqs"
; Init example: [[group1,group2],10,15,3,0.6] exec "patroldebug.sqs"

#start
_groups = _this select 0
_checkinterval = _this select 1
_distance = _this select 2
_height = _this select 3
_camspeed = _this select 4
_camzoom = _this select 5
_groupcount = count _groups
_grouptocheck = _groupcount
goto "groupcycle"

#groupcycle
~2
_grouptocheck = _grouptocheck - 1
titletext [format["Group %1",(_grouptocheck + 1)], "plain"]
_camera = "camera" camcreate [0,0,0]
_camera cameraeffect ["internal", "back"]
_camera camsetfov _camzoom
_time = 0
_angle = 0
_target = (leader (_groups select _grouptocheck))
#cammove
_targetpos = getpos _target
_targetposx = _targetpos select 0
_targetposy = _targetpos select 1
_targetposz = _targetpos select 2
_angle = _angle + _camspeed
_camera camsettarget getpos _target
_camera camsetpos [_targetposx + ((sin (_angle) * _distance)), _targetposy + ((cos (_angle) * _distance)), _targetposz + 15 ]
_camera camcommit 0
~0.01
?_time >= _checkinterval:goto "next"
goto "cammove"
#next
camdestroy _camera
?_grouptocheck == 0:_grouptocheck = _groupcount
_camera cameraeffect ["terminate", "back"]
goto "groupcycle"

Thanks ppl!

Dove

  • Guest
Re:Toadlife's PatrolDebug
« Reply #1 on: 11 May 2004, 18:56:10 »
well create a trigger refering to watever u want it to , ie, west not present, then put in on activation

[] exec "patroldebug.sqs"

that simple way of doin it anyway

rOk

  • Guest
Re:Toadlife's PatrolDebug
« Reply #2 on: 12 May 2004, 11:42:24 »
Yes thank you...errr but that's not what I was after.
I want to set it off from the action menu regardless of what happens on the map (including nothing) over and over again.
Thanks for the quick reply

PsyWarrior

  • Guest
Re:Toadlife's PatrolDebug
« Reply #3 on: 12 May 2004, 14:12:59 »
Greets,

The difficulty with this is that that when you execute a script using the action menu, you cannot pass any variables to it. Thus, you need two scripts:

Code: [Select]
; Actionselect.sqs

[[group1,group2],10,15,3,0.6] exec "patroldebug.sqs"
exit

And the PatrolDebug script. Then, in the INIT field for the player character:

this addAction ["Patrol Debug", "actionselect.sqs"]

That should do it...

-Supr. Cmdr. PsyWarrior
-Psychic Productions

rOk

  • Guest
Re:Toadlife's PatrolDebug
« Reply #4 on: 12 May 2004, 14:42:44 »
Great, that worked fine, but how do you stop it? It's just going in a loop!

And of course I have one more question (silly me):
How do you add submenus to the action menu?
You know like you would click "Display groups" and it would open up a new (sub)menu.
The thing is I'm trying to (somehow-I'm actually a real n00b when it comes to scripting of my own) edit Snypir's SP/MP pack so that it would become a full functionable command system.
Thanks for the replies