Nanorobotic hull starting structure
Moderator: Oberlus
Nanorobotic hull starting structure
Just lost 5 nanobot ships to a Juggernaut, looked at the combat log and realised it was merely hitting them to kill. they start on zero structure and don't repait themselves until the end of the turn after they're built.
I vaguely recall that being mentioned ages back but I haven't used them for ages & I'm working through testing the robotic shield interface and they also don't kick in until the end of the first turn. Looking at the script I can't see why it's happening this way, any ideas how to fix it?
I vaguely recall that being mentioned ages back but I haven't used them for ages & I'm working through testing the robotic shield interface and they also don't kick in until the end of the first turn. Looking at the script I can't see why it's happening this way, any ideas how to fix it?
Mat Bowles
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Nanorobotic hull starting structure
It's probably due to this effectsgroup:MatGB wrote:Looking at the script I can't see why it's happening this way, any ideas how to fix it?
Code: Select all
EffectsGroup
scope = Source
activation = Source
effects = SetStructure Target.MaxStructure
To prevent that, perhaps disable that effect on the turn they're produced.
Re: Nanorobotic hull starting structure
That would make sense, so assuming it's Source.Age for that, does that start at 0 or 1?
Mat Bowles
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Nanorobotic hull starting structure
Should be 0...MatGB wrote:...does that start at 0 or 1?
Code: Select all
int UniverseObject::AgeInTurns() const {
if (m_created_on_turn == BEFORE_FIRST_TURN)
return SINCE_BEFORE_TIME_AGE;
if ((m_created_on_turn == INVALID_GAME_TURN) || (CurrentTurn() == INVALID_GAME_TURN))
return INVALID_OBJECT_AGE;
return CurrentTurn() - m_created_on_turn;
}
Re: Nanorobotic hull starting structure
Bumping this, as it needs fixing a bit more urgently.
There was a space cloud pinned down by a snowflake at my major shipyard. Nanobot hulls launched, stargate set to send them to the front line. I just loaded the savegame from earlier that I'd saved at the start of turn and was confused, reread the sitreps, and they all died in the first round of combat.
The new combat mechanics kill if you're on zero structure, even if you haven't taken a hit, so I just lost 5 expensive hulls that were in the middle of my safest areas way away from frontlines because a space cloud triggered a fight.
I recall playing around with various scripts for this, but I don't think I got any of them working, I shall try again when I've time tomorrow but if I can't, or if anyone can see a line or two of code that would fix it, it really does need fixing, it goes from "annoying bug caused by processing order" to "potentially game breaking bug for a newish player" and something that's annoyed me somewhat, even though I know exactly what the problem is.
Like I said, I can spend time trying to get it to work, but if anyone else that's a better scripter than me can just fix it that'd be awesome.
There was a space cloud pinned down by a snowflake at my major shipyard. Nanobot hulls launched, stargate set to send them to the front line. I just loaded the savegame from earlier that I'd saved at the start of turn and was confused, reread the sitreps, and they all died in the first round of combat.
The new combat mechanics kill if you're on zero structure, even if you haven't taken a hit, so I just lost 5 expensive hulls that were in the middle of my safest areas way away from frontlines because a space cloud triggered a fight.
I recall playing around with various scripts for this, but I don't think I got any of them working, I shall try again when I've time tomorrow but if I can't, or if anyone can see a line or two of code that would fix it, it really does need fixing, it goes from "annoying bug caused by processing order" to "potentially game breaking bug for a newish player" and something that's annoyed me somewhat, even though I know exactly what the problem is.
Like I said, I can spend time trying to get it to work, but if anyone else that's a better scripter than me can just fix it that'd be awesome.
Mat Bowles
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Nanorobotic hull starting structure
Try something like
Code: Select all
EffectsGroup
scope = Source
activation = Turn low = Source.CreationTurn + 1
effects = SetStructure Target.MaxStructure
Re: Nanorobotic hull starting structure
Whenever I see the code that solves a problem I've been working on for ages it looks so simply and obvious, my brain is obviously having an off month. Works fine on the nanorobotics, I'll look at applying it to the other two hulls we've had problems with and put it into the patch I've put the draft version of up already over the weekend.
Thx.
Thx.
Mat Bowles
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.
Re: Nanorobotic hull starting structure
Welcome to the world of programming. I've long lost count of how often I sat staring at some misbehaving code and just didn't see the forest for the trees. You're in good companyMatGB wrote:Whenever I see the code that solves a problem I've been working on for ages it looks so simply and obvious, my brain is obviously having an off month.
Re: Nanorobotic hull starting structure
Dyson Forests getting stealthy?Vezzra wrote:Welcome to the world of programming. I've long lost count of how often I sat staring at some misbehaving code and just didn't see the forest for the trees. You're in good company
Re: Nanorobotic hull starting structure
*checks*
Nope, didn't mess that one up like I did the snowflakes and kraken.
don't do that to me
Anyway, sorta to topic. Nanorobotic hull had activation = turn, but logistics facilitator and bioadaptive hull had activation = source. But they do effectively the same thing, and I've just tested changing it to turn for the facilitator and it works fine.
So, what's the actual difference in our nice little bespoke scripting language, if it made no difference this time when/why would it?
Code: Select all
Hull
name = "SH_TREE_BODY"
description = "SH_TREE_BODY_DESC"
speed = 0
starlaneSpeed = 0
fuel = 0
stealth = 5
don't do that to me
Anyway, sorta to topic. Nanorobotic hull had activation = turn, but logistics facilitator and bioadaptive hull had activation = source. But they do effectively the same thing, and I've just tested changing it to turn for the facilitator and it works fine.
So, what's the actual difference in our nice little bespoke scripting language, if it made no difference this time when/why would it?
Mat Bowles
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Nanorobotic hull starting structure
"activation = Source" does nothing... in the sense that the activation condition always just checks if the source object matches the condition, so that condition will always match the source object, and could be just left out.MatGB wrote:Nanorobotic hull had activation = turn, but logistics facilitator and bioadaptive hull had activation = source. But they do effectively the same thing...
So, what's the actual difference in our nice little bespoke scripting language, if it made no difference this time when/why would it?
"activation = Turn" will match the source object on any turn... so always. This is effectively the same as "activation = Source". It's also very odd and pointless, as generally one would want to specify a high or low parameter to the Turn condition to match objects only when the game turn is within the specified range, such as "Turn low = Source.CreationTurn + 1" to match the source object when the game turn is after the turn the source object was created.
Re: Nanorobotic hull starting structure
OK, so both, as written, were pointless and didn't need to be there, but turn allows for parameters that can be fairly easily defined. That makes sense.
So, in the spirit of code cleanup, is it worth going through and removing the activation = source lines in various places?
(also, I think this will be very helpful in my tutorial sitrep idea that I was working on awhileback, which is nice)
So, in the spirit of code cleanup, is it worth going through and removing the activation = source lines in various places?
(also, I think this will be very helpful in my tutorial sitrep idea that I was working on awhileback, which is nice)
Mat Bowles
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Nanorobotic hull starting structure
I have no strong opinion on the matter.MatGB wrote:So, in the spirit of code cleanup, is it worth going through and removing the activation = source lines in various places?
Re: Nanorobotic hull starting structure
In which case I'll remove it if I see it when working on other stuff but not actively chase them down as that's effort
Mat Bowles
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.