Jump to content
Sign in to follow this  
yogybear

Problem with a heli-carrier script

Recommended Posts

Hi, i have a problem with a heli-carrier script.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_carrier = _this select 0

_cargo = _this select 1

endCargoSession = false

goto debug

#again

_x = (getPos _carrier) select 0

_y = (getPos _carrier) select 1

_z = (getPos _carrier) select 2

_cargo setPos [_x, _y, _z - 10]

_cargo setDir (getDir _carrier)

~.01

? (!endCargoSession) : goto "again"

exit

it doesn't work with addons like a snow heli.... why?

Share this post


Link to post
Share on other sites

I suggest you change it to:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_carrier = _this select 0

_cargo = _this select 1

endCargoSession = false

#again

_cargo setPos [getPos _carrier select 0, getPos _carrier select 1, (getPos _carrier select 2 )- 10]

_cargo setDir (getDir _carrier)

~0.01

? (!endCargoSession) : goto "again"

exit

There is no reason that would work for one chopper and not another, you must have just got the names wrong, make sure you activate it like this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[choppername, cargoname] exec "scriptname.sqs"

RED

Share this post


Link to post
Share on other sites

ok, thx, it works well

but is it possible 2 make it with a menu in a multiplayer? It would b a nice effect if u can sit in a chopper and fly over a vehicle and carry it.

Is that possible? And how, i have no idea

Share this post


Link to post
Share on other sites
ok, thx, it works well

but is it possible 2 make it with a menu in a multiplayer? It would b a nice effect if u can sit in a chopper and fly over a vehicle and carry it.

Is that possible? And how, i have no idea

you can add an action to the vehicle that you want to pick up, or make it "popup" as an action in the helicopter that you are flying.

1:st example.

add for instance an jeep on the map, in it's initfield write

this addAction ["pick me up","scriptname.sqs"]

rewrite "scriptname.sqs"

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">;;this is the unit with the action, the jeep

_cargo = _this select 0

;;this is the unit that activated(used) the action, hopefully the chopper, not you.

_carrier = _this select 1

;;if it turnes out not to work, change it to

_tmp = _this select 1

_carrier = vehicle _tmp

;;dunno if you can write it as follows

_carrier = vehicle _this select 1

endCargoSession = false

#again

_cargo setPos [getPos _carrier select 0, getPos _carrier select 1, (getPos _carrier select 2 )- 10]

_cargo setDir (getDir _carrier)

~0.01

? (!endCargoSession) : goto "again"

exit

2:nd.

I'm afraid I can't give you an exact explanation about the procedure, but it would have to work something like this

the action is added to the jeep only if your chopper is near the jeep, because it would look rather strange if you could "carry" the jeep whilst beeing an normal soldier.

also it needs to check some sort of distance away/above the jeep, I think about 5 meters is the "normal" distance of activation for "addAction" commands.

an exmaple that might not work.

add an trigger, with the radious that you want it to have(range of "pickup"

and activated by: NONE,

make it repeate itself

condition: ("UH60" countType list thisList) && ((chopper distance jeeptobecarried)<30)

onActivation: jeeptobecarried addAction ["pick me up","scriptname.sqs"]

scriptname.sqs is now the script mentioned in example 1.

try it, if it doesn't work, return here and say so

good luck

Share this post


Link to post
Share on other sites

i found something here:

OFPec

search for this on the page: Chopper Pick-Up and Drop Object

or use this: javascript (don't know if it works)

The autor of this script says that u can use this script with only one chopper per map. My suggestion is that i can make a mp-map with 2 choppers which can carry vehicles and i use 4 each chopper this script with different variables and *.sqs . i hope u can follow my idea (badly explained i know...)

Do u think it is possible?

Share this post


Link to post
Share on other sites

ah, I've tried my own example and it didn't show up in the chopper.

and I know understand which problems that he who posted the script which I didn't download as I'm not so very keen on dl exe-files from internet.

The action is added to an specific heli, static...hmm

it could be done with

!isNull(nearestObject [jeep,"UH60"])

mychopper=nearestObject[jeep,"UH60"]

then.

mychopper addAction ["Pick up","pickup.sqs"]

I must try it first.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×