Sign in to follow this  
Followers 0
rbilka

How to get actual position of player.

2 posts in this topic

​​Hi.

​Few years ago, I had created few complex MP scripted missions for OFP, ARMA, ARMA2 (in SQS later SQF).
Now I am trying to start doing something for TKOM. I have basic knowledge of VB, C# and little with C++.

​Questions:
​1) Is there any guide, information, which can help me better understand, how can I create missions (not via editor). Which objects and methods/functions are accessible locally, or which event handlers are used, and where definitions should be written.
​2) Is basic principe same, as it was in ARMA2, that you have LOCAL or GLOBAL "vehicles" and depending on "event", the same script file (or method/function?) is started/called on all machines ... , so you need to check every time, if you are "on server, on client, or serverclient"? just simple example would be nice.

For example, how can I in MP game, create something GLOBALY on position of just joined player?
​Something like on "player joined event" to call event/function to get position of that player ...and spawn crate at that position.


​Thanks for any information/guide/example, you can provide.

Share this post


Link to post
Share on other sites

For example, I am able to trigger script from scenario file (TRIGGER_START>>>TRIGGER_LINK>>>EVENT_SCRIPT).
Then in that script file, I can use:
​Vehicle_Handler myObject = SpawnVehicle ("objDef.cfg", <playerPos>, false);
​
​<playerPos> should be "Vector" type, array[3]?
​How to get position of MP (joined) player, and where I can write my script to be triggered by this function?
 void OnNetPlayerJoin(NetPlayer player)
 {
 }
I tried this but not success yet:
vector mat3[4];
CGame game = GetGame();
NetPlayer localPlayer = game.GetLocalNetPlayer();
GetMatrix4(localPlayer, mat3);
​vector playerPosition = localPlayer.GetPosition();
 

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  
Followers 0