I don't know if this is related to other problems with subentities that occured recently, but I have encountered something very strange:
In Anarchies.oxp there is a Hacker Outpost that uses Sentinel Asteroids for its defense. For a long time I didn't get them working, because I couldn't make them behave like escorts, but have a custom AI. That part of the problem is fixed now, thanks to Ahruman introducing me to launchActions.
The Sentinel Asteroid is one of the standard asteroids in the game to which two ballturrets were added. It looks like this on the introductory screen (added with demoships.plist):
But if I press space, launch from the station and find a Sentinel Asteroid, the ballturrets are gone:
And it's not because the viewing angle is different. I looked at the asteroid from every angle. The turrets are not there.
Another strange thing: When I fire at the asteroid with full debug enabled, I see a lot of action in the log file, beams generatede and erased. But there is nothing on my screen.
The most strange thing: The Sentinel Asteroid as such was working and defending itself in 1.65 long ago (just not defending its station). Now I tested in 1.68 and the "disappearing turrets"-bug happened. Then I quit 1.68, loaded 1.65 instead and the bug happened as well. So even in 1.65 the turrets are gone now in-game, but stiill there on the demoships-screen.
Any idea on this?
subentities disappear in-game
Moderators: winston, another_commander, Getafix
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
I got it! The disappearing subentities thing is caused by the very launch_actions-method I introduced to make the Sentinel Asteroids work. Bugger!
In order to give the sentinel asteroids their custom AI I introduced the following lines in shipdata.plist:
That works. The Sentinel Asteroids are spawned as escorts and have sentinelAsteroidAI, they also react as escorts when I attack their mother, the Hacker Outpost, and go into the ATTACK-state. But they have no weapons, as their turrets are not there.
If I delete the launch_actions-lines again, the turrets return and fire, but the Sentinel Asteroids don't behave like escorts. They are spawned with escortAI, and in an instant they switch to route1patrolAI, because for some reason they don't recognize the Hacker Outpost as their mother. So I am stuck again.
If I add them to the Ooniverse with any addShips-method, they have their turrets (regardless whether the launch_actions-part is in shipdata or not), but again I can't make them interact with the Hacker Outpost and escort it.
So again I've run out of ideas.
The problem with launch_actions could be the point at which it is performed. Maybe it spawns the entity before subentities are added? I tested setup_actions and script_actions as well. The turrets are there, but these two methods don't set the AI as required.
In order to give the sentinel asteroids their custom AI I introduced the following lines in shipdata.plist:
Code: Select all
<key>launch_actions</key>
<array>
<string>setAITo: sentinelAsteroidAI.plist</string>
</array>
If I delete the launch_actions-lines again, the turrets return and fire, but the Sentinel Asteroids don't behave like escorts. They are spawned with escortAI, and in an instant they switch to route1patrolAI, because for some reason they don't recognize the Hacker Outpost as their mother. So I am stuck again.
If I add them to the Ooniverse with any addShips-method, they have their turrets (regardless whether the launch_actions-part is in shipdata or not), but again I can't make them interact with the Hacker Outpost and escort it.
So again I've run out of ideas.
The problem with launch_actions could be the point at which it is performed. Maybe it spawns the entity before subentities are added? I tested setup_actions and script_actions as well. The turrets are there, but these two methods don't set the AI as required.
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
That’s pretty weird, since launch_actions are executed well after set-up is complete – specifically, on the next frame update in which the ships’s state is STATUS_IN_FLIGHT. Well, it’s still in my to-poke-at queue.
E-mail: [email protected]