Jump to content
  • 0

for the life of me cannot get kill scripts to execute?


DarkShroom

Question

Hi

 

Has anyone got the kill scripts to work?

I have tried many ways, the way i'd prefer would be:

script "test_spawn_7777_with_death_script" (void){
	
	Thing_SpawnFacing(7777, T_IMP,0,8888);
	SetActorFlag(8888, "USEKILLSCRIPTS", TRUE);
	//SetActorFlag(8888, "INVULNERABLE", TRUE); //test this
}

script 1 KILL
{
	//TODO
	//+USEKILLSCRIPTS flag, or ForceKillScripts has been enabled in the GameInfo definition. 
	//https://zdoom.org/wiki/script_types
	print(s:"sucessfull kill script 1 executed!!!");
	if(CheckFlag(0, "ISMONSTER")){
		print(s:"killed a monster!!!");
	}
}


In my example, the way I'd like, notice the commented line, SetActorFlag(8888, "INVULNERABLE", TRUE);
I have used this to prove I have indeed successfully managed to set a flag at all (easy to check that, the imp became immortal)

However, the USEKILLSCRIPTS flag is just having no effect at all.


I tried this in my MAPINFO.txt:

gameinfo {
  ForceKillScripts = true
}


This doesn't seem to call the kill script either!

Also, and i don't want this solution, it'll fuck stuff up no doubt:
 

actor ZombieClone: ZombieMan 20003
{
  +USEKILLSCRIPTS
}


even that didn't work, so i think i have tried all options.

AS A FINAL NOTE (thanks for bearing with me)... could I set action 80 to the newly spawned thing? I wouldn't mind if the "KILL" scripts don't work, just any script. Then I'll just be able to use the TID to determine the different things that'll happen. Actually myself I am not too concerned with who or what killed the enemy just that it died and i might be able to set some thing to happen when it does.

The only forum slightly similar thing I found was:

/forum/topic/74142-the-ask-a-miscellaneous-editing-question-thread/?page=68&tab=comments#comment-1702306
however it was just one mention of it not working in some version from ages ago, so this is why I am suspicious? Is it working?

thanks, Richard


 

Share this post


Link to post

5 answers to this question

Recommended Posts

  • 0

I'm not that familiar with Killscripts, but the simplest method I use for a situation like this is to create the Thing you want to assign a script to (using action 80) in a room off to the side of the map, and then instead of using Thing_SpawnFacing, just use Thing_Move to move the Thing to the spawn spot at the right time.

 

I'm sure there's a proper ACS way of assigning action specials to Things based on TID, but the above method is very simple. 

Share this post


Link to post
  • 0

I'm a little lost by "Kill script". If it's to simply stop a script mid-execute then make a while-loop and then check every cycle of the loop if "X" = true/false and then define what happens (then the script should gracefully end).

 

If however it's a Kill script that only executes upon killing an enemy then set the script to VOID then give the enemy the script execute command (may only be possible in UDMF however).

Share this post


Link to post
  • 0

Why even bother with kill scripts? Just do SetThingSpecial on TID 8888 right after spawning it. When monsters die they automatically execute their special.

 

Inside your first script do this instead:

Thing_SpawnFacing(7777, T_IMP, 0, 8888);
Delay(1); // to ensure TID 8888 exists
SetThingSpecial(8888, ACS_Execute, 1);

Then change script 1 from KILL to (void).

Edited by Nevander

Share this post


Link to post
  • 0
3 minutes ago, Nevander said:

Just do SetThingSpecial

 

That's the one!  I knew there was an ACS line for applying an Action Special to a Thing based on its TID, but I couldn't for the life of me remember what it was!

Edited by Bauul

Share this post


Link to post
  • 0

thanks, yeah i'll set the special, i was looking for something like that but i couldn't find it either


the only thing it may be worth mentioning mind is that the "killscripts" would clearly be useful for gameplay mods, so it seems a shame it didn't work, at some point maybe i'll try to find a gameplay mod that counts score or something and see how they done it

this is a solution for me though, thanks guys

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...