SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & 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-17, 08:34 PM   #1
Stewy1
Girt by Sea
 
Stewy1's Avatar
 
Join Date: Mar 2015
Location: Red Route 1
Posts: 357
Downloads: 130
Uploads: 32


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-17, 08:50 PM   #2
FPSchazly
Good Hunting!
 
FPSchazly's Avatar
 
Join Date: Apr 2014
Location: Maryland
Posts: 771
Downloads: 15
Uploads: 1


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:
**Exclusive Look at Modern Naval Warfare!**
Dangerous Waters Liu Doctrine (LwAmi
Learn to play Dangerous Waters
FPSchazly is offline   Reply With Quote
Old 01-02-17, 09:22 PM   #3
Stewy1
Girt by Sea
 
Stewy1's Avatar
 
Join Date: Mar 2015
Location: Red Route 1
Posts: 357
Downloads: 130
Uploads: 32


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-17, 09:46 PM   #4
FPSchazly
Good Hunting!
 
FPSchazly's Avatar
 
Join Date: Apr 2014
Location: Maryland
Posts: 771
Downloads: 15
Uploads: 1


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:
**Exclusive Look at Modern Naval Warfare!**
Dangerous Waters Liu Doctrine (LwAmi
Learn to play Dangerous Waters
FPSchazly is offline   Reply With Quote
Old 01-02-17, 11:50 PM   #5
Stewy1
Girt by Sea
 
Stewy1's Avatar
 
Join Date: Mar 2015
Location: Red Route 1
Posts: 357
Downloads: 130
Uploads: 32


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-17, 07:25 AM   #6
p7p8
Seasoned Skipper
 
Join Date: Nov 2006
Posts: 742
Downloads: 136
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-17, 08:07 AM   #7
FPSchazly
Good Hunting!
 
FPSchazly's Avatar
 
Join Date: Apr 2014
Location: Maryland
Posts: 771
Downloads: 15
Uploads: 1


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:
**Exclusive Look at Modern Naval Warfare!**
Dangerous Waters Liu Doctrine (LwAmi
Learn to play Dangerous Waters
FPSchazly is offline   Reply With Quote
Old 01-03-17, 08:16 AM   #8
Stewy1
Girt by Sea
 
Stewy1's Avatar
 
Join Date: Mar 2015
Location: Red Route 1
Posts: 357
Downloads: 130
Uploads: 32


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-17, 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 01:32 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 1995- 2024 Subsim®
"Subsim" is a registered trademark, all rights reserved.