ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
CTD when deleting mutant

Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  19:30:50  16 August 2014
profilee-mailreply Message URLTo the Top
SacriPan
Senior Resident
 

 
On forum: 09/20/2009
 

Message edited by:
SacriPan
08/16/2014 19:32:38
Messages: 319
CTD when deleting mutant

Hi guys,

I have a problem when I try to delete a mutant.

For my mod, I create mutants which go from camp to camp.
Due to a save problem with the game (see "https://www.gsc-game.com/index.php?t=community&s=forums&s_game_type=xr&thm_page=1&thm_id=22361&page=5&sec_id=16"), I have to delete the existing mutants and create new ones to replace them, and then apply to them the new logic that will make them go to their new camp.

The thing is that I get a CTD when I delete a mutant and the log is empty.
Here is the code:
for row_old_mutants_ids, mutant_id in pairs (f_old_mutants_ids) do
	alife():release( alife():object(mutant_id), true )
end

Sometimes it works for 2 or 3 "deletion process" in a row, but after a (very short) while, it CTD.

The IDs are valid, as they are from mutants still alive, and they are stored in a simple table (f_old_mutants_ids) with no other data?

Any idea?
  02:53:21  17 August 2014
profilee-mailreply Message URLTo the Top
Stalkerstein
Senior Resident
 

 
On forum: 04/24/2010
 

Message edited by:
Stalkerstein
08/17/2014 2:53:52
Messages: 1975
I don't know LUA but maybe test each object that is exits before trying to delete it.
  03:26:14  17 August 2014
profilee-mailreply Message URLTo the Top
SacriPan
Senior Resident
 

 
On forum: 09/20/2009
Messages: 319
I did that.
And usually there's a log when you try to access a nil object.
Here, I got nothing
  13:49:48  19 August 2014
profilee-mailreply Message URLTo the Top
ThunderFreak
Senior Resident
 

 
On forum: 08/07/2009
Messages: 685
Hi Sacripan.

I think to release mutants it's the same like it is with the anomalies.
You need to let them "rest" for about 12 ingame hours before remove.
Your description how the game ctd's after 2 or 3 releases is exactly the same like i had with my dynamic anomaly sys.
  20:05:51  19 August 2014
profilee-mailreply Message URLTo the Top
SacriPan
Senior Resident
 

 
On forum: 09/20/2009
 

Message edited by:
SacriPan
08/19/2014 20:26:15
Messages: 319
Hi Thunderfreak!

Long time no see

Well, I myself wrote a script to spawn and delete anomalies so the game would have more randomness in it.

I used the alife():release() function as well and didn't have any trouble whatsoever.

For my mutants (vanilla ones for now, vanilla config as well), I used the same method as for my anomalies and NPC and sometimes it CTD.

I found a quick workaround which would confirm what you said, as deleting mutants 5 in-game minutes after turning them offline would not CTD (offline because I spawn new ones to replace them, so the player MUST not see these ones).
I did a test with 4 minutes, and it CTD pretty quickly.
I recently set it to 30 in-game minutes, just to be sure .

Please note that I'm not talking 5 minutes after they spawned, but 5 minutes after I turned them offline.

When you say "rest", in what state do you put your anomalies? you mean offline, or something else?


So, more or less, I came to the same conclusion as you did but what's strange is, like I said, I didn't encounter this problem with NPC and anomalies.
  20:51:39  19 August 2014
profilee-mailreply Message URLTo the Top
ThunderFreak
Senior Resident
 

 
On forum: 08/07/2009
Messages: 685
With "rest" I meant what already found out. It means switch them offline and leave them untouched for a couple of minutes. For anomalies it is 12h ingame.
... and yes, long time not seen. I am more in CoP modding currently.
  21:55:59  19 August 2014
profilee-mailreply Message URLTo the Top
SacriPan
Senior Resident
 

 
On forum: 09/20/2009
Messages: 319
Ok thanks.

Well anomalies don't bug for me, at least when I wrote the script and tested it out.

I will make more tests to rule this CTD out.


TY
  21:20:41  23 September 2014
profilee-mailreply Message URLTo the Top
SacriPan
Senior Resident
 

 
On forum: 09/20/2009
 

Message edited by:
SacriPan
09/23/2014 21:43:37
Messages: 319
Hi Thunderfreak,

Now, I do have the problem with anomalies...

May I ask you: Which function do you use to turn anomalies offline?

I tried "sObj:move_offline(true)" but the anomaly doesn't go offline, and the usual function is not working either:
sObj:can_switch_online(false)
sim:set_switch_online(sObj.id, false)
sim:set_switch_offline(sObj.id, true)

Thanks
  21:08:13  7 October 2014
profilee-mailreply Message URLTo the Top
ThunderFreak
Senior Resident
 

 
On forum: 08/07/2009
Messages: 685
Sorry to get back to you not earlier, but this is how I set the anomalies offline.
function change_anomaly_status(obj,id,status)
	switch_online(id)
	local l_obj = level.object_by_id(id)
	if l_obj ~= nil then 
		l_obj:disable_anomaly()
	end
	set_anomaly_status(obj,status)
	switch_offline(id)
end

 
Each word should be at least 3 characters long.
Search:    
Search conditions:    - spaces as AND    - spaces as OR   
 
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
 

All short dates are in Month-Day-Year format.


 

Copyright © 1995-2021 GSC Game World. All rights reserved.
This site is best viewed in Internet Explorer 4.xx and up and Javascript enabled. Webmaster.
Opera Software products are not supported.
If any problem concerning the site functioning under Opera Software appears apply
to Opera Software technical support service.