SUBSIM Radio Room Forums


SUBSIM: The Web's #1 BBS for all submarine and naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Modern-Era Subsims > Dangerous Waters > DW Mod Workshop > DW Mission Designers' Forum
Forget password? Reset here

Reply
 
Thread Tools Search this Thread Display Modes
Old 01-02-2017, 07:34 PM   #1
Stewy1
Girt by Sea
 
Stewy1's Avatar
 
Join Date: Mar 2015
Posts: 207
Downloads: 79
Uploads: 8
Default Mission Editor - what do == and != mean?

Hi guys,

This is probably a simple maths/math question - for the triggers for say, damaging a ship by percentage, what do == and ! mean? I have < and > sorted (the crocodile eats the bigger number - thanks primary school!)

Cheers
Stew
Stewy1 is offline   Reply With Quote
Old 01-02-2017, 07:50 PM   #2
FPSchazly
Good Hunting!
 
FPSchazly's Avatar
 
Join Date: Apr 2014
Location: Maryland
Posts: 668
Downloads: 7
Uploads: 0


Default

Quote:
Originally Posted by Stewy1 View Post
Hi guys,

This is probably a simple maths/math question - for the triggers for say, damaging a ship by percentage, what do == and ! mean? I have < and > sorted (the crocodile eats the bigger number - thanks primary school!)

Cheers
Stew
a == b means "is a equivalent to b?" (not to be confused with a signal = which signifies setting a variable's value or state)

5 == 5 returns true, 5 == 4 returns false

a ! b means "is a not b?" So, any two different values will return true, identical values will return false.

Hope that helps.
Save
__________________
Your friendly neighborhood modern submarine YouTuber!

My videos:
Dangerous Waters Liu Doctrine (LwAmi)
688(I) Hunter/Killer
Cold Waters South China Sea
FPSchazly is offline   Reply With Quote
Old 01-02-2017, 08:22 PM   #3
Stewy1
Girt by Sea
 
Stewy1's Avatar
 
Join Date: Mar 2015
Posts: 207
Downloads: 79
Uploads: 8
Default

Thanks Chazly for the helpful and speedy reply.

So, just to clarify, in my trigger - I can set it to damage the 'enemy ship' to an equivalent of 50% (==). Do you know what that means in the context of the what the trigger will do?

Also, what does != mean in the context of damaging a ship in a trigger? Sorry, that was a typo on the original post

Stew
Stewy1 is offline   Reply With Quote
Old 01-02-2017, 08:46 PM   #4
FPSchazly
Good Hunting!
 
FPSchazly's Avatar
 
Join Date: Apr 2014
Location: Maryland
Posts: 668
Downloads: 7
Uploads: 0


Default

Quote:
Originally Posted by Stewy1 View Post
Thanks Chazly for the helpful and speedy reply.

So, just to clarify, in my trigger - I can set it to damage the 'enemy ship' to an equivalent of 50% (==). Do you know what that means in the context of the what the trigger will do?

Also, what does != mean in the context of damaging a ship in a trigger? Sorry, that was a typo on the original post

Stew
I have thoughts, but rather than guessing, could you post an example of code showing this?
Save
__________________
Your friendly neighborhood modern submarine YouTuber!

My videos:
Dangerous Waters Liu Doctrine (LwAmi)
688(I) Hunter/Killer
Cold Waters South China Sea
FPSchazly is offline   Reply With Quote
Old 01-02-2017, 10:50 PM   #5
Stewy1
Girt by Sea
 
Stewy1's Avatar
 
Join Date: Mar 2015
Posts: 207
Downloads: 79
Uploads: 8
Default

Thanks Chazly, here is a screen cap - you can see the options in the top right of the picture

Stewy1 is offline   Reply With Quote
Old 01-03-2017, 06:25 AM   #6
p7p8
Commodore
 
Join Date: Nov 2006
Posts: 614
Downloads: 120
Uploads: 6


Default

Using < or > is much safer in DW editor than == because it gives you wider range for success.

Example:

If you want to send message (S.O.S. - my ship is sinking!) when CVG have half or less health with code:
Code:
If "platform damage" CVG 16 == 50% then
and your opponent hit CVG 16 two times for 36% - trigger sometimes can't be launch because 36+36=72
72 > 50 but not equal exactly 50

So better version of this trigger is:
Code:
If "platform damage" CVG 16 > 50% then
< or > are also better to time event activation
p7p8 is offline   Reply With Quote
Old 01-03-2017, 07:07 AM   #7
FPSchazly
Good Hunting!
 
FPSchazly's Avatar
 
Join Date: Apr 2014
Location: Maryland
Posts: 668
Downloads: 7
Uploads: 0


Default

Quote:
Originally Posted by p7p8 View Post
Using < or > is much safer in DW editor than == because it gives you wider range for success.

Example:

If you want to send message (S.O.S. - my ship is sinking!) when CVG have half or less health with code:
Code:
If "platform damage" CVG 16 == 50% then
and your opponent hit CVG 16 two times for 36% - trigger sometimes can't be launch because 36+36=72
72 > 50 but not equal exactly 50

So better version of this trigger is:
Code:
If "platform damage" CVG 16 > 50% then
< or > are also better to time event activation
I concur. I think < and > are sufficient for these purposes, == is too specific and is unlikely to be true. You could have, for example, damage != 100 % to say that "if it's not 100% damaged, do this" but you could accomplish that just as easily with damage < 100%.
__________________
Your friendly neighborhood modern submarine YouTuber!

My videos:
Dangerous Waters Liu Doctrine (LwAmi)
688(I) Hunter/Killer
Cold Waters South China Sea
FPSchazly is offline   Reply With Quote
Old 01-03-2017, 07:16 AM   #8
Stewy1
Girt by Sea
 
Stewy1's Avatar
 
Join Date: Mar 2015
Posts: 207
Downloads: 79
Uploads: 8
Default

Thanks for your help, guys - no wonder == and != aren't taught in primary school math/maths...

Stewy1 is offline   Reply With Quote
Old 04-15-2017, 04:36 PM   #9
Delgard
Skipper
 
Delgard's Avatar
 
Join Date: Oct 2004
Location: AZ & DC
Posts: 487
Downloads: 48
Uploads: 0
Default

I learned something, thank-you. I am having trouble with the Editor, but I will ask in a separate thread.
Delgard is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 08:03 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright © 1995- 2020 Subsim