Jump to content
Sign in to follow this  
qbt

Multiple Session Gamemode

Recommended Posts

I do not understand it all, English is not very easy to me so far given, but your train of thought I understood. I would be better for my project this system. Thank you again. If you need any assistance which will be out there with the models, addons, islands, I will be glad to help.

Share this post


Link to post
Share on other sites

Can you help, the system that you gave me no save rocket-launcher and pistols. There is a demo of SOW2?

Share this post


Link to post
Share on other sites

Found it! Now my system stores any weapons and the number of rounds in the cage, as well as the position on the map. It works like a clock, and no FWATCH is not needed

Share this post


Link to post
Share on other sites

My demo wasn't supposed to be comprehensive, just a proof of concept to get you going. SOW2 is probably overkill for what you need but if you like using sledgehammers to crack walnuts then it will do the job.

To add support for launchers to it just add another set of database arrays e.g.

SecondaryWeaponDB = ["","LAWLauncher","RPGLauncher","CarlgustavLauncher","AT4Launcher","WW4_JavelinLauncher"]
SecondaryMagazineDB = ["","LAWLauncher","RPGLauncher","CarlgustavLauncher","AT4Launcher","WW4_JavelinLauncherMag"]

You only need a separate magazine database if you know your launcher uses a magazine classname that is different from the weapon classname. In the code example above its only needed to support the WW4 javelin launcher.

In your saving script to detect what launcher the player has use secondaryweapon. Then search the database in the same way as in my example of saving a primary weapon.

For pistols you add another database e.g.

SidearmDB = ["Beretta","Tokarev","CZ75","Revolver","Ingram","Skorpion"]
SidearmMagazineDB = ["BerettaMag","TokarevMag","CZ75Mag","RevolverMag","IngramMag","SkorpionMag"]

Detecting what pistol the player has is slightly more difficult, you need to use weapons to get an array of all the player's weapons then remove the player's primaryweapon and secondaryweapon to leave you with just the pistol.

Ancillary equipment like hand grenades are harder still. You could use a seperate variable to store the quantity of each piece of ancillary equipment the player could possibly have. E.g. PlayerHandGrenades, PlayerSmokeGrenades, PlayerFlares etc etc. But this is very wasteful, a more efficient way is to pack multiple values into a single SOW saved value then unpack them when you load. A single SOW1 entry can store an integer in the range 0 to 999998, or 19 bit words if you like thinking in binary (as I do). So you could store 19 bool values in a single variable or perhaps four numbers between 0 and 16. Hopefully you see where I'm going with this... MWC uses this principle to reduce the number of stored values from 652 to 74.

Edited by *Zeewolf*

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  

×