Go Back   Novahq.net Forum > Games > Joint Operations
FAQ Community Calendar Today's Posts Search

Joint Operations Anything about the Joint Operations series of games.

Reply
 
Thread Tools Search this Thread Display Modes
  #21  
Old 07-23-2024, 11:38 AM
Oscarmike247 is offline Oscarmike247
Oscarmike247's Avatar
Registered User

Join Date: Feb 2018
Posts: 257

Unfortunately, adding new scripts to the bottom fixed the crashing, but those new scripts would not work. So, I had to resort to removing the vehicle fuel system from the map, which was the most taxing on the WAC. Unfortunate because it was cool for the style of map that I'm making. I may try to add it again later and maybe simplify it, but for now I need to make sure I have room in the WAC.

Speaking of making room, I discovered something in the WAC that I was previously unaware of. I'm curious to see if anyone else has used these before as I don't think I've ever seen them in another map...

in addition to the "then" logic, you can also use "enter" or "leave".

Then = Script actions will keep firing on every read of the WAC as long as the conditions are true.

Example: Text will repeat on screen once every second (every time the game reads the wac) for as long as the player is in area trigger 1.
Code:
If area(1) then
Text("Area 1")
endif
Enter = Script actions will fire only once when the conditions are true, then resets when the conditions are not true.

Example: Text will display once when player is in area 1, then will display again if player comes back into the area again (left area and came back).
Code:
If area(1) enter
Text("Area 1")
endif

Leave = Script actions will fire when the conditions have been met and are no longer true.

Example: Text will display if the player leaves the area after having walked into it. only triggers when the conditions are false after being true.
Code:
If area(1) leave
Text("Area 1")
endif
After discovering this, I was able to remove a lot of extra stuff in my WAC that was used to break loops.

Example: Several items in my map will display text when the player is near them, which I didn't want the text to keep repeating when the player was near the object, but I also wanted it to display every time the player was near it, so I couldn't use "Never()".

So what I did is used a variable (v7) to break the loop, then reset the variable. like this..
Code:
if ssnnearssn(player, 40, 4) and false(v7) then
set(v7, 1) //breaks loop
Text("Use this computer to buy repair parts")
endif
	if chain(1) and not ssnnearssn(player, 40, 4) then
	set(v7, 0)
	endif
That was the only way I figured to do it at the time. But now I can write it like this and get the same result without using a variable and it eliminates the extra chain script...
Code:
if ssnnearssn(player, 40, 4) enter
Text("use this computer to buy repair parts")
endif
Maybe this is something many others have been aware of. But I just discovered it, and it's quite handy.
Reply With Quote
  #22  
Old 07-23-2024, 03:44 PM
Baldo_the_Don is offline Baldo_the_Don
Baldo_the_Don's Avatar
Registered User

Join Date: Jul 2012
Posts: 550

I've never heard of the 'enter' or 'leave' (I guess they're called) logic gates. They sound immeasurably useful.

Excellent find, OM!

Something I always wished was possible as a trigger, and you might know if this exists, is when Group X is not outside of area Y. As in, if all members of Group X are in area Y. 'Cause I've seen a lot of coop maps that end when a player is in the area trigger around the extract vehicle, and I always thought it'd be better to trigger the mission end when all the players (all players, on both teams, in an MP map are in group 1, by the way) are in the area trigger, you know? Or, 'If group 1 is not outside of Area "Win."'

Ever seen something like that?
__________________
////////////////////<- SIGNATURE STARTS ->\\\\\\\\\\\\\\\\\\\\\
The NSO Deadline Mod at NovaHQ.net:
/////////////////////<- SIGNATURE ENDS ->\\\\\\\\\\\\\\\\\\\\\\
Reply With Quote
  #23  
Old 07-23-2024, 10:11 PM
Oscarmike247 is offline Oscarmike247
Oscarmike247's Avatar
Registered User

Join Date: Feb 2018
Posts: 257

Quote:
Originally Posted by Baldo_the_Don View Post
I've never heard of the 'enter' or 'leave' (I guess they're called) logic gates. They sound immeasurably useful.

Excellent find, OM!

Something I always wished was possible as a trigger, and you might know if this exists, is when Group X is not outside of area Y. As in, if all members of Group X are in area Y. 'Cause I've seen a lot of coop maps that end when a player is in the area trigger around the extract vehicle, and I always thought it'd be better to trigger the mission end when all the players (all players, on both teams, in an MP map are in group 1, by the way) are in the area trigger, you know? Or, 'If group 1 is not outside of Area "Win."'

Ever seen something like that?
I'm not aware of a way to make this work.

I played around with other possible ways by using a variable and the "humans" variable.

The idea was to set up a trigger that would increase v1 when a player steps into an area, and decrease it when they step out. So v1 should reflect the number of players in an area.

Then you can just say "If eq(v1, humans) then" and either win the game or whatever.

Problem is that the ssn triggers only seem to work on the host side, even when using ploop.

so v1 will increase to 1 if the host is in the area, and should increase each time another player walks into the area. Then when v1 is = humans (num of players) then win the game.

But it doesn't work on the client side. if you can figure out a trigger that will trigger when any player has met the condition, then this might work. I'm not too familiar with multiplayer and how these scripts work with clients tho.
Reply With Quote
  #24  
Old 07-24-2024, 08:55 PM
Baldo_the_Don is offline Baldo_the_Don
Baldo_the_Don's Avatar
Registered User

Join Date: Jul 2012
Posts: 550

Well, I imagine setting up a large area trigger north of the extraction point, a large area trigger south of the extraction point, and wide area triggers west and east of the extraction point, but still overlapping the northern and southern areas a bit, activating the 'Designated Mission Area' checkbox on all of them, and making the win event 'if group 1 is not in mission area," then that'd probably work, but it requires four area triggers covering as much of the playing field and the terrain outside of it as possible, except for the extraction point in the middle, so that the only reasonable way to get out of the designiated mission area is the extraction point. I just thought if the game had a hidden 'if group X is not outside of area y,' or just plain old, 'if all of group X in within area Y, that would streamline such a win event, and make worrying about how far some players might go yet still consider the distance a 'reasonable' way out of the mission area unneccesary.

I think the largest dimension an area trigger can have on a side is [32767][65535], and beyond that length, the area trigger would overlap itself, an idea which sits in my mind like the concept of negative molecular vibration, or dividing by zero. Cthuloid math, if you will.

I write the weirdest stuff at 0400 hours.
__________________
////////////////////<- SIGNATURE STARTS ->\\\\\\\\\\\\\\\\\\\\\
The NSO Deadline Mod at NovaHQ.net:
/////////////////////<- SIGNATURE ENDS ->\\\\\\\\\\\\\\\\\\\\\\

Last edited by Baldo_the_Don; 07-25-2024 at 12:20 PM.
Reply With Quote
  #25  
Old 07-25-2024, 12:24 AM
jabo1SFH is online now jabo1SFH
jabo1SFH's Avatar
Registered User

Join Date: Jul 2019
Location: AZ
Posts: 484

Quote:
Originally Posted by Oscarmike247 View Post
I'm not aware of a way to make this work.

I played around with other possible ways by using a variable and the "humans" variable.

The idea was to set up a trigger that would increase v1 when a player steps into an area, and decrease it when they step out. So v1 should reflect the number of players in an area.

Then you can just say "If eq(v1, humans) then" and either win the game or whatever.

Problem is that the ssn triggers only seem to work on the host side, even when using ploop.

so v1 will increase to 1 if the host is in the area, and should increase each time another player walks into the area. Then when v1 is = humans (num of players) then win the game.

But it doesn't work on the client side. if you can figure out a trigger that will trigger when any player has met the condition, then this might work. I'm not too familiar with multiplayer and how these scripts work with clients tho.


wouldnt you also need to have a counter on that situation?

something like this:


Code:
if chain(1) then inc(v1) endif



Reply With Quote
  #26  
Old 07-25-2024, 08:46 AM
Oscarmike247 is offline Oscarmike247
Oscarmike247's Avatar
Registered User

Join Date: Feb 2018
Posts: 257

Quote:
Originally Posted by jabo1SFH View Post
wouldnt you also need to have a counter on that situation?

something like this:


Code:
if chain(1) then inc(v1) endif
Well in the first script you would inc v1, then use chain to say if the first script has triggered and the condition is no longer true (player steps out of area), then decrease v1. Using the logic gate "enter" I recently discovered, this is easier to do. Here's what I had originally when trying this.

This works fine on the server side. Player walks into the area, v1 increases to 1, step out and it goes back to 0, and you can repeat it as many times as you want.

Code:
if ssnarea(player, 1) enter
inc(v1)
endif
	if chain(1) and not ssnarea(player, 1) enter
	dec(v1)
	endif

if eq(v1, humans) then
set(win, 1)
endif
However, Baldo's idea is much simpler. I tested it through a LAN session and it seems to work. Set up 4 large area triggers creating a box in the middle of them that is outside of each area where you want your map ending/extract to be. Then create a med event that says:

if group 1 is not in area 1 and
if group 1 is not in area 2 and
if group 1 is not in area 3 and
if group 1 is not in area 4
then
Win, Blue

This worked in LAN. The event was only triggered when all of blue team stepped into the box in the middle (out of all 4 boxes).

I wasn't sure if it would work, because the trigger "if group in area x" triggers if at least 1 member of that group is in the area, so I figured that the inverse logic of this trigger would be the same. As in: "if group 1 is not in area x" would trigger if any member was not in the area.

But that doesn't seem to be the case. it works great. Now as Baldo mentioned, you have to have large area triggers if you have a large map, and there is a limit to how big they can be, but remember your event will have the "AND" logic, so you can technically create at many triggers as you want to cover everything except your extraction zone. just make sure they all overlap a little bit.

Now the weird thing this is that I tried this with designated mission area. When you tick this box on the area trigger, it is supposed to invert the area so that it triggers when you are outside of the area.
I figured, "cool, I'll just set up 1 designated area around the extract zone, and then say If group 1 is not in area 1".

But I can't seem to get designated area triggers to work. with "designated mission area" ticked, it still only triggers if you're inside the box. I thought this option worked in JO? Maybe I'm thinking of DFX?
Reply With Quote
  #27  
Old 07-25-2024, 12:09 PM
Baldo_the_Don is offline Baldo_the_Don
Baldo_the_Don's Avatar
Registered User

Join Date: Jul 2012
Posts: 550

My experience is that activating the 'Designated Mission Area' checkbox on several area triggers means that the game can treat them all essentially as one area trigger, so instead of a separate 'if group 1 is not in area X' event trigger for each of the large mission areas, a single 'if group 1 is not in the designated mission area,' will do.

At least I swear I remember pulling that off in a map once.

As for inverted area triggers, if you travel in any direction far enough in a NL game, you will warp through to the other side of the map. In Comanche 4, I figured out that if a map had a single FARP, and you flew 32768m away from it and landed on any random spot on the terrain, you'd repair and rearm, so I used a trick in a map or two where I'd insert a FARP in a corner of the terrain 32km away from the play area, and you could touch down anywhere to rearm and repair.

Basically, within about 4m and outside of 32768m of the center of the FARP marker was a health and ammo area trigger.

I remember seeing warnings about area trigger marker placement at some point, something about making sure the marker with the higher SSN is northwest of, and at a higher Z than the other marker in a 3D area, and it may be that in older NL games, that placement could invert the area trigger, but I know for sure that doesn't make a difference in DFBHD.

But an inverted area trigger would be useful trick for a mapper to have.

Has anyone ever tried maybe giving an area trigger a negative number? Like 'if group 1 is in area trigger -2'?
__________________
////////////////////<- SIGNATURE STARTS ->\\\\\\\\\\\\\\\\\\\\\
The NSO Deadline Mod at NovaHQ.net:
/////////////////////<- SIGNATURE ENDS ->\\\\\\\\\\\\\\\\\\\\\\
Reply With Quote
  #28  
Old 07-25-2024, 12:41 PM
Oscarmike247 is offline Oscarmike247
Oscarmike247's Avatar
Registered User

Join Date: Feb 2018
Posts: 257

Quote:
Originally Posted by Baldo_the_Don View Post
My experience is that activating the 'Designated Mission Area' checkbox on several area triggers means that the game can treat them all essentially as one area trigger, so instead of a separate 'if group 1 is not in area X' event trigger for each of the large mission areas, a single 'if group 1 is not in the designated mission area,' will do.

At least I swear I remember pulling that off in a map once.

As for inverted area triggers, if you travel in any direction far enough in a NL game, you will warp through to the other side of the map. In Comanche 4, I figured out that if a map had a single FARP, and you flew 32768m away from it and landed on any random spot on the terrain, you'd repair and rearm, so I used a trick in a map or two where I'd insert a FARP in a corner of the terrain 32km away from the play area, and you could touch down anywhere to rearm and repair.

Basically, within about 4m and outside of 32768m of the center of the FARP marker was a health and ammo area trigger.

I remember seeing warnings about area trigger marker placement at some point, something about making sure the marker with the higher SSN is northwest of, and at a higher Z than the other marker in a 3D area, and it may be that in older NL games, that placement could invert the area trigger, but I know for sure that doesn't make a difference in DFBHD.

But an inverted area trigger would be useful trick for a mapper to have.

Has anyone ever tried maybe giving an area trigger a negative number? Like 'if group 1 is in area trigger -2'?

I guess in most cases, instead of inverting the area, you just invert the logic in the event to say if not in area x. But I could have sworn that using "designated" meant that it would trigger if the player or AI was outside of the area. Maybe I have that mistaken.

Not sure about the negative number, but I don't think it would work that way. would be interesting to try.
Reply With Quote
  #29  
Old 07-28-2024, 11:39 AM
jabo1SFH is online now jabo1SFH
jabo1SFH's Avatar
Registered User

Join Date: Jul 2019
Location: AZ
Posts: 484

ok, this is mildly off-topic but does fit since it is a discussion about wac scripting.

this example is a NILE generated wac file nesting. the problem with this is, sometimes this type of nesting can break since the map has mission critical events that must frre for the map to end.


Code:
if never() and (Never()ssndead(66600)) then //New Event
	if never() and (Previous()ssndead(66601)) then //New Event
		if never() and (Previous()ssndead(66767)) then //New Event
			if never() and (Previous()ssndead(66895)) then //New Event
				if never() and (Previous()ssndead(67011)) then //New Event
					win(1)
				endif
			endif
		endif
	endif
endif


what i have done in these situations, is to elimintate all of the nesting and just create a large single line event that requires all to happen for the map to end like this:



if never() and ssndead(66600) and ssndead(66601) and ssndead(66767) and ssndead(66895) and ssndead(67011) then
win(1)
endif

you still have mission criticals but there is less of a chance that it breaks and the map will end.


note: this is a portion of a wac file for a map in my current server rotation. i used this example because the last time i played this map, we met all the requirements but the map didnt end even though the previous time i played the same map, it did in fact end so i will look to rework the wac file to make sure the map end next time.


Reply With Quote
  #30  
Old 07-28-2024, 06:05 PM
Oscarmike247 is offline Oscarmike247
Oscarmike247's Avatar
Registered User

Join Date: Feb 2018
Posts: 257

Why would it write it like that? It seems a lot more logical to write it the way you have it.
Reply With Quote
  #31  
Old 07-29-2024, 05:18 PM
jabo1SFH is online now jabo1SFH
jabo1SFH's Avatar
Registered User

Join Date: Jul 2019
Location: AZ
Posts: 484

Quote:
Originally Posted by Oscarmike247 View Post
Why would it write it like that? It seems a lot more logical to write it the way you have it.


thats the way nile sets mission critical events. nile is also fond of using the double never() which might be the cause of some maps breaking.





Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 12:21 AM.




Powered by vBulletin®