EnglishGermanFrenchRussianItalianSpanish
Log inRegister
 
How to get local variables in case of death?
Post new topic Reply to topic
View previous topic :: View next topic
Author Message
Nicoman35





Joined: 17 Nov 2005
Posts: 661 on topic
Location: Bochum, Germany
Thank you for registering your game
PostPosted: Sat, 22. Oct 11, 08:38    Post subject: How to get local variables in case of death? Reply with quote Print

Hi,
I would like to save the content of a local variable stored on a certain ship, when this ship is destroyed. Is this possible?
Bye

Back to top
View user's profile Send private message
Jack08





Joined: 25 Dec 2005
Posts: 2956 on topic
Location: Australia
Thank you for registering your game
PostPosted: Sat, 22. Oct 11, 10:13    Post subject: Re: How to get local variables in case of death? Reply with quote Print

Nicoman35 wrote:
Hi,
I would like to save the content of a local variable stored on a certain ship, when this ship is destroyed. Is this possible?
Bye


you can access the local variable from a SIGNAL_KILLED script, but once signal killed has been fired im afraid the object pointer is invalid and you cant retrive data from a non-existant object


_________________

"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire
Back to top
View user's profile Send private message
Gazz





Joined: 13 Jan 2006
Posts: 12407 on topic
Location: Bavaria
Thank you for registering your game
PostPosted: Sat, 22. Oct 11, 11:22    Post subject: Re: How to get local variables in case of death? Reply with quote Print

SIGNAL_KILLED fires before the oject is "officially" killed.
That's the whole point because you couldn't do anything about an object that doesn't exist.

It doesn't seem to be entirely reliable, though. Sometimes ships vanish without a "killed" message in the player logs.


_________________
My complete script download page. . . . . . Xai-Corp MSCI List is scripter's friend. I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
Back to top
View user's profile Send private message Visit poster's website
Jack08





Joined: 25 Dec 2005
Posts: 2956 on topic
Location: Australia
Thank you for registering your game
PostPosted: Sat, 22. Oct 11, 12:00    Post subject: Re: How to get local variables in case of death? Reply with quote Print

Gazz wrote:
SIGNAL_KILLED fires before the oject is "officially" killed.
That's the whole point because you couldn't do anything about an object that doesn't exist.

It doesn't seem to be entirely reliable, though. Sometimes ships vanish without a "killed" message in the player logs.


I thaught thats what i said?
Sorry must have worded it wrong.

But also take note that SIGNAL_KILLED is fired twice on the same obejct when a ship dies, so remember to set a local variable to true and check for it witihn the killed script if you need this signal to only fire once


_________________

"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire
Back to top
View user's profile Send private message
Nicoman35





Joined: 17 Nov 2005
Posts: 661 on topic
Location: Bochum, Germany
Thank you for registering your game
PostPosted: Mon, 24. Oct 11, 10:57    Post subject: Reply with quote Print

Ok guys, thanks for the info.

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic Reply to topic
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
Control Panel
Login Data
The time now is Sat, 18. Nov 17, 23:26

All times are GMT + 2 Hours


Board Security

Copyright © EGOSOFT 1989-2017
Powered by phpBB © 2001, 2005 phpBB Group
Template created by Avatar & BurnIt!
Debug: page generation = 0.18189 seconds, sql queries = 20