Home   Help Search Login Register  

Author Topic: this Exec "HeadButtMyMonitor.sqs"  (Read 579 times)

0 Members and 2 Guests are viewing this topic.

Offline Captain Crunch

  • Members
  • *
this Exec "HeadButtMyMonitor.sqs"
« on: 21 Apr 2003, 22:38:48 »
I first wanna mention the greatness of this site! I get all the answers here!!!

Ite! First:
I have this Cargo Rope and the script that came with it. It works all fine exept that if I take another chopper, then the rope ofcourse isn't situated at the right place. Any Idea how I can reposition it where I want?? (The Cargo Hook V.1.0 script is from RonaldV, You can find it in this site, I had the link below:


http://www.ofpec.com/editors/browse.php?browsewhat=2&category=2_4


I'ts the one called      Chinook Rope Script and Addon

Second:
How would it be if I wanted a script to find out if a unit has turned on the engine of a vehicle? And I precise not to simply press forward but as well when "Engine On" is clicked in the action menu. I thought maybe

? (EngineOn _Vehicle) : GoTo "Blabla"

But it doesn't work

Any Idea?
« Last Edit: 21 Apr 2003, 23:57:32 by Captain Crunch »
Back to the forest!

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:So many questions!!!
« Reply #1 on: 21 Apr 2003, 23:00:42 »
EngineOn doesn't work because there is no such command.    Since Command ref is organised in alphabetical order for your convenience, its relatively easy to check such things  ;D

However, I commend your directness.   It is amazing how often just trying something works, though I always checkout the command first to make sure I have the correct syntax.

Anyway, I don't know how to check if a vehicle's engine is on.   And I don't know the script in question, but all you have to do (I would have thought) is run a second copy of the script with the different chopper.
Plenty of reviewed ArmA missions for you to play

Offline Captain Crunch

  • Members
  • *
Re:So many questions!!!
« Reply #2 on: 21 Apr 2003, 23:22:10 »
Too bad! :-\

 I thought it to be possible since I have a tutorial here with some "Action" Commands that mention possibilities to order a unit to turn the engine of a vehicle on and off!

And I sure tried a lot of things to work this around believe me! :-X

And sorry but, I'm not sure if I understand what You mean by running a second copy of the script with the different chopper. ???

Could You please explain a bit more? I have a hard time to use my brains since a bullet erbounded on my head in WWI!! :P

One last question for tonight:

I write in a "On Activation" of a trigger (and as well with the "Init" filed of units)

this AddAction ["Start Fire", Exec "Fire.sqs"]

It's totally wrong obviously! >:(

What I want is the trigger to add the action "Start Fire" in my action menu and then when it's cliqued to execute the "Fire.sqs"

Is this possible at all??? I suppose so but HOW!

Please help me! :-\
« Last Edit: 21 Apr 2003, 23:53:16 by Captain Crunch »
Back to the forest!

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:this Exec "HeadButtMyMonitor.sqs"
« Reply #3 on: 22 Apr 2003, 00:01:35 »
this addaction in a trigger is no good, you need the name of the unit, like

loon1 addAction whatever

but if its in the init field that's fine, but that will put it in the action menu from the beginning of the mission.    

You could use a radio trigger rather than an action, if you prefer.


I don't know the chopper script but in general you can run as many copies of a script as you like, as long as you get the parameters right.     So you can run one copy for each chopper, which should give you a rope for each chopper.    what's the command line to make thescript start?   (it must be something like [chopper1] exec "rope.sqs"
« Last Edit: 22 Apr 2003, 00:05:26 by macguba »
Plenty of reviewed ArmA missions for you to play

Offline Captain Crunch

  • Members
  • *
Re:this Exec "HeadButtMyMonitor.sqs"
« Reply #4 on: 22 Apr 2003, 00:38:32 »
PS: I put Some faces around where I think it might be possible to change the rope's position.
-----------
It all starts in the "chop1" 's Init field:

[] exec "CargoVariables.sqs"; [0, 1, Chop1, Chute1, Rope1, Logic1, a1] exec "CargoInit.sqs"
-----------------------------------------------
CargoVariables.sqs:

IsEmpty =

-----------------------------------------------
CargoInit.sqs:


; Usage: [_Loaded,  _ID, _Chopper, _Chute, _Rope, _GlobalData(, _Cargo)] Exec "CargoInit.sqs"
; Example: [1, 5, this, chute1, rope1, gameLogic1, jeep3] exec "CargoInit.sqs" (put this in the INIT field of the chopper)

_Loaded = _This Select 0
_ID = _This Select 1
_Chopper = _This Select 2
_Chute = _This Select 3
_Rope = _This Select 4
_GlobalData = _This Select 5

; This one is a logic unit of which I'm using the position variables to store information: X=ActionID (used when
; removing action), Y=1(Has Cargo) or 0(No Cargo)

; If chopper has cargo at init then Loaded = 1, Else Loaded = 0

? (_Loaded == 1) : GoTo "HasCargo"
? (_Loaded == 0) : GoTo "NoCargo"

#HasCargo

_Cargo = _This Select 6

_GlobalData SetPos [0, 5, 0]

[_ID, _GlobalData, _Chopper, _Chute, _Cargo] Exec "CargoLoaded.sqs"
[_ID, _GlobalData, _Chopper, _Chute, _Rope] Exec "CargoRope.sqs"

GoTo "Exit"

#NoCargo

_GlobalData SetPos [0, 0, 0]

IsEmpty = IsEmpty + [_ID]

[_ID, _GlobalData, _Chopper, _Chute, _Rope] Exec "CargoRope.sqs"
[_GlobalData, _Chute] Exec "CargoChuteSaver.sqs"

#Exit
------------------------------------------------
CargoRope.sqs

_ID = _This Select 0
_GlobalData = _This Select 1
_Chopper = _This Select 2
_Chute = _This Select 3
_Rope = _This Select 4

_RopeC = -2.9  :) :)THIS MOVES THE ROPE FORWARDS/BACKWARDS
_XC = 0  ??? ???I TRIED TO CHANGE THAT HERE BUT WITHOUT SUCCESS
_YC = 0  ??? ???I TRIED TO CHANGE THAT HERE BUT WITHOUT SUCCESS

_AttachAvailable = 0

#Update

_ChopperPos = GetPos _Chopper

_ChopperPosX = _ChopperPos Select 0
_ChopperPosY = _ChopperPos Select 1
_ChopperPosZ = _ChopperPos Select 2

_Heading = GetDir _Chopper

? (_Heading > 90 && _Heading <= 180) : _XC = (Cos (90-(180-_Heading)))*_RopeC ; _YC = (Sin (90-(180-_Heading)))*_RopeC; _Rope SetPos [_ChopperPosX - _XC, _ChopperPosY +_YC - 0.2, _ChopperPosZ - 3.25] ; GoTo "RopeCDone"
? (_Heading > 180 && _Heading <= 270) : _XC = (Cos (90-(180-(360-_Heading))))*_RopeC ; _YC = (Sin (90-(180-(360-_Heading))))*_RopeC; _Rope SetPos [_ChopperPosX +_XC, _ChopperPosY +_YC - 0.2, _ChopperPosZ - 3.25] ; GoTo "RopeCDone"
? (_Heading > 270 && _Heading < 360) : _XC = (Cos (90-(360-_Heading)))*_RopeC ; _YC = (Sin (90-(360-_Heading)))*_RopeC; _Rope SetPos [_ChopperPosX +_XC, _ChopperPosY -_yC - 0.2, _ChopperPosZ - 3.25] ; GoTo "RopeCDone"

_XC = (Cos (90-_Heading))*_RopeC ; _YC = (Sin (90-_Heading))*_RopeC; _Rope SetPos [_ChopperPosX - _XC, _ChopperPosY - _YC - 0.2, _ChopperPosZ - 3.25]

#RopeCDone

_Rope SetDir _Heading

? (_ID In IsEmpty): GoTo "FindCargo"

? ((GetPos _GlobalData select 1) == 0): _GlobalData SetPos [(GetPos _GlobalData Select 0), 1, 0]; [_ID, _GlobalData, _Chopper, _Chute, _Cargo] Exec "CargoLoaded.sqs"

GoTo "NoAddAction"

#FindCargo

_RopePos = GetPos _Rope

_RopePosX = _RopePos Select 0
_RopePosY = _RopePos Select 1
_RopePosZ = _RopePos Select 2

? (_RopePosZ > 4.2 || _RopePosZ < 0.8) : GoTo "NoAddAction"

_Cargo = NearestObject [_Rope, "Jeep"]
? ((_Rope Distance _Cargo)  < 3.8 && (_Rope Distance _Cargo)  > 3.4) : ActionText = "Attach Jeep"; GoTo "DetailedPosCheck"
_Cargo = NearestObject [_Rope, "JeepMG"]
? ((_Rope Distance _Cargo)  < 2.5) : ActionText = "Attach Jeep with Machine Gun"; goto "DetailedPosCheck"
_Cargo = NearestObject [_Rope, "Truck5t"]
? ((_Rope Distance _Cargo)  < 4.8 && (_Rope Distance _Cargo)  > 4.4) : ActionText = "Attach M-939 5t Truck"; GoTo "DetailedPosCheck"
_Cargo = NearestObject [_Rope, "Truck5tOpen"]
? ((_Rope Distance _Cargo)  < 2.95 && (_rope Distance _Cargo)  > 2.55) : ActionText = "Attach Open M-939 5t Truck"; GoTo "DetailedPosCheck"
_Cargo = NearestObject [_Rope, "UAZ"]
? ((_Rope Distance _Cargo)  < 3.4 && (_Rope Distance _Cargo)  > 3) : ActionText = "Attach UAZ 469B"; GoTo "DetailedPosCheck"
_Cargo = NearestObject [_Rope, "Ural"]
? ((_Rope Distance _Cargo)  < 4.3 && (_Rope Distance _Cargo)  > 3.9) : ActionText = "Attach URAL 375 6x6"; GoTo "DetailedPosCheck"
_Cargo = NearestObject [_Rope, "TruckV3SG"]
? ((_Rope Distance _Cargo)  < 4.5 && (_Rope Distance _Cargo)  > 4.1) : ActionText = "Attach PV3S truck"; GoTo "DetailedPosCheck"
_Cargo = NearestObject [_Rope, "GJeep"]
? ((_Rope Distance _Cargo)  < 3.3 && (_Rope Distance _Cargo)  > 2.9) : ActionText = "Attach M151 A2 Jeep"; GoTo "DetailedPosCheck"
_Cargo = NearestObject [_Rope, "UAZG"]
? ((_Rope Distance _Cargo)  < 3.4 && (_Rope Distance _Cargo)  > 3) : ActionText = "Attach UAZG"; GoTo "DetailedPosCheck"
_Cargo = NearestObject [_Rope, "HMMWV"]
? ((_Rope Distance _Cargo)  < 3.4 && (_Rope Distance _Cargo)  > 3) : ActionText = "Attach HMMWV"; GoTo "DetailedPosCheck"
_Cargo = NearestObject [_Rope, "AshHMMWVSnow"]
? ((_Rope Distance _Cargo)  < 3.4 && (_Rope Distance _Cargo)  > 3) : ActionText = "Attach arctic HMMWV"; GoTo "DetailedPosCheck"
_Cargo = NearestObject [_Rope, "LRDBLACKHMMWV"]
? ((_Rope Distance _Cargo)  < 3.4 && (_Rope Distance _Cargo)  > 3) : ActionText = "Attach black HMMWV"; GoTo "DetailedPosCheck"
_Cargo = NearestObject [_Rope, "M113"]
? ((_Rope Distance _Cargo)  < 3.58 && (_Rope Distance _Cargo)  > 3) : ActionText = "Attach M113"; GoTo "DetailedPosCheck"
_Cargo = NearestObject [_Rope, "AshM113Snow"]
? ((_Rope Distance _Cargo)  < 3.58 && (_Rope Distance _Cargo)  > 3) : ActionText = "Attach arctic M113"; GoTo "DetailedPosCheck"
_Cargo = NearestObject [_Rope, "Vulcan"]
? ((_Rope Distance _Cargo)  < 3.58 && (_Rope Distance _Cargo)  > 3) : ActionText = "Attach M-163 Vulcan"; GoTo "DetailedPosCheck"
_Cargo = NearestObject [_Rope, "AshSnowVulcan"]
? ((_Rope Distance _Cargo)  < 3.58 && (_Rope Distance _Cargo)  > 3) : ActionText = "Attach arctic M-163 Vulcan"; GoTo "DetailedPosCheck"
_Cargo = NearestObject [_Rope, "BRDM"]
? ((_Rope Distance _Cargo)  < 3.55 && (_Rope Distance _Cargo)  > 3) : ActionText = "Attach BRDM-2"; GoTo "DetailedPosCheck"
_Cargo = NearestObject [_Rope, "KEGSUAZ"]
? ((_Rope Distance _Cargo)  < 3.4 && (_Rope Distance _Cargo)  > 3) : ActionText = "Attach arctic UAZ 469B"; GoTo "DetailedPosCheck"
_Cargo = NearestObject [_Rope, "KEGSUAZG"]
? ((_Rope Distance _Cargo)  < 3.4 && (_Rope Distance _Cargo)  > 3) : ActionText = "Attach arctic UAZG"; GoTo "DetailedPosCheck"
_Cargo = NearestObject [_Rope, "KEGSUral"]
? ((_Rope Distance _Cargo)  < 4.3 && (_Rope Distance _Cargo)  > 3.9) : ActionText = "Attach arctic URAL 375 6x6"; GoTo "DetailedPosCheck"
_Cargo = NearestObject [_Rope, "KEGSTruck5t"]
? ((_Rope Distance _Cargo)  < 4.8 && (_Rope Distance _Cargo)  > 4.4) : ActionText = "Attach arctic M-939 5t Truck"; GoTo "DetailedPosCheck"
_Cargo = NearestObject [_Rope, "KEGSJeep"]
? ((_Rope Distance _Cargo)  < 3.8 && (_Rope Distance _Cargo)  > 3.4) : ActionText = "Attach arctic Jeep"; GoTo "DetailedPosCheck"
_Cargo = NearestObject [_Rope, "KEGSJeepMG"]
? ((_Rope Distance _Cargo)  < 2.5) : ActionText = "Attach arctic Jeep with Machine Gun"; GoTo "DetailedPosCheck"
_Cargo = nearestObject [_Rope, "KEGSTruckV3SG"]
? ((_Rope Distance _Cargo)  < 4.5 && (_Rope Distance _Cargo)  > 4.1) : ActionText = "Attach arctic PV3S truck"; GoTo "DetailedPosCheck"
_Cargo = NearestObject [_Rope, "LincolnWhite"]
? ((_Rope Distance _Cargo)  < 4.8 && (_Rope Distance _Cargo)  > 3) : ActionText = "Attach Lincoln"; GoTo "DetailedPosCheck"

GoTo "NoAddAction"

#DetailedPosCheck

_CargoPos = GetPos _Cargo

_CargoPosX = _CargoPos Select 0
_CargoPosY = _CargoPos Select 1
_CargoPosZ = _CargoPos Select 2

_Heading = GetDir _Rope
_HeadingCargo = GetDir _Cargo

? (_Heading > 345 && _HeadingCargo < 15) : _Heading = _Heading - 360
? (_HeadingCargo > 345 && _Heading < 15) : _HeadingCargo = _HeadingCargo - 360

_HeadingOffset = Abs (_Heading - _HeadingCargo)

? ((Abs (_RopePosX - _CargoPosX)) < 0.75 &&  (Abs (_RopePosY - (_CargoPosY + 0.37))) < 10 && _HeadingOffset < 40) : GoTo "DoAddAction"

GoTo "NoAddAction"

#DoAddAction

? (_AttachAvailable == 0 && (GetPos _GlobalData Select 1) == 0) : _Chopper AddAction [ActionText, Format ["CargoAttach01.sqs", _ID]] ; _AttachAvailable = 1

GoTo "Done"

#NoAddAction

? (_AttachAvailable == 1) : _Chopper RemoveAction (GetPos _GlobalData Select 0) ; _GlobalData SetPos [(GetPos _GlobalData Select 0)+1, (getpos _GlobalData Select 1), 0]; _AttachAvailable = 0

#Done

? (!Alive _Chopper) : GoTo "Exit"

~0.005

GoTo "Update"

#Exit

; Kill chutesaver and rope

_GlobalData SetPos [0, 1, 0]

_Rope SetPos [0, 0, 3]
-----------------------------------------------

Back to the forest!

Offline Captain Crunch

  • Members
  • *
Re:this Exec "HeadButtMyMonitor.sqs"
« Reply #5 on: 22 Apr 2003, 00:56:18 »
I just tried about the AddAction thing for the fire but it's not working, what do I do wrong, I just wanna build a good mission!  :'(


(In the "On Activation" field of my trigger):

HouseFire AddAction ["Start Fire", Exec "SetFire.sqs"]
Back to the forest!

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:this Exec "HeadButtMyMonitor.sqs"
« Reply #6 on: 22 Apr 2003, 01:08:57 »
remove da exec ;)

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Captain Crunch

  • Members
  • *
Re:this Exec "HeadButtMyMonitor.sqs"
« Reply #7 on: 22 Apr 2003, 01:21:19 »
Ah Thanx a lot LCD!  :D    YEAH!

Any idea for the chopper rope problem?


And thanx everyone again for support!!  8)
Back to the forest!

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:this Exec "HeadButtMyMonitor.sqs"
« Reply #8 on: 22 Apr 2003, 03:48:28 »
Its very late and my eyes are fuzzy, so I can't read the script.   But the important bit is this

[] exec "CargoVariables.sqs"; [0, 1, Chop1, Chute1, Rope1, Logic1, a1] exec "CargoInit.sqs"


Inhte init field of the second chopper you just put chop2, chute2 etc and make any other appropriate changes.    Its nothing to do with the x y z bits in the middle they.

By changing the parameters of the scipt you can run it for as many choppers as you like
Plenty of reviewed ArmA missions for you to play