SUBSIM Radio Room Forums

SUBSIM Radio Room Forums (https://www.subsim.com/radioroom/index.php)
-   DW Mission Designers' Forum (https://www.subsim.com/radioroom/forumdisplay.php?f=191)
-   -   Mission Editor - what do == and != mean? (https://www.subsim.com/radioroom/showthread.php?t=229080)

Stewy1 01-02-17 08:34 PM

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!) :ping:

Cheers
Stew

FPSchazly 01-02-17 08:50 PM

Quote:

Originally Posted by Stewy1 (Post 2455757)
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!) :ping:

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

Stewy1 01-02-17 09:22 PM

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 :03:

Stew

FPSchazly 01-02-17 09:46 PM

Quote:

Originally Posted by Stewy1 (Post 2455763)
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 :03:

Stew

I have thoughts, but rather than guessing, could you post an example of code showing this?
Save

Stewy1 01-02-17 11:50 PM

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

http://img.photobucket.com/albums/v3...ps225iaqlt.jpg

p7p8 01-03-17 07:25 AM

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

FPSchazly 01-03-17 08:07 AM

Quote:

Originally Posted by p7p8 (Post 2455809)
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. :D 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%.

Stewy1 01-03-17 08:16 AM

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

:Kaleun_Cheers:

Delgard 04-15-17 04:36 PM

I learned something, thank-you. I am having trouble with the Editor, but I will ask in a separate thread.


All times are GMT -5. The time now is 05:24 AM.

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.