Jump to content
Sign in to follow this  
A-SUICIDAL

Need Help with JIP stuff

Recommended Posts

I made a 8 man coop mission. It's basically completed. I tested it with friends and when one of my friends joined in late, problems then started to occur.

First I'll explain quick how the mission works. At mission start we all start out in a plane that circles high above a drop zone. If any player dies, that player respawns back in the plane cargo. I did this by attaching a respawn_west marker to the plane and also by detecting by trigger when a player is alive and then move the player back in cargo of the plane. Once we complete the first objective, the completed objective area becomes our new respawn location and the trigger that moves us in cargo of the plane is deleted. There are several objectives that we complete throughout the mission and each one becomes our new respawn area. AI are turned off in the mission. The only thing in my init.sqs files is... execVM "briefing.sqf";

When my friend joined late he spawned on the ground where the players were initially placed in the editor. He was miles behind us. My other friends and I had already completed many objectives that we were respawning at when we ever we died. The first time I got got killed after my friend joined late, I suddenly respawned far away in the middle of nowhere and then I immediately looked at my map and noticed that the plane that we start in at mission start was directly above me at the moment I respawned. Apparently when my friend joined it screwed up my respawn location. I asked my friend later after we stopped playing the mission if he remembered seeing the completed objectives on the tasks list and he said that he didn't see any objectives completed at all, yet we had completed 7 of 10 objectives before he joined the game.

So how do I fix my mission for players that join in progress? What do I need to put in my init.sqs file to make JIP stuff work? How can I make it so JIP players are updated with the completed objectives when they enter? Since the respawn_west marker does move around a lot in my mission. Is there a way to make it so players that join in late will start where the respawn_west marker is currently set?

My mission was working great up until the JIP issues bit me in the $@#$&. I worked really hard on this mission. I was feeling proud. Now I feel like crap. Please help.

Edited by A-SUICIDAL

Share this post


Link to post
Share on other sites
Once we complete the first objective, the completed objective area becomes our new respawn location and the trigger that moves us in cargo of the plane is deleted.

looked at my map and noticed that the plane that we start in at mission start was directly above me at the moment I respawned.

Dumb question, did you detach and setmarkerpos the respawn marker?

Share this post


Link to post
Share on other sites

"respawn_west" setmarkerpos getpos plane1

then after we capture the first objective area...

"respawn_west" setmarkerpos getpos objArea1

and every time we capture a new area the respawn marker moves to that new location. How can I get join in progress players to join at the most recently captured objective/respawn area? and also make it so they can see the completed objectives correctly?

Share this post


Link to post
Share on other sites

Problem is that you are using a global command to update the marker position, or at least that you run it on every machine.

Besides, you don't even need to setpos it to the plane position since you move players into the cargo. So, I'd just remove that line completely and place the marker in editor to a suitable position where players can respawn, before they are moved into the plane.

As for the task update for JIPs, just use a simple double trigger system:

Trigger 1a:

cond: !alive somebody

onact: obj1 = true; publicvariable "obj1"

Trigger 1b:

cond: obj1

onact: tsk1 settaskstate "succeeded"; "respawn_west" setmarkerpos getpos objArea1

Share this post


Link to post
Share on other sites
Besides, you don't even need to setpos it to the plane position since you move players into the cargo. So, I'd just remove that line completely and place the marker in editor to a suitable position where players can respawn, before they are moved into the plane.

I did what you said what you said above. Good idea.

Now the next part... there are 9 enemy gun nest spread out about 200 to 300 meters apart from one another, they are heavily defended and each is an objective that needs to be captured.

For the first objective "obj1" all a player needs to do is enter inside the gun nest and a trigger then activates and completes that objective. Here is what is in the activation field for the trigger.

"1" objStatus "DONE";
tskobj1 setTaskState "SUCCEEDED";
player setCurrentTask tskobj2;
obj1 = true; 
publicVariable "obj1";
"respawn_west" setMarkerPos getMarkerPos "area1";

Is this good for JIP players? Like if they join after obj1 has been captured, is there anything else I need to do in order to make sure the JIP players will see that obj1 has already been completed?

And would I need to use onPlayerConnected to get JIP players to start where ever the respawn_west marker has been moved to? And if so, how?

Share this post


Link to post
Share on other sites

If I stuck this in my init.sqs, would it work?

onPlayerConnected "[_id, _name] setPos respawn_west";

Share this post


Link to post
Share on other sites

Is this good for JIP players? Like if they join after obj1 has been captured, is there anything else I need to do in order to make sure the JIP players will see that obj1 has already been completed?

Well, I told you to use two triggers for each objective, not one.

And would I need to use onPlayerConnected to get JIP players to start where ever the respawn_west marker has been moved to? And if so, how?

Or just place a trigger:

cond: local player

onact: player setpos getmarkerpos "respawn_west"

If that doesn't work (setpos expecting 3D pos instead of 2D that marker pos is) do:

onact: player setpos (getmarkerpos "respawn_west" + [0]);

Share this post


Link to post
Share on other sites

Yeah, I noticed someplace else in the forums where you again mentioned the 2 trigger system, then I figured that one trigger wasn't going to do it. I'm going to try everything you suggested now. I really appreciate the help so much. Thanks.

Share this post


Link to post
Share on other sites

I did what you said, at least I think I did what you said, but still it doesn't seem to work at all. Players that join at mission start do see the briefing and tasks and as objectives are completed they do see the objective markers on the map change in color from red to green and they also see the task showing as being completed on the tasks list. Players that join late in the mission do not see the briefing or tasks at all and the objectives that have been completed on the map show as red instead of green for the JIP players as if the objectives were never completed.

Here is an example of the two triggers for obj_2. A Player just needs to enter the 1st trigger area and the objective shows as being completed, but players that join after are not updated at all.

Trigger 1

[b]Activation:[/b] BLUFOR
Present
Once
[b]Condition:[/b] this

[b]On Act.[/b]
obj_2 = true; 
publicVariable "obj_2";  
playSound "drumroll";  
hint composeText [parsetext format["<t size='1.4' align='center' color='#6698FF'>AREA SECURED%1</t><br/><t size='1.1' align='center' color='#FFFFFF'>You can now respawn and rearm at this location%1</t>"]];

Trigger 2

[b]Activation:[/b] NONE
Present
Once
[b]Condition:[/b] obj_2

[b]On Act.[/b]
"2" objStatus "DONE";
tskobj_2 setTaskState "SUCCEEDED";
Tak_Flag1 setFlagTexture "usa.paa";
ammobox setPos (getmarkerPos "box1");
"respawn_west" setMarkerPos getMarkerPos "flag1";
"area1" setMarkerColor "ColorGreen";

I tried Mr-Murrays guide and read the stuff regarding JIP and still had no luck and started receiving errors. I stopped working on my mission for a while, which is basically all done except for the JIP problems, and basically I just feel sick that I can't get this JIP stuff working at all after all the hard working I put into the mission.

Is there a simple example mission out there that somebody can't point me in the direction of that I could examine and use as a guide?

Edited by A-SUICIDAL

Share this post


Link to post
Share on other sites

We have the same jip problem. If any one joins after the start of a mission it causes objective & task problems & prevents completion of missions.

As missions can take hours removing jip is not really an option. (i.e. people waiting hours to join)

Q. Is there a simple check alive script? That can be added to the init.sqf for example? Or some way of including/updating latecomers?

Share this post


Link to post
Share on other sites

In my case I was told in the MutiTask method won't worksadbanana.gif

...and my 2 trigger system still does not work correctly for JIP players.

---------- Post added at 07:50 AM ---------- Previous post was at 07:39 AM ----------

I just found this by Shk

http://forums.bistudio.com/showthread.php?t=86206

I hope there is an example mission there that will help me.

Share this post


Link to post
Share on other sites

Thank you so much shk, it works now. Words can't describe how thankful I am. If it wasn't for you I would have probably gave up completely.

I had everything set up the way you said, but I was using a briefing.sqs, then I noticed that you had the invisible H pad with the tasks in it - in the example mission that you posted. Once I set up the tasks like you did, everything then started working properly for JIP players, except for a few things, but I figured out a way to fix all but 1 thing. I'll explain...

There are 8 enemy bunkers that need to be captured. When a bunker is captured it then becomes our respawn area. We start the mission in cargo of a plane. The plane circles around Bunker 1 at 5000 meters up(to avoid enemy patrolling gunships that fly low). There is a Drop Zone marker near Bunker 1 that we para drop to and regroup. If we a player dies before a bunker is captured, a trigger then detects when that a player is alive again and then moves the player back into the cargo of the plane and the player has to jump again. Once 1 of the 8 objectives is captured, the triggers that move players in cargo of the plane are then deleted so they can't move in cargo of the plane ever again and players then respawn at which ever bunker was most recently captured. As bunkers are captured, the respawn area keeps moving to to that new position. All this works great except for JIP players. This is what I need to do...

I need to make it so JIP players are moved into the cargo of the plane if none of the bunkers have been captured yet. After a 1 of the 8 bunkers is captured, I need to move JIP players to the most recently captured bunker. So if we capture bunker 1, then 2, then 3 and then somebody joins the game, the JIP player would then be instantly moved to bunker 3 respawn area. Can this be done and if so how?

Edited by A-SUICIDAL

Share this post


Link to post
Share on other sites

Maybe try a different approach.

Instead of moving the respawn marker, how about you let them respawn in the same place always, but have a loop with alive player to setpos them to the correct "respawn" location. Save and update the current respawn position in a variable. Then just so, player setpos RespawnPlace. That way you can even specify if the position is still in the plane and instead of setposing, you moveincargo them.

Share this post


Link to post
Share on other sites

For example, to get player "s3" to moveInCargo as soon as he or she respawns, I used a trigger grouped (blue line)to s3, with radius 20000 (LoL), condition "alive s3", trigger set to repeatedly, with a 1 second (min,mid,max) timer and on activation "s3 moveInCargo plane1".

When one of the 8 bunkers is captured the trigger that moves s3 into cargo is then deleted. I know, it's totally ghetto. I do have other loops that run from sqf files, but I didn't know how to script the loop to get the player to moveInCargo. So I settled for the ghetto trigger.

When you said "Save and update the current respawn position in a variable", I don't exactly know how to do that. I'm a total variable noob. I learn fast though.

Here's an example of how much of a determined novice scripter I am... I just started a thread regarding my "Flip/Repair ATV" script". I don't know if the script already exists for an ATV, but I didn't copy anybody's script, as you can easily tell by looking at the novice way I threw the script together. A did ask for help improving the script and offered a sample mission.

I'll keep trying to fix the JIP players to moveInCargo and also try to get the JIP players to move to the bunkers as the bunkers are captured, but with little skills I have with variables, I don't see myself being able to figure this out anytime soon. I really don't want to remove the plane in the beginning and redesign my mission to use a HALO flagpole. Are there any missions that exist that I can download and examine that uses a script similar to what I am trying to accomplish?

Share this post


Link to post
Share on other sites
... The only thing in my init.sqs files is... execVM "briefing.sqf"; ....
I asked my friend later after we stopped playing the mission if he remembered seeing the completed objectives on the tasks list and he said that he didn't see any objectives completed at all, yet we had completed 7 of 10 objectives before he joined the game.

That method of coding your briefing is not Join in progress compatible.

Note on JIP...

Your method works fine in single player or for players who experience the briefing process. However, once the mission starts, the game engine for all players who join in progress afterward will behave differently. Basically you can count on scripting which manipulates objects or launches scripts and certain other features will not work because the player's unit is not yet initialized in game.

Use the following code to make it join in progress compatible...

//non-JIP player, someone who's went through role selection and briefing
if (!(isNull player)) then 
{
       execVM "briefing.sqf
};

//JIP player, role selection then right into mission.
if (!isServer && isNull player) then 
{
waitUntil {!isNull player}; // place code after this.

       execVM "briefing.sqf
};

//server
if (isServer) then 
{
       // server side scripts should go here.
};

This does create redundancy in your init.sqf, however you gain JIP compatibility, which negates the additional file size to your init.sqf.

Unit Inits...

Note that when player's connect to the server every unit init code you have in your editor will execute. For example, if you add 50 grenades to an ammo box, when the mission starts the create will have those 50 extra grenades. However, when for every player that JIPs, 50 more grenades will be added.

If your manipulating units with scripting in the initialization, i would encapsulate the code within a if statement to check if it is being executed on the server, so it only executes once at the start of the mission. Like follows..

if (isserver) then {// code for unit's init.  ;  more code...};

My mission was working great up until the JIP issues bit me in the $@#$&.

Believe me I understand. The support for this game is terrible. The fact that the community has to research and answer like 90% of it's questions is a real poor testimony of how poor BI supports this game. True, they provide some scripting documentation, this website, and some editing tools, but the documentation is just way to under worked and lacks the detail and indepth, and I would add organization and ease of access, to be truly effective.

Just keep at it. Your not alone. Make posts, search the forums and experiment. Also, check Armaholic and here for scripts which you might use to your advantage for features.

Try to only make missions you know you can make and can work. Its very hard to trouble shoot scripts once their in missions. Testing them isolated and alone is better. I would test your code ideas separate with friends on test maps for certain script ideas or problems your working.

Hope that helps, Good Luck.

Share this post


Link to post
Share on other sites

Do you have vehicle clearing and filling script that is compatible, by running it on server alone, in such a way that both immediate players and JIP players can grab the equipment in it? My current problem is that for immediate players, the vehicle is filled up, but the equipment can't be grabbed. For JIP players, all is (apparently) normal. If the immediate player drives the vehicle onto a reload place executing the same script, all is well.

Basically: How to get server vehicles filled up with custom equipment that everybody can use?

Share this post


Link to post
Share on other sites
Do you have vehicle clearing and filling script that is compatible, by running it on server alone, in such a way that both immediate players and JIP players can grab the equipment in it? My current problem is that for immediate players, the vehicle is filled up, but the equipment can't be grabbed. For JIP players, all is (apparently) normal. If the immediate player drives the vehicle onto a reload place executing the same script, all is well.

Basically: How to get server vehicles filled up with custom equipment that everybody can use?

I would also like to know this. Spent hours trying to solve this.

Share this post


Link to post
Share on other sites

It works great shk. Solved my problem. I replaced all my freaky triggers from my mission and copied the way you had set it up in you example mission and now my mission is working great. I still haven't had the chance to test it online with other players, but it worked online when I tested it alone. I'm going to see if I can find a friend to help test it with me now. I've got very long xfire list, so hopefully I'll find somebody to test with fast.

Share this post


Link to post
Share on other sites

It didn't work online. I need to figure out how to make it work with 10 players.

Share this post


Link to post
Share on other sites

You could probably do something in the init like

if (!(isNull player)) then 
{
respawnpos = [] execvm "respawnpos.sqf";

};

then have a file called respawnpos.sqf and in it put something like.

_unit = _this select 0;

_unit removeeventhandler "killed";

_unit addeventhandler ["killed","_this execvm 'respawnpos.sqf"] (this code is for ideas so dont hold me to how accurate the syntax is).

So you know its executed each time someone dies.

_unit setpos getmarkerpos "respawnpoint";

another way would be to have a marker on each of the bases, then use a public variable (e.g: "respawnposvariable")

then do a case switch

switch (respawnposvariable) do
{
   case base1:
   {
       _unit setpos getmarkerpos "base1";
       ...
   };

  case base2:
   {
       _unit setpos getmarkerpos "base2";
       ...
   };

   ...
};

so on and so forth, plenty of ideas to work with there.

to make sure the variable has changed then you should add a publicvariableeventhandler and make it broadcast a message like. "respawn has moved from base1 to base2".

then speak to friends when it happens to see if they received the hint as well, means to you bug test if its bieng changed for everyone or just you.

---------- Post added at 02:54 PM ---------- Previous post was at 02:53 PM ----------

Regarding the ammo issue, it seems that vehicles have a predetermined cargo amount, so you can only load so much into it. Your best bet is to have a script that clears all the weapons and adds a customloadout.

have a file called ammocrate.sqf

then have the vehicles init

null0 = this execVM "ammocrate.sqf";

in the script have

_unit = _this select 0;

if (isserver) then {

clearweaponcargo _unit;

clearmagazinecargo _unit;

_unit addweaponcargo ["railgun :) ",500];

};

this should be executed only once by the server and the ammo should be available to all.

Edited by ker8er0s

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  

×