Author Topic: Ship Health at 100 = bonus goal  (Read 4124 times)

0 Members and 1 Guest are viewing this topic.

Offline 0rph3u5

  • 211
  • Oceans rise. Empires fall.
Re: Ship Health at 100 = bonus goal
That's no varibale. /obiwan
It is indeed an operator which can replace any data-field for numbers.

Here is how you find it:
"As you sought to steal a kingdom for yourself, so must you do again, a thousand times over. For a theft, a true theft, must be practiced to be earned." - The terms of Nyrissa's curse, Pathfinder: Kingmaker

==================

"I am Curiosity, and I've always wondered what would become of you, here at the end of the world." - The Guide/The Curious Other, Othercide

"When you work with water, you have to know and respect it. When you labour to subdue it, you have to understand that one day it may rise up and turn all your labours into nothing. For what is water, which seeks to make all things level, which has no taste or colour of its own, but a liquid form of Nothing?" - Graham Swift, Waterland

"...because they are not Dragons."

 
Re: Ship Health at 100 = bonus goal
And now we are at the bottom of my problem:

"insert operator" stays grey, can't use it. It cannot replace my data-field.

[attachment deleted by admin]

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Ship Health at 100 = bonus goal
What the christ

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Ship Health at 100 = bonus goal
Okay right can you use Replace Data to do the same thing?

 
Re: Ship Health at 100 = bonus goal
What do you mean?

I can go to "Replace data" and get this (look at attachment).

Do I have to create a string with <variable name = hits-left> and "default value" = 100 ? And insert this?



[attachment deleted by admin]

  

Offline 0rph3u5

  • 211
  • Oceans rise. Empires fall.
Re: Ship Health at 100 = bonus goal
Can you go and check (via "Modify Variable" in the menu) if your variable is set to be the variable type "Number"? (Picture below, top left)


If it is set to "String" you can not modify the variable with anything that isn't a Sting*; if you have to change that you have to make sure no event is referencing it before you make the change, otherwise FRED wont let you.

* Number = any number the engine can provide or read; Sting = the same but with text - String and Number are however multually exclusive even if the you can input a number in a String-variable or -data-field
« Last Edit: October 14, 2016, 10:53:38 am by 0rph3u5 »
"As you sought to steal a kingdom for yourself, so must you do again, a thousand times over. For a theft, a true theft, must be practiced to be earned." - The terms of Nyrissa's curse, Pathfinder: Kingmaker

==================

"I am Curiosity, and I've always wondered what would become of you, here at the end of the world." - The Guide/The Curious Other, Othercide

"When you work with water, you have to know and respect it. When you labour to subdue it, you have to understand that one day it may rise up and turn all your labours into nothing. For what is water, which seeks to make all things level, which has no taste or colour of its own, but a liquid form of Nothing?" - Graham Swift, Waterland

"...because they are not Dragons."

 
Re: Ship Health at 100 = bonus goal
Yes it (aka ShipHPper100)  is set string at the moment. Is that the problem? shall I delete it and make a new variable with "number" ?

EDIT: I looked after it and tried it (look at attachment). You were right, now I could replace the second variable via "replace operator"

[attachment deleted by admin]
« Last Edit: October 14, 2016, 11:01:40 am by bomb3rman »

 

Offline 0rph3u5

  • 211
  • Oceans rise. Empires fall.
Re: Ship Health at 100 = bonus goal
Yes it (aka ShipHPper100)  is set string at the moment. Is that the problem? shall I delete it and make a new variable with "number" ?

The Coders may correct me on this but the engine treats String and Number variables differently and categorically so.

A "Number" variable can replace any data of any SEXP that calls for a numerical value (e.g. the number of seconds for delay in "are-waypoints-done-delay") and using "modify-variable" only numerical data can be put in it. That numerical data includes all operators which return numerical data (e.g. "hits-left").

A "String" variable can replace any data of any SEXP that calls for non-numerical data to be input (e.g. the name of a ship in "has-departed-delay"). Any sequence of symbols can be input in it and using "modify-variable" can change it to any sequence of symbols. However even if that sequence is a number the engine will not accept it as numerical input or allow its value to be replaced with an operator.
"As you sought to steal a kingdom for yourself, so must you do again, a thousand times over. For a theft, a true theft, must be practiced to be earned." - The terms of Nyrissa's curse, Pathfinder: Kingmaker

==================

"I am Curiosity, and I've always wondered what would become of you, here at the end of the world." - The Guide/The Curious Other, Othercide

"When you work with water, you have to know and respect it. When you labour to subdue it, you have to understand that one day it may rise up and turn all your labours into nothing. For what is water, which seeks to make all things level, which has no taste or colour of its own, but a liquid form of Nothing?" - Graham Swift, Waterland

"...because they are not Dragons."

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Ship Health at 100 = bonus goal
Oh, right, that makes sense.

 
Re: Ship Health at 100 = bonus goal
Yes it does and also already answered my next questions about Numbers and Strings  :D

By the way now I tested the mission and it's working. Ship Hull 100 = Bonus goal, Ship hull below 100 = nothing.

So thanks to everyone, I really learned something today!

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Ship Health at 100 = bonus goal
EDIT: Silly question, but is it an oversight on my part that Trigger Count does not match the Repeat Count in this case? - I am always on the fence about that...

Repeat Count and Trigger Count are independent of each other but both use the value set in the Interval Time. In this case there would be no reason to set both and it would have no effect whatsoever.

Repeat Count works like this. After the first time the event becomes true the game then waits Interval Time and then checks again. If the result is true, it triggers again. Either way it then waits Interval Time again before testing.

Trigger Count on the other had waits Interval Time before checking again and then check every single frame until the event is true again.

The difference becomes clear if we have something like this.

when
- >
-- Distance
---Ship A
---Ship B
-- 400

If you have an interval time of 60 seconds then which one you set becomes very important. Trigger Count is probably the one you'd want. After the event occurs the first time the game waits 60 seconds and then triggers again the next time the two ships are close enough. If you instead used a repeat count the game would check the distance between the two ships every minute on the minute. You could actually have Ship A fly within 400m of Ship B at 1:30 and as long as it then moves away again before 2 minutes the event wouldn't repeat.


You can even set both repeat and trigger count. If we set the repeat to 5 and trigger to 2 for the above event you'd set up a situation where the game would check every minute on the minute if the ships are close together and trigger twice before stopping.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline 0rph3u5

  • 211
  • Oceans rise. Empires fall.
Re: Ship Health at 100 = bonus goal
Repeat Count and Trigger Count are independent of each other but both use the value set in the Interval Time. In this case there would be no reason to set both and it would have no effect whatsoever.

Repeat Count works like this. After the first time the event becomes true the game then waits Interval Time and then checks again. If the result is true, it triggers again. Either way it then waits Interval Time again before testing.

Trigger Count on the other had waits Interval Time before checking again and then check every single frame until the event is true again.

Thanks, that clears up on the misconceptions I had since forever... (bookmarking this for future reference)
"As you sought to steal a kingdom for yourself, so must you do again, a thousand times over. For a theft, a true theft, must be practiced to be earned." - The terms of Nyrissa's curse, Pathfinder: Kingmaker

==================

"I am Curiosity, and I've always wondered what would become of you, here at the end of the world." - The Guide/The Curious Other, Othercide

"When you work with water, you have to know and respect it. When you labour to subdue it, you have to understand that one day it may rise up and turn all your labours into nothing. For what is water, which seeks to make all things level, which has no taste or colour of its own, but a liquid form of Nothing?" - Graham Swift, Waterland

"...because they are not Dragons."

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Ship Health at 100 = bonus goal
When you have a 1 second interval time, for the most part it's hard to tell the difference between the two. It's only when you have a longer interval and you are testing something like distance which may flip between true and false during the interval that it becomes really noticeable.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline potterman28wxcv

  • 27
  • Just a fan player
Re: Ship Health at 100 = bonus goal
A bonus goal that can be messed up with a single collision from your allies :doubt:

 
Re: Ship Health at 100 = bonus goal
Well maybe, you might have a point... Hmm I could switch to "more than 98 HP" to avoid that. Though in all my testings it didn't happen once. But I keep that in mind, thx!