Private_Flak 0 Posted May 13, 2003 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
bn880 5 Posted May 13, 2003 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
Private_Flak 0 Posted May 14, 2003 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 Posted May 17, 2003 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
bn880 5 Posted May 17, 2003 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
Private_Flak 0 Posted May 19, 2003 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 Share this post Link to post Share on other sites
bn880 5 Posted May 19, 2003 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. Share this post Link to post Share on other sites
Private_Flak 0 Posted May 20, 2003 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) 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 Share this post Link to post Share on other sites