Jump to content
Sign in to follow this  
talkinBEERmug

Mp mission problems

Recommended Posts

New to the forums here, Im about 15 hours into my first mission, im new to the whole ofp and arma editing, but I have figured out enought to make this mission really cool, random spawn points for my hostages, hostaged script, calling helo for pickup, insertion, extraction, now I get this all to work when I test it, and when I host and im the leader everthing works fine.  The problem starts when im hosting, and some one else takes leader, or when I put it on a dedicated server. Alot of my scripts and AI dont work right.  

Ill give you one of the examples off the top of my head.  

When I host and some one else is leader, or im running the server on a dedicated server, you can order the ai into a chopper and they get in, but you cant get them out of the chopper.  This works if im host, and im leader, or when I test it in the missions editor.

I have tried to trigger dogetout, commandgetout, even telling them in game to disembark and they dont get out, the only thing I can think is that the chopper is set to land "get in" so if it is on get in they wont get out, but why would it work if I lead, or if im in the missions editor.

Can anyone help me with this script, or tell me why MP reacts differently then SP.

Here is the example of the script:

Trigger:

on: RadioAlpha

on Act: chopper domove pickup(trigger)

Trigger:

on: none

condition: (chopper alive) and (chopper distance p1 < 100)

on Act: chopper land "get in"

Share this post


Link to post
Share on other sites

For some reason I found I had to combine two commands to get AI units to disembark from a vehicle on a dedicated server for instance <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{unAssignVehicle _x} forEach units _grp1

~1

{doGetOut _x} forEach units _grp1

where _grp1 was the group the units were a part of.

Share this post


Link to post
Share on other sites

I put this in a sqs file that I call buy a trigger radio alpha

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{unAssignVehicle _x} forEach units _grp1

~1

{doGetOut _x} forEach units _grp1

I put this code in my init.sqs

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

Still not working in dedicated server, even when I was testing in the editor it was not working.

Share this post


Link to post
Share on other sites
I put this in a sqs file that I call buy a trigger radio alpha

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{unAssignVehicle _x} forEach units _grp1

~1

{doGetOut _x} forEach units _grp1

I put this code in my init.sqs

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

Still not working in dedicated server, even when I was testing in the editor it was not working.

You're using _grp1 (local var) and grp1 (global var). Replacing _grp1 by grp1 in your sqs file should do the trick wink_o.gif

Share this post


Link to post
Share on other sites

As it is now, I have this in my init.sqs

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

and I know it is putting me in the right group because when I do some of my triggers it executes the following:

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

this does work, and it finds the leader of grp1 and does the side chat. Now should my init.sqs read like this:

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

or do I have to list both like this:

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

grp1 = group p1

Share this post


Link to post
Share on other sites

The difference between a local and a global variable is called the scope. A local variable is only known within the structure it was created in, e.g. created in a script and thus only known within this script. If you want to use data across different structures (like in your case both within a script and a trigger), then you have to use a global variable. Defining a local var in ArmA means you add an underscore to the name (e.g. like in your case _grp1), a global var starts with an alpha character, not with an underscore (e.g. grp1).

Since you want to share the data between the init.sqs and the trigger, you have to use a global var, grp1. There shouldn't be mention of _grp1 anywhere, since that is a different variable, with nothing in common with grp1.

So be sure to use grp1 everywhere:

init.sqs: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">grp1 = group p1

trigger: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">leader grp1 sidechat "blah"

HTH wink_o.gif

Share this post


Link to post
Share on other sites

So the _ means local, and the name is global, so in this code:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{unAssignVehicle _x} forEach units _grp1

~1

{doGetOut _x} forEach units _grp1

it should be this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{unAssignVehicle _x} forEach units grp1

~1

{doGetOut _x} forEach units grp1

right?

Thx for the help

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  

×