Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
Private_Flak

Weapons not available to all players

Recommended Posts

I've been editing MFCTI (http://mfcti.sourceforge.net) ver1.0 for nogova but i've run into a multiplayer problem.

MFCTI allows you to build vehicles from factories, I have added weapon loadouts to these vehicles in the script that creates them.

The problem is that the weapons are only available to the person who bought the vehicle. So its the player who initiated the script that has access to the loadout but no-one else does.

Has anyone else had a problem like this and found a way around it?

Share this post


Link to post
Share on other sites

Yes the weapon loadout commands are local. Therefore only who runs the loading script gets the weapons. A way around this? Look into the CoC Network Services, maybe you can use them to run some target scripts on the other machines that load the weapons on. CoC NS

However everything you are doing is of medium to high scripting difficulty. FYI: Next version of the CoC NS will include the functions fNSendAll, fNSendClients, fNSendServer, and fNPrint

I think everyone can imagine what they do.

Share this post


Link to post
Share on other sites

wow I only came back here to make a bookmark, thanks for the quick reply...ill try that now.

Share this post


Link to post
Share on other sites
Guest jacobaby

I am not sure if this would work, but maybe you could try broadcasting the vehicle object as a publicvariable.

My reasoning is that loadouts added via the editor are valid on all clients, even where the vehicle is not local, so maybe that is how it works, by making the object and its associated properties publicvariables.

?

TJ

Share this post


Link to post
Share on other sites

Nah, when you do PublicVariable of a vehicle, only a reference to the vehicle is transmitted/assigned to a variable name.

Share this post


Link to post
Share on other sites

With some help from BN880 I have mangaged to get the vehicle loadouts working for all players in my CTI mod.

Briefly this is how its done...

Follow the installation instruction for CoCNS, its a peice of cake.

Create a function with the newly created vehicle object as a parameter. The function need to call a script that will add the weapons to the vehicle using the addWeaponsCargo command. In my example this function is called EVL (Equip Vehicle Loadout)

In the script that creates the vehicle add the following code or equiv:

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_ArrayCount = count rNPeerList

;start at 1 becuase we dont want to execute this on the server which is always in position 0

_CurrentPosition = 1

#RNloop

[_CurrentPosition,[_newVehicle],["E","V","L"]] call fNSend

_CurrentPosition = _CurrentPosition + 1

? (_CurrentPosition < _ArrayCount): goto "RNloop"

<span id='postcolor'>

Im sure this can be done with much neater forEach loop but it caused me nothing but hassle so I did it this way.

Hope thats of some use smile.gif

Share this post


Link to post
Share on other sites

Glad you got it going,

BTW Flak, if you wanted to you could even pass things like Dialog weapon amounts to that function, so that you can fill with the number of weapons a client selected. smile.gif

Share this post


Link to post
Share on other sites

I thought about using Karrilions weapons loadout dialog which is on this forum somewhere. Unfortunatly when I tested it I found I could leave an AI at the ammo crates and use the radio actions to open the loadout menu from anywhere on the map. (this wouldnt go down to well in a CTI game)

Not sure if you can do this in RTS, im sure Karrilion has found a way around it (unlike me) smile.gif

But that aside, it would be damn cool to let people add a custom loadout to vehicles, if only I could find a list of the ammo/weapon capacity of each vehicle sad.gif

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  

×