Jump to content

Recommended Posts

Hello guys,

 

I have a mission with an integrated construction system. Players can build fortifications, I use createVehicle locally on the client for that. Some of the created objects also have eventHandlers attached to them.

I now want to allow saving and later resuming the mission. I got it mostly working, however 2 questions remain:

1. Will objects created using createvehicle on a client be saved and restored?

2. I read somewhere that variables added via setVariable will be saved, what about eventHandlers though? Do I have to redo them after resuming the mission from a savegame?

 

Thanks for all tips and guidance in advance, you guys have been of so much help already!

 

Leander

Share this post


Link to post
Share on other sites

You should completely re-think what you are doing

 

1. Where I execute code? (Server or client?)

2. Which commands I use? (Global effect or local effect ?)

2.1. If you use eventHandler only on client, it will fire only on that client where it was executed (logically). Of course if there is an eventhandler with global effect - it will be executed on all machines.

3. It's always works that way: Where, what and how

 

1 hour ago, -LuLeBe- said:

Will objects created using createvehicle on a client be saved and restored?

 

Created is created. Why should it dissapear? I think your problem is deeper in understanding of something you can't explain

 

1 hour ago, -LuLeBe- said:

I read somewhere that variables added via setVariable will be saved, what about eventHandlers though? Do I have to redo them after resuming the mission from a savegame?

 

If variable is broadcasted, it will be synchronized for all players including JIP ( https://community.bistudio.com/wiki/setVariable ) and if you load the game (as Host) - other players will be counted as JIP players. For example: You hosted the game and started it with your friend. You saved the game. Now you want to load the game. You friend is now a JIP player. So take care of Init.sqf, because it will be executed on his machine.

  • Like 1

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

×