OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: Unnamed on 19 Feb 2004, 11:25:54
-
Hi,
I'm working on an addon that uses the Fire command to fire off a round, however I only want to do this when its an AI gunner.
I can use the Player command to see if I'm in the gunners position, but in Multiplayer how could I detect if another player gets in as the gunner?
Because its an addon I cant use the Skill level trick as thats up to the mission designer, and I would prefer not to make the mission designer compile a list of players himself.
Any ideas?
Cheers
-
I have built a script in a different situation, but I had to use 'player' to refer the actual gunner of 3 boats when me and 2 buddies of mine were the gunners.
This script worked with every machines in MP, with the playable rolls as well.
So I guess when a script runs in every local machine and you use 'player' to refer the dude who is behind the keyboard, it will work.
So in my opinion you can use: '? player == gunner vehiclename'
If anyone disagree, plz correct me...
-
use a gamelogic called server
and use the line
?!(local server): exit
at the start of the script that you want to run these AI
AI are controlled solely by the server and using the line above and a gamelogic correctly named will ensure this happens
-
I'm a bit slow when it comes to the MP side so bear with me, I'm still trying to understand the principles. So If I sound Dogmatic, thats not my intention.
@Gundernak
The script is designed for AI group members only, it sits there looping though each AI member of a particular players group. Another player could get in as gunner if the AI dies while its still looping, would this still apply?
@Terox
I know adding a GameLogic called server is the adopted method for most MP games. But rather than having to explain this in the Addons documentation, is it possible to automaticaly create my own Server GameLogic from within the Init event of the addon?
To be honest this makes me think how hard it is to learn the MP without a server to experiment on. If I was to create a little network, whats the bear minimum spec required for OFP's standalone server, just to run a few basic tests and nothing more?
Edit:
Can you run the standalone server on the same machine thats also acting as a client, would that still work the same?
Cheers guys
-
I think what I wrote could work...Altought you should try
As I told you I used this for making the possibility for a player to move into the driver or the gunner seat of a boat, or send a group member from the cargo to these seats.
You know when a gunner or driver is killed in a boat, without this you can not fire or you will stay on the sea and can do nothing...In this situation it worked, but I tell you I had not been testing it enough to claim it for sure.
As I see you need a condition or check somewhere...what will tell you is there any player in the gunner position...I would try this, altought I am not sure it is working for you...
-
I think what I wrote could work...Altought you should try
Thanks and I will, there is so much I need to learn about MP, I doubt I even know what the question is right now.
I have an old PC I'm going to try to rigg it up as a server and experiment.
Thanks again.