Jump to content
Sign in to follow this  
peppy

Whats wrong with this please?

Recommended Posts

_heli1 = createVehicle ["MH60S",[_CalPosx, _CalPosy], [], 0, "FLY"];
_heli1 setVehicleVarName "heli1";
_heli1 engineon true;
_heli1 Flyinheight 22;

_heli1Pi1 = createGroup (west);
"USMC_Soldier_Pilot" createUnit [Position _heli1,_SokPi1];
(units _heli1Pi1 select 0) moveInDriver _heli1;

_heli1Pi2 = createGroup (west);
"USMC_Soldier_Pilot" createUnit [Position _heli1, _heli1Pi2];
(units _heli1Pi2 select 0) moveInCargo [_heli1, 0];

_heli1Gn1 = createGroup (west);
"FR_AR" createUnit [Position _heli1, _heli1Gn1];
 (units _heli1Gn1 select 0) moveInTurret [_heli1 ,[0]];

_heli1Gn2 = createGroup (west);
"FR_AR" createUnit [Position _heli1, _heli1Gn2];
 (units _heli1Gn2 select 0) moveInTurret [_heli1 ,[1]];

Not Seeing it, Gn1 and 2 are not getting placed in helo1, Pi1 and Pi2 are good. ??

PS: I dont get it, it would not work, but it is now..? any reason why they may not be placed in there, script placement?

Edited by Peppy
Working..

Share this post


Link to post
Share on other sites

  1. Why do you create 4 groups if one would be enough (one group for a crew seems fine and really at least pilot and gunner belong in the same group)
  2. Why don't you load the bis functions and use the provided spawn functions? They are a charm to use, they put the necessary crew into your vehicle while creating one group (or using an existing one) and you may have them start in air too and so on...

Share this post


Link to post
Share on other sites

ya roger that, I am trying to keep each AI in its own grp for now, I am going to be running individual scripts on each, so I think it easier to just have each in its own group. Eventually in the script each has its own action, for example in case of a crash, or landing, each will respond differently, each will have their own set of commands and actions.

And the Bis func, I know of, not about. I have intention on finding alternatives once I have a easy to understand and functional script, at the moment that is all I seek, functionality, and then I will concentrate on cleaning it up with function use, and loops to limit the scripting space, and time to run em.

Thanks for the input, tis welcome..

Share this post


Link to post
Share on other sites

you are missing something in the moveinturret command

_soldierOne moveInTurret [_tank, [0, 0]]

Can you see it? ;)

Share this post


Link to post
Share on other sites

http://forums.bistudio.com/showthread.php?t=107419&highlight=moveInTurret

Is what I was reading as a reference.

But I do have an additional question: If I spawn a Helo and Pilot in one script, then call an different script, how can I pass their names or groups names to be used in other scripts. Am I making them global?

Example would be very cool, so I guess I am looking to Name the helo and the spawned units where each would have their own unique name, but one that can be used in any of the other scripts. Thanks. lol sorry new to the Spawning thing. :)

got it. sorry nm.

Edited by Peppy
Dhu..

Share this post


Link to post
Share on other sites
http://forums.bistudio.com/showthread.php?t=107419&highlight=moveInTurret

Is what I was reading as a reference.

But I do have an additional question: If I spawn a Helo and Pilot in one script, then call an different script, how can I pass their names or groups names to be used in other scripts. Am I making them global?

Example would be very cool, so I guess I am looking to Name the helo and the spawned units where each would have their own unique name, but one that can be used in any of the other scripts. Thanks. lol sorry new to the Spawning thing. :)

got it. sorry nm.

looks like you figured it out.

Im just going to throw this out here just incase:

checkout spawn and call they are very powerful.

Also search these forums for more detailed info on each.

Wiki is ok, but examples are way better here on forums.

Share this post


Link to post
Share on other sites

Thanks man! Appreciate the help.

Okay having an issue, I need to be able to send orders to the helo while it is performing actions without interrupting the action.

For example : Helo is order to move to WP1, where at WP1 it is to land, However I would like to be able to turn the lights on or off during its flight and landing without causing it to stop and hover, I am understanding it as.

I wonder is there a way to run a script without interrupting the currently running script?

It works good untill I effect the lights, then it just refuses to land, if I dont effect the lights, it lands, I am using the Behavour settings to effect the lights.

PS: was reading on Spawn, is this what I could be using, as it can run parallel?

Share this post


Link to post
Share on other sites

I just tried using a normal editor placed chopper and it works fine.

Check your waypoints aren't too close as that can confuse choppers.

Share this post


Link to post
Share on other sites

this helo is not created by script.

I my have forgoten to mention that Turing the lights on or off, is in an action.

Menex2 = _caller addAction ["Lights OFF!!", "lights.sqf", [1],1];

Menex1 = _caller addAction ["Lights On!!", "lights.sqf", [2],1];

but once I select one of the actions the host script seems to stop, for example there sent to a wp that is created by the host script, but while there on their way to the WP and I use one of the actions (Witch looks at "lights.sqf" that is out side the host script), the helo will continue to move to the WP, but it will not land?

If I don’t use the actions that helo lands as normal?

I don’t know if it is possible, but is there a way to add code to an addiction, for example.

Menex1 = _caller addAction ["Lights On!!", SokPi1 setBehaviour "COMBAT"];

Or something of the kind?

---------- Post added at 03:46 AM ---------- Previous post was at 03:32 AM ----------

I dont know enuff about fucntions to make it a fuction witch I would love to do, as it could be called by all scripts, witch it will have to do eventualy. any one willing to help, I will post the script and you can take a look at it. thanks.

Edited by Peppy

Share this post


Link to post
Share on other sites

solved by putting commands in Spawned triggers.

Share this post


Link to post
Share on other sites

while although I solved one issue I have discovered anther, I wonder about this one.

A that the the Behavior changed between one WP to the Next cancels the Statements,

It still gos to the wp, but fails to fire its on Act

Just turning the lights on don't work, the AI turn em right back off, so far I only know charging the behavior will turn lights on or off.

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  

×