Printable Version of Topic

Click here to view this topic in its original format

Armed Assault Info Forums _ Mission Editing & Scripting _ Armed Assault Scripting problem

Posted by: harold5187 Mar 2 2010, 18:12

With Armed Assault I've encountered more scripting problems than I've had with Operation Flashpoint; Things that were easy in Flashpoint are very difficult in ArmA.

I have what I call my "Rearm" script, for use in MP missions. And what this is, is basically, 2 triggers on the map, executed repeatedly on condition of:

Trigger1
Condition: ?(alive Player1)
onactiv: Player1 exec "P1Rearm01.sqs"
ondeact: Player1 exec "P1Reset.sqs"

Trigger2
Condition: ?(alive Player2)
onactiv: Player2 exec "P2Rearm01.sqs"
ondeact: Player2 exec "P2Reset.sqs"

P1Rearm01.sqs
if not local server exit...

_Unit=player;
if unit == Player2 then get da heck outta here...

otherwise perform the following actions for Player1 only

P1Id1 addaction "give me this weapon", "P1Weap01.sqs";
P1Id2 addaction "give me another weapon", "P1Weap02.sqs";

then exit normally...

P2Rearm01.sqs
if not local server exit...

_Unit=player;
if unit == Player1 then get da heck outta here...

otherwise perform the following actions for Player2 only

P2Id1 addaction "give me this weapon", "P2Weap01.sqs";
P2Id2 addaction "give me another weapon", "P2Weap02.sqs";

then exit normally...

P1Reset.sqs
removeaction P1Id1;
removeaction P1Id2;
removeaction ...
exit

P2Reset.sqs
removeaction P2Id1;
removeaction P2Id2;
exit

This is the jest of my script, and all it does is adds some middle mouse options during MP gameplay for both Player1 and Player2....

What is supposed to happen is that after we die the script executes over and over again for Player1, and Player2, but what really happens, is that the engine alternates, as if it is deciding who it wants to have weapons, and who has none at all... Sometimes it works for the first few deaths, but then it stops working, and kicks back in moments later. Its not fluid, meaning, doesn't happen every time one of us die in MP...

Does our character loose its identity after it dies, hense the script doesn't know who Player1 and Player2 is, or is the script not executing on the other computer. Another problem with this script is, that when standing over a dead body I get double the options in my middle mouse button. (Unless I put the code):

_Unit=player;
if player=="Player1" then exit;

But that causes another problem, it solves the problem of Player2 getting player1's options when standing over their dead bodies, but if I stand over my own dead body, then I get the options again, after the Reset scripts crash out... I suppose we are dying faster than the game can keep up with the scripts?

Any help or advice would be appreciated.... All I want is to have the middle mouse options for the options I want, to be available no matter how many times Player1, or Player2 dies in MP... Is this even possible in MP game mode?

Another problem I'm having is the stupid AI do not obey in MP... I give them waypoints and cycle commands, which they
perform very well for the first few times, then they just sit around at their respawn point doing nothing, no longer going to their waypoints, do their identities get lost, hense leaving their new selves in a big world with nothing to do?

This is very frustrating... I've created a lot of missions for Operation Flashpoint including my rearm scripts, bulletcam, but these things are very difficult in ArmA... I have extended event handlers in my addon directory as well.

I suppose my main problem is identities, as well as what data needs to be executed on my Server and what data needs to be executed on my friends computer. Anyway, I would appreciate your thoughts, and forgive me for the blabbing, and the psudo code, as my scripts are as long as my ramblings, so I just gave you the jest of what they perform!

thankyou very much for your time...

Sincerely

Harold McBroom

harold5187@hotmail.com

Posted by: MNBVCXZASDFGHJKL Mar 6 2011, 23:10

If it is that and their identity is changing then do this.

QUOTE
class CfgIdentities
{
class John_Doe
{
name = "John Bartholemew Doe";
face = "Face20";
glasses = "None";
speaker = "Dan";
pitch = 1.0;
};
};

Now that you've changed different variables you must activate the identity within ArmA. Double click on the unit who will be using the identity and type in the init field: this setIdentity "John_Doe";
The "John_Doe" comes from the "class John_Doe" that is configured in the Description.ext file. If the "John_Doe" in the Description.ext file is changed then make sure to change the "John_Doe" in the init field.

Hope this helps.

Posted by: D@V£ Mar 7 2011, 02:24

Let's not dig up year old threads, shall we?

Closed.

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)