Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
hipshot

Change a thing action from another thing?

Recommended Posts

Posted (edited)

So I wanted to make it so that when I collect the green armor, another thing that has action 80 with a script attached, changes this script to something else.

 

I figure I would use https://zdoom.org/wiki/SetThingSpecial but I can't call on a string script right? Only scripts with number IDs?

 

Edit:

 

Actually I solved it with Thing_SetSpecial(200, 80, 1, 0, 0);

Too bad I can't input script names as strings there though...

Edited by hipshot

Share this post


Link to post

Ah ok, what is "ACS_NamedExecute" exactly, what should that be replaced with, that part I don't really understand. 80 is "script execute" but I don't write it just like that right?

Share this post


Link to post

ACS_NamedExecute is a variant of ACS_Execute for named scripts. If you want to execute a named script (script that has a string identifier) inside another script, you need to use ACS_NamedExecute. It doesn't exist as an action special like ACS_Execute (action 80), so it doesn't have a numeric identifier (the action special 80 does allow named scripts to run too however, see the "Usage" section of the above link).

 

SetThingSpecial can take both the name or the number of the action as an arg, so you can either write

SetThingSpecial(tid, 80, 1);

or

SetThingSpecial(tid, ACS_Execute, 1);

and they will mean the same thing. But as I previously mentioned, ACS_NamedExecute does not have a numeric identifier, so you can only write it as

SetThingSpecial(tid, ACS_NamedExecute, "MyScript");

 

Share this post


Link to post
Posted (edited)

Yea ok, I did understand what ACS_NamedExecute do, I have used it before (my question was a bit poorly phrased), I was more confused to what it was doing there. See my confusion was that while "Thing_SetSpecial(200, 80, 1, 0, 0);" was easy for my brain to grasp, I CHANGE another thing so it has THESE NEW settings, but with "SetThingSpecial(200, ACS_NamedExecute, "testX");" didn't come to me as natural, since "ACS_NamedExecute" for me is inside the acs scripter and in the regular editor actions, I don't see this name.

 

Anyway, I'm a bit on the stupider side, your thing worked well and I'm now using it, thanks.

 

Edit: I might as well paste the feature here, what I'm doing, for someone else to see/improve/copy.

 

//Lees body text and green armour.

script "dead_lee" (void)
{
	print(s:"Lee didn't make it...\n\nHis body suit tore lose..");
}

script "lees_armour" (void)
{
	SetThingSpecial(200, ACS_NamedExecute, "dead_lee2");
}

script "dead_lee2" (void)
{
	print(s:"Thanks for the suit Lee, rest in peace buddy.");
}

//end

The first part is when you use on a dead body, you collect his lost green armour on the ground, then when you use on the dead body again, the text has changed.

Edited by hipshot

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×