ACS from Decorate

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
Karnizero
Posts: 84
Joined: Fri Mar 23, 2007 9:42 am

ACS from Decorate

Post by Karnizero »

Hi all ZDoomers.

I am creating a new Total Conversion, and nearly finished, but i have a small question:

Is it possile to "execute" and ACS script from the Decorate lump itself?

For example, lets supose that we have a Decorate actor, a new Imp, so, i want to execute a ACS script each time any of those imps are killed, instead configuring each imp at the Doom Builder (i mean, TID number, action number, and script number...)

I tried to use the ACS_Execute() function, but it seems that it only works on the ACS scripting.

Any function for Decorate?

Thanks :D
User avatar
Skippy
Posts: 695
Joined: Sun Nov 20, 2005 9:57 am
Location: Belfast, NI

Post by Skippy »

You can call any ACS action special as an action function in DECORATE, including ACS_Execute, ACS_ExecuteAlways and ACS_ExecuteWithResult.

Just place it into the standard DECORATE state definition like so:

Code: Select all

Death:
    TROO I 8 ACS_ExecuteAlways(script,arg1,arg2,arg3)
    TROO J 8 A_Scream
    TROO K 6
    TROO L 6 A_NoBlocking
    TROO M -1
    stop
It's best to use ACS_ExecuteAlways as the script is guaranteed to run when called multiple times, such as when you kill two imps at the same time.
User avatar
Karnizero
Posts: 84
Joined: Fri Mar 23, 2007 9:42 am

Post by Karnizero »

Skippy wrote:You can call any ACS action special as an action function in DECORATE, including ACS_Execute, ACS_ExecuteAlways and ACS_ExecuteWithResult.

Just place it into the standard DECORATE state definition like so:

Code: Select all

Death:
    TROO I 8 ACS_ExecuteAlways(script,arg1,arg2,arg3)
    TROO J 8 A_Scream
    TROO K 6
    TROO L 6 A_NoBlocking
    TROO M -1
    stop
It's best to use ACS_ExecuteAlways as the script is guaranteed to run when called multiple times, such as when you kill two imps at the same time.
Great!, It works perfectly.

Thanks for help. :D
User avatar
Karnizero
Posts: 84
Joined: Fri Mar 23, 2007 9:42 am

Post by Karnizero »

I use this same topic for a new question:

I need to make a interactive decoration.
Each time the player "use" the decoration (like a door or switch), i need to run a ACS Script, but i dont figure what is wrong in my code:

Decorate code is:

Code: Select all

actor citizen : SwitchableDecoration 10010
{
  height 51
  radius 29
  +SOLID
  states
  {
  Spawn:
  Active:
  	CITI A 5 ACS_ExecuteAlways(255)
  	loop
  Inactive:
  	CITI A 5 ACS_ExecuteAlways(255)
  	loop
  }
}
The Active and Inactive States are the same, cause i want the actor to repeat the same action for both.


And the ACS Script is:

Code: Select all

script 255 (void) {
     print(s:"Hi citizen, i see you are new at this city...");
}
But the problem is when i "use" the actor, nothing seems to happen.

Any suggestion?

Thanks again for a noob :oops:
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

Erm... I don't believe that's how a SwitchableDecoration works. :P

AFAIK, currently there is no way to create an actor you can walk up to and "use". However you can fake it with lines or sector actions.
User avatar
Grubber
Posts: 1031
Joined: Wed Oct 15, 2003 12:19 am
Location: Czech Republic
Contact:

Post by Grubber »

You can also fake it with puzzle items.
User avatar
Karnizero
Posts: 84
Joined: Fri Mar 23, 2007 9:42 am

Post by Karnizero »

HotWax wrote:Erm... I don't believe that's how a SwitchableDecoration works. :P

AFAIK, currently there is no way to create an actor you can walk up to and "use". However you can fake it with lines or sector actions.
Ok, then i will use the "linedefs trick" :D

Thanks again for help.
Locked

Return to “Editing (Archive)”