Jump to content

Recommended Posts

Posted

Hey guys, cant believe this never crossed my mind before but building this mp campaign has brought it up. When using triggers to start events I am attempting to make sure a message is displayed once all aircraft are near the airfield. So I have:

 

Unitinzone(playerA,Aerodrome)      Messagetoall(blahblippityblah,60)
Unitinzone(playerB,Aerodrome)
Unitinzone(playerC,Aerodrome)
Unitinzone(playerD,Aerodrome)
Unitinzone(playerE,Aerodrome)
Unitinzone(playerF,Aerodrome)
Unitinzone(playerG,Aerodrome)
Unitinzone(playerH,Aerodrome)

 

Question is: If there are only 7 players or less will this flag go true? Does the mission not realize that there are less people playing and tailor the triggers for it?

Or is it required that all players are in this triggerzone regardless of how many are active in-game?

Posted

The game won't automatically change your conditions as that would result in unpredictable and weird behaviour. So no, if there's less than 8 players that trigger's conditions can never be satisfied.

 

You might want to experiment with the flag increment and flag decrement actions - each time a player spawns, increment a flag, and decrement it when they die (you can probably just use a pair of unit alive/unit dead switched conditions for each aircraft for this). That way you can always know how many clients are active in the mission.

 

Then, you can assign a flag for each client aircraft to indicate if it's present in the zone (and for our purposes, "does not exist" is the same as "present in the zone"). You could put that as an additional action in the alive/dead dead triggers - when the player dies/disconnects, set the flag to true (to pretend they're in the zone). When the player is alive (spawned), set the flag to false. Then have a separate trigger for each client to set their flag true when they enter the zone.

 

Finally, your actual activation will be checking to see if a) there's more than X clients in the game and b) all of the per-client flags are set.

 

So at the start of the mission, there's nobody connected, so the 'player count' flag is 0, and all the 'client in zone' flags are true. The player count check will stop the trigger from activating before anyone's in the game. Then when the first client spawns, the 'player count' flag will be incremented to 1, but that client's flag will be cleared - so it still won't activate.

 

Then if that client flies into the zone, their flag will be set, and the trigger will activate. If you want to ensure there's at least two players before it activates, you can just change the condition for that flag.

 

Hope that makes sense...

  • Like 1
Posted

If all you want to do is have the message sent whenever somoene goes in, and allow it to be anyone, just set the OR operand between the Unitinzone's.

[sIGPIC][/sIGPIC]

Daniel "EtherealN" Agorander | Даниэль "эфирныйн" Агорандер

Intel i7 2600K @ 4.4GHz, ASUS Sabertooth P67, 8GB Corsair Vengeance @ 1600MHz, ASUS GTX 560Ti DirectCU II 1GB, Samsung 830series 512GB SSD, Corsair AX850w, two BENQ screens and TM HOTAS Warthog

DCS: A-10C Warthog FAQ | DCS: P-51D FAQ | Remember to read the Forum Rules |

|
| Life of a Game Tester
Posted (edited)

Hope that makes sense...

 

Beautiful. That is perfect, I knew there was a way to think about it just organizing it in my head was confusing, but I like where this is going. If I can figure out when everything should be true false I dont see this as not being a possible solution. Thanks a lot.

 

I pose another question. Today a couple people that have been testing my semi-dynamic campaign jumped in and we did some testing on friendly airfields. I was hosting+2 clients.

At initial point aerodrome host+2 clients could refuel/rearm with US A-10 and friendly russian units at aerodrome.

At aerodrome 2 host+client 1 rearmed/refueled with russian units stationed at field. This was not our starting airfield. Client 2 received no fuel/ammo.

At aerodrome 3 host+client 1 rearmed/refueled with USA units at field. Again client 2 received no fuel/ammo.

 

After returning to starting field client 2 was able to get ammo/fuel. Does anyone know whats up here, is this a known bug or something new? We checked to make sure he was the same aircraft/same paint/same loadout/same amount of fuel/same radio settings/same position on aerodrome. But for some reason no joy.

 

Ok so I searched and found the answer, seems like a connect in progress issue.

Edited by WildFire
Found the answer to my question...
Posted

It didnt work out as hoped. Apparently a switched trigger to see if the pilot is alive/dead does work, but it doesnt register when you first start the game. And there is no way using the editor to count current clients. I figured a temporary solution of checking after the game starts but this doesnt cover join-in-progress. Im at a loss, this is really hampering an otherwise awesome campaign.

Posted

Are you sure?

 

Switched : unit alive player 1 : flag on 1, flag Inc 10,1

Switched : unit dead player 1 : flag off 1, flag dec 10,1

Switched : unit alive player 2 : flag on 2, flag Inc 10,1

Switched : unit dead player 2 : flag off 2, flag dec 10,1

Switched : player 1 in zone : flag off 1

Switched : player 1 out zone & unit alive player 1 : flag 1 on

Switched : player 2 in zone : flag off 2

Switched : player 2 out zone & unit alive player 2 : flag 2 on

Once : flag false 1, flag false 2, flag 10 > 0 : message blah

 

Not tested but I think this should work? :)

Posted

Please explain clearly what your logical dilemma is. I can't figure out exactly what you are trying to do. Suffice it to say though, the mission editor triggers provide enough logical flexibility that I'm sure you can do exactly what you want- you just need to figure out or more clearly state what you want to do!

 

But I do know for a fact that this is false:

And there is no way using the editor to count current clients.

 

Counting the number of clients and scaling the difficulty of the current mission based on the number of people flying was something I did back in the Black Shark mission editor, and that mission editor had vastly less functionality and flexibility than the A-10C mission editor.

 

I still don't understand what you are trying to do though.

Intelligent discourse can only begin with the honest admission of your own fallibility.

Member of the Virtual Tactical Air Group: http://vtacticalairgroup.com/

Lua scripts and mods:

MIssion Scripting Tools (Mist): http://forums.eagle.ru/showthread.php?t=98616

Slmod version 7.0 for DCS: World: http://forums.eagle.ru/showthread.php?t=80979

Now includes remote server administration tools for kicking, banning, loading missions, etc.

Posted

Ok, well here is what I had.


Unit1Alive>>>> Flag1Off && FlagIncrement(99,1)
Unit1Dead>>>>Flag1On  && FlagDecrement(99,1)


ZoneTrigger
Flag1On && FlagMoreThan(0) >>>>> <ACTION>

 

So when player1 is alive his flag is off then when he crosses trigger it goes on, if Player1 is not alive then his flag is already on and when others cross the zone it still gets triggered. So I have that all fuggered out.

 

The problem is when a client joins a server, it doesnt register the client or host as being alive or dead, the variable is left open. The first time you die and respawn it registers both being dead and alive however upon first entering the server it does not.

 

The solution I found was to run a simple check after mission start to see who is alive or not. Therefore I force a value to the variable and then it can be changed when a client joins. I dont know if this is the best method or what, it just seems to work so far. I'll find out when my test servers play the campaign and give me feedback, As I need it tested with 2 or more and any combination.

 

If there is a way for the variable to be filled or another check I can do by all means help me out, right now running 8 seperate triggers for each player isnt bad, but it could be nicer.

 

We REALLY need client based triggers/conditions.

Posted

The problem is when a client joins a server, it doesnt register the client or host as being alive or dead, the variable is left open. The first time you die and respawn it registers both being dead and alive however upon first entering the server it does not.

 

I am doing a similar thing but it does seem to work. I'm not entirely sure what part of this isn't working for you. Are you playing on the same machine that's hosting or is this a 'dedicated' server?

Posted

MMmm... it would probably be much easier for me to understand it if you described what you want to do verbally, without resorting to trigger "code". Thinking introspectively, I believe that's the first step I use in figuring out how to logically solve a problem- I have to fully understand the problem verbally and kinda get the whole picture in my head. So what exactly is it you want to do- put it into words, such as: "I want to play a message when someone enters in a zone, but only if... " or, "I want to spawn a number of aircraft based off of the number of people flying, but at...." etc.

 

To be honest, I've never had to use the flag increment and decrement function, but I believe I know how they work. The question is- what happens when you turn a flag that has been incremented off. Is it reset to zero?

 

Anyway, here is how I would do a census, for example:

 

Initial problem statement:

I want a flag that stores the value of the number of people currently flying.

 

"Psuedocode"

 

Looping on an interval of X seconds {

 

Turn on one specific, unique flag for each aircraft if alive

Turn off that flag if aircraft is dead

 

Counter flag = 0 (Flag off? Or do I need to decrement till flag is false?)

For each aircraft alive/dead flag that is true, increment counter flag

//Counter flag now stores value of the number of aircraft flying

//Counter flag is only updated at an interval of X seconds

}

 

Next patch, we should get the ability to set flags with Lua back (and if not, it will be easy to add it back in with slmod). Then hopefully, what I describe above becomes a lot easier.

Intelligent discourse can only begin with the honest admission of your own fallibility.

Member of the Virtual Tactical Air Group: http://vtacticalairgroup.com/

Lua scripts and mods:

MIssion Scripting Tools (Mist): http://forums.eagle.ru/showthread.php?t=98616

Slmod version 7.0 for DCS: World: http://forums.eagle.ru/showthread.php?t=80979

Now includes remote server administration tools for kicking, banning, loading missions, etc.

Posted

To reply to sleem, I am hosting but it also did not work with others hosting, and consequently we dont have, and most people dont have dedicated servers... So thats not really an option.

 

Speed, as I said triggering units for being alive/dead/inzones is not an issue. I'll narrow it down. I am trying to make it so events only occur if: 1)there are at least two people in the server, 2)Both are in the specified zone.

If there are 8 players active then 8 players need to be in the zone for activation.

 

Getting the required number isnt a problem and creating all the triggers arent a problem. The problem lies within Join-In-Progress (JIP).

When you join the server, client or host the server did not register the player or host were alive OR dead. There was a switched condition trigger to check for player alive and a separate switched condition trigger to check for player dead. Neither tripped when the mission started, and nor did the clients.

 

So to test I crashed into the ground. That registered, I got my message prompting the player dead, and separate triggers I threw in to monitor flag/condition status. So I was dead. So I jumped into another aircraft and then more of my test triggers popped up showing that the server had acknowledged I was alive. From then on all my triggers worked as planned.

 

So the problem is when you first join a server, the server does not register clients/host being dead or alive and therefore doesnt trip the switched condition triggers. A simple trigger that checks the status of each player on mission start fills those variables, the server will see then that say 4 people are alive and connected and four slots are dead. Then when someone joins slot 5 it will work. So long as the check trigger was ran first. After that it works.

 

So I think Ive found a workaround sort of, testing to follow on another host hopefully this evening, but it seems like something that should already work. A server should register that a player is alive immediately after joining, without separate triggers to do so. Right?

Posted (edited)

Oh that issue, with switched triggers- I've seen it before. The best and easiest way to solve it is to just make the trigger Switched->Time More(1) And Unit Alive/dead -> Flag On/off. It's kinda a logical dilemma otherwise. Were you alive before you were born? No? So you were dead? No, the word dead is only used to describe something that was once living but is no longer. So... similarly, there's a bit of ambiguity here. So you use Time More to solve it. Then all times considered includes only t = 0+, where t = 0 is the time of birth.

Edited by Speed

Intelligent discourse can only begin with the honest admission of your own fallibility.

Member of the Virtual Tactical Air Group: http://vtacticalairgroup.com/

Lua scripts and mods:

MIssion Scripting Tools (Mist): http://forums.eagle.ru/showthread.php?t=98616

Slmod version 7.0 for DCS: World: http://forums.eagle.ru/showthread.php?t=80979

Now includes remote server administration tools for kicking, banning, loading missions, etc.

Posted

I would put a small 50m zone in the middle of the runway. Every time someone takes off a counter would increase. Alternatively for a mission start message place zone around whole airfield.

---------------------------

e.g. 3 clients

 

SC , unit 1 in zone , increase flag 10 by 1, set flag 1 true

SC , unit 2 in zone , increase flag 10 by 1, set flag 2 true

SC , unit 3 in zone , increase flag 10 by 1, set flag 3 true

SC , unit 1 dead & flag1 true, decrease flag 10 by 1, set flag 1 false

SC , unit 2 dead & flag1 true, decrease flag 10 by 1, set flag 2 false

SC , unit 3 dead & flag1 true, decrease flag 10 by 1, set flag 3 false

 

ONCE flag 10 more than 2 , whatever action you intend // i.e. all 3 units are alive and are in OR have passed through trigger zone.

i7-7700K : 16Gb DDR4 2800 Mhz : Asus Mobo : 2TB HDD : Intel 520 SSD 240gb : RTX 2080ti: Win10 64pro : Dx10 : TrackiR4 : TM Warthog : ASUS ROG SWIFT PG348Q

Posted

Welcome to the party druid. Albeit a couple days late. lol. Thanks anyhow I know you prob didnt see all the replies. Turns out were pretty far past the initial trigger issue. Check out post #11 to see where were at. Speeds solution should work of course, and I was poking around some other threads and I had seen where you said you encountered it before, Speed. You made a post on it before and I managed to find that looking for something else yesterday. Pretty random turn of events.

 

Kind of funny seeing your post discussing the same thing I was talking about and then I laughed at the irony, that one of the very people helping me out was one of the very few people that have encountered it. Lucky. So today I have a NEW QUESTION! This have been brought up before but it just ends. Im fairly worried that Im either missing something or doing something wrong.

 

http://forums.eagle.ru/showthread.php?t=75620&highlight=coalition+bug

http://forums.eagle.ru/showthread.php?t=75618&highlight=coalition+bug

 

Last night I joined a server of 3 as a client. I instructed the host to wait to unpause until we were all in planes. That didnt work all clients showed neutral fields. despite me putting red coalition units at several airbases. They werent US but they were in our alliance. Today I'll specifically try US units just in case. But alliance didnt work. A second server last night, who I was listening in on while testing had about 5/6 players and all clients reported neutral airfields on a separate mission with the same conditions and same unpaused action. They tried again unpaused to join and that didnt work either.

 

This seems like a game stopping holy sh*@#% game breaking bug. Like did it never occur to anyone in multiplayer you might want to fly to a different base to rearm?

So its a matter of assigning values to the coalitions for each client. I am also going to experiment with creating triggers to run to see which coalition has aerodrome after game start and hopefully those variables get filled on the clients.

 

So far weve collectively figured out everything Ive had a problem with, some of the more technical issues, I like this thread! Keep it up guys, the help is most appreciated.

Posted

No worries, its just something I've used & you don't have to check if units are alive AND check trigger zones. Posted yesterday but DCS Server went down as I posted.

 

Fly to diff base to rearm worked for me in prev patches so its obviously something nerfed in the code changes for patch 09.

i7-7700K : 16Gb DDR4 2800 Mhz : Asus Mobo : 2TB HDD : Intel 520 SSD 240gb : RTX 2080ti: Win10 64pro : Dx10 : TrackiR4 : TM Warthog : ASUS ROG SWIFT PG348Q

Posted (edited)

Try ordering a ground unit to repeatedly leave the air base and then go back to it. Maybe that would fix coalition issues by resending the capture airbase event or whatever. Never seen anywhere in Lua where I can directly force a coalition assignment to an airbase, unfortunately. Doesn't mean it's not there, though.

 

On an unrelated note, rather than make a new topic, I'll just ask in here: could someone please send me a simple, working JTAC mission- just a JTAC, a group of units, and an airborne A-10 please. Even after setting task, setting frequency, setting callsign, and assigning a FAC assign group task, JTAC kept telling me no targets available. I would like to fix the "5 digit grid" problem, as I know exactly where in Lua the problem arises, but I need a simple mission to test against, and I would also like to figure out why the hell JTAC is not being a JTAC even after setting up every imaginable required option. Yes, I've never bothered to mess with JTACs in the ME, mainly due to what I perceive as significant unreliability, especially in MP.

Edited by Speed

Intelligent discourse can only begin with the honest admission of your own fallibility.

Member of the Virtual Tactical Air Group: http://vtacticalairgroup.com/

Lua scripts and mods:

MIssion Scripting Tools (Mist): http://forums.eagle.ru/showthread.php?t=98616

Slmod version 7.0 for DCS: World: http://forums.eagle.ru/showthread.php?t=80979

Now includes remote server administration tools for kicking, banning, loading missions, etc.

Posted

I've not seen that JIP issue Wildfire has described but that may be because I run a dedicated server with servman which keeps the mission paused until someone has joined.

 

I have used a predator for JTAC (or AFAC to be more precise I guess) and it works to a degree. It gives the nine line but does not send tasking.

 

Would you like a JTAC or AFAC mission then, Speed? My ground JTACs never seemed to work so well, possibly because of line of sight issues

Posted

Druid the only problem with that is that any two units would trigger the trigger. Different conditions than mine, I expect that if there are 6 units in game then 6 units need to be in that trigger to activate, however if there are less than less needed. Basically the entire system is variable.

 

A big thanks to speed for the help and nomedplume(spelling?) for his ingenious method which is currently working beautifully.

Speed here is a mission I planned on releasing just move the a-10 to the air and you have it, like 9 different fac and you can choose each in a different order and they all work. However never finished the order but if you only need one or a couple just delete whatever you dont need. Just make sure you keep the first facs which are alway part of the waypoint main group.

 

It has an attempt at a busy airport with a triggered pattern stacking for AI, based off of the AI, so completely automated. It took 45 minutes for all the aircraft to land, so it was thrown out as ridiculous, frivolous, and unrealistic as you can sneak into the pattern and no one is going to wait for 45 minutes to land. Otherwise a cool sp mission, once I get the order worked out. Its my afghaniland mission, rocketing troops on hills 100% CAS.

 

 

As far as the answer for my question, its a good idea, ill try moving the unit in and out of aerodrome to see if that works, its an idea, thanks. Anyone know what the distance is? Im sure its in the manual tho..

SwordandShield.miz

Posted (edited)

And sleem if you really want to test what Im talking about make a simple mp mission with 2 players. Put them on the ramp. create these triggers:

SC   >>>>    UnitAlive(Client1)               >>>>    FlagOn(1)
SC   >>>>    UnitAlive(Client2)               >>>>    FlagON(2)
SC   >>>>    UnitDead(Client1)                >>>>    FlagOff(1)
SC   >>>>    UnitDead(Client2)                >>>>    FlagOff(2)

SC   >>>>    TimeIsMore(5)   
            FlagOn(1)
            OR                               >>>>    MesageToAll(Unit is alive)
            TimeIsMore(5)
            FlagOn(2)
 
SC   >>>>    TimeIsMore(10)  
            FlagOff(1)
            OR                              >>>>    MesageToAll(Unit is dead)
            TimeIsMore(10)
            FlagOff(2)

Separate the times and only set display messages for 4 seconds so that they dont overwrite each other and you miss them.

When the server starts after a few seconds the second message should be active as it never checks for alive units at mission start. If it had seen alive units at mission start the flags 1 or 2 would be on and the first message would display. If you only receive the second then it didnt work.

 

You may then kill yourself or blow yourself up and see the flags trip and work, as when you die the first time it will work from then on. Also if you check the alive/dead condition at any time after server start it will work.

Edited by WildFire
Posted

I've finally realised what you mean. Doh!

 

On my server as soon as someone joins, as a spectator, the mission is unpaused. So the 'logic' is already running when a player enters an aircraft and the unit alive is triggered.

Posted

Yeah after I wrote the info I realized that a dedi would do exactly that. In that case a server exists and a game exists before the player does. So the player gets there after and the game is running and can do logic.

In a non dedicated server the host exists before the game, and the logic comes after. So it never has a chance to occur.

 

Looks like Speeds idea for the coalition is going to work. Hopefully. But having all units outside didnt work. I actually had to place a unit in the aerodrome. I used a Georgian (enemy) AK soldier. When the mission starts I have a MG Humvee drive in and capture the airfield. But if the AK soldier wasnt there, I can place the humvee over 10,000 meters away and because the airbase is neutral when the game starts the CoalitionHasAerodrome(Red,Maykop) still triggers and my units show up immediately. Weird.

Posted

The enemy on airfield then switching the aerodrome worked in MP testing. Looks like the general rule is you want something checked at mission start you have to manually fill the variable by either forcing a change to it or causing it to change states.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...