Jump to content
Sign in to follow this  
rga_noris

Starting a Module Mid-Mission

Recommended Posts

..or more specifically, the Warfare module.

Let me start by explaining my goal, as there could be more than one way to do this. Essentially the map is a custom map for me and a friend. We typically play Warfare maps, allied on the same side. I've made a few custom Warfare maps, but this time I wanted to make something special, as well as learn some scripting. Essentially I now have a map set on Isla Duala. Each player starts out with a small squad and can complete various objectives around the map, such as locating a working SCUD launcher by intercepting a convoy and capturing a VIP. Essentially there are several goals around the map that me and the friend can complete, but what I would like to happen is this:

The players can run about the map completing covert objectives BEFORE the Warfare actually starts. Currently the way I have it set up is, at any time, either player can use a radio trigger that will change the global variable GoToWar to equal 1. The condition of the modules presence is GoToWar == 1; GoToWar is set to equal 0 in the Init.sqf. When the radio is used, however, nothing happens.

What does appear to happen is that respawn is set up for all players, however this occurs no matter what, even before the radio trigger is used.

As a point of trouble shooting, I also made the condition for presence true for the module and tested the mission... it started like a normal Warfare mission, with money, HQ's, and the works.

Any ideas on how to achieve a two phase mission like this? Thanks in advance for any help.

Share this post


Link to post
Share on other sites

Stupid question but did you use publicvariable in the radio script? Incase only server needs it you can always use publicvariableserver aswell I'm pretty sure.

Share this post


Link to post
Share on other sites

Hadn't really considered that... Would it make a difference on the local machine though?

Share this post


Link to post
Share on other sites

Well if you are doing at as I think you are, you're setting GoToWar from the radio on the client right? You need to broadcast the variable to every client or just the server depending on what fits your needs.

Because if you set GoToWar to 1 in the radio without publicvariable it only changes on the client. If you do publicvariable "GoToWar"; then everyone (including server) gets sent the variable that you set on your client (1 in this case).

See

http://community.bistudio.com/wiki/publicVariable

http://community.bistudio.com/wiki/publicVariableServer

Share this post


Link to post
Share on other sites

Thanks for the information, i'll see if it helps. Based on those links you sent me, I do have a Q; if I am editing the mission and then testing it with myself as the only human player, shouldn't all variables be utilized on my machine, as I qualify as local and server?

I think I am going to have the radio trigger exec a script that will create the Warfare module, as opposed to changing its presence condition. I'll be sure to post my results here. Thanks again for your help thus far.

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  

×