Lines 1079 - 1982 destroy the building once it's complete.
Chances are the 'transform' effect fires before, but not guaranteed.
Seen in SVN 6416, but it's still in the code.
I suggest deleting these lines.
Artificial Planet - r6423 (Source Code repository)
Moderator: Oberlus
Forum rules
Always mention the exact version of FreeOrion you are testing.
When reporting an issue regarding the AI, if possible provide the relevant AI log file and a save game file that demonstrates the issue.
Always mention the exact version of FreeOrion you are testing.
When reporting an issue regarding the AI, if possible provide the relevant AI log file and a save game file that demonstrates the issue.
Artificial Planet - r6423 (Source Code repository)
The beauty of travel is visiting foreign countries and meeting new people.
G.Khan
_______________________________________________________________________
All code provided is released under the CC-BY-SA 3.0 and GPL 2.0 or later licenses
G.Khan
_______________________________________________________________________
All code provided is released under the CC-BY-SA 3.0 and GPL 2.0 or later licenses
Re: Artificial Planet - r6423 (Source Code repository)
I take it your concern is that if the building were destroyed before the change type Effect fired, then perhaps the latter might not happen? All the building Effects get collected together before any of them execute; even if the building were destroyed before the planet type was changed that should (*edit:) not prevent the latter from happening. And we don't want to leave the planet stuck always being reset to barren making it immune to terraforming, so the building needs to be destroyed.
Did you see something happen in a game that made you think there was a problem here?
Did you see something happen in a game that made you think there was a problem here?
Last edited by Dilvish on Fri Sep 27, 2013 2:48 pm, edited 1 time in total.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0
Re: Artificial Planet - r6423 (Source Code repository)
Yes, happened to me that out of 5 artificial planets that finished in a turn 3 dissappeared.
After spendind 2k PP and 15 turns on each i was not amused...
[edit]
hmmm... I deleted the lines and see what you mean ...
I know these lines aren't new, but something made the transform effect fizzle for me 3 times.
My game is very advanced, turn 251, 90/100 systems colonized and theres like 1000 effects that fire every turn...
Maybe i can check with logging later.
[/edit]
After spendind 2k PP and 15 turns on each i was not amused...
[edit]
hmmm... I deleted the lines and see what you mean ...
I know these lines aren't new, but something made the transform effect fizzle for me 3 times.
My game is very advanced, turn 251, 90/100 systems colonized and theres like 1000 effects that fire every turn...
Maybe i can check with logging later.
[/edit]
The beauty of travel is visiting foreign countries and meeting new people.
G.Khan
_______________________________________________________________________
All code provided is released under the CC-BY-SA 3.0 and GPL 2.0 or later licenses
G.Khan
_______________________________________________________________________
All code provided is released under the CC-BY-SA 3.0 and GPL 2.0 or later licenses
Re: Artificial Planet - r6423 (Source Code repository)
This modification does the trick:
Code: Select all
BuildingType
name = "BLD_ART_PLANET"
description = "BLD_ART_PLANET_DESC"
buildcost = 2000
buildtime = 15
location = And [
Planet type = [Asteroids GasGiant]
OwnedBy TheEmpire Source.Owner
Not Contains Building "BLD_ART_PLANET"
]
effectsgroups = [
EffectsGroup
scope = Contains Source
activation = Not Planet type = Barren
effects = SetPlanetType Barren
EffectsGroup
scope = Source
activation = Planet type = Barren
effects = Destroy
]
icon = ""
The beauty of travel is visiting foreign countries and meeting new people.
G.Khan
_______________________________________________________________________
All code provided is released under the CC-BY-SA 3.0 and GPL 2.0 or later licenses
G.Khan
_______________________________________________________________________
All code provided is released under the CC-BY-SA 3.0 and GPL 2.0 or later licenses
Re: Artificial Planet - r6423 (Source Code repository)
Hmm, I suppose maybe some sanity checking is being done for each EffectsGroup, and if it can't find the Source anymore then it doesn't fire. Your solution, which effectively delays the building destruction by a turn, seems fine, but I'd like to wait for Geoff to weigh in here, about whether this could be due to sanity checking, and about the order of processing variance. If the order of processing EffectsGroups is really varying like your situation appears to indicate, then it seems to me like something we need to understand better (or at least I need to).
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13587
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Artificial Planet - r6423 (Source Code repository)
Not that I'm aware of. It might matter if the source object was referenced in the effect definition, but it doesn't appear to be in this case.Dilvish wrote:...maybe some sanity checking is being done for each EffectsGroup, and if it can't find the Source anymore then it doesn't fire.
I don't see how it would be either. TargetSets should have pointers added in order of their object id.I'd like to wait for Geoff to weigh in here, about whether this could be due to sanity checking, and about the order of processing variance.
Re: Artificial Planet - r6423 (Source Code repository)
I was under the impression that Destroy effects were always executed last regardless, so I don't see why even that would be a problem.Geoff the Medio wrote:Not that I'm aware of. It might matter if the source object was referenced in the effect definition, but it doesn't appear to be in this case.Dilvish wrote:...maybe some sanity checking is being done for each EffectsGroup, and if it can't find the Source anymore then it doesn't fire.
Warning: Antarans in dimensional portal are closer than they appear.
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13587
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Artificial Planet - r6423 (Source Code repository)
Not actually, but for the purpose of this issue, yes. The effect itself is executed whenever the processing comes to it, but executing it just adds the object to a list of ids to destroy later. The list is processed and the objects actually destroyed in a separate step.Bigjoe5 wrote:I was under the impression that Destroy effects were always executed last...