Find out "how a script has been activated"

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
Tormentor667
Posts: 13554
Joined: Wed Jul 16, 2003 3:52 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)
Location: Germany
Contact:

Find out "how a script has been activated"

Post by Tormentor667 »

Hey friends, I have a question regarding the activation of an ACS script. If I have a line that runs a script and can be activated both by a projectile crossing the line and a player crossing the line, how can I determine in the script itself how it has been activated to do different actions?
User avatar
Kappes Buur
 
 
Posts: 4179
Joined: Thu Jul 17, 2003 12:19 am
Graphics Processor: nVidia (Legacy GZDoom)
Location: British Columbia, Canada
Contact:

Re: Find out "how a script has been activated"

Post by Kappes Buur »

User avatar
KeksDose
 
 
Posts: 596
Joined: Thu Jul 05, 2007 6:13 pm
Location: my laboratory
Contact:

Re: Find out "how a script has been activated"

Post by KeksDose »

That returns how to activate a line, not how it has been activated. I'd go with ClassifyActor, too.

Also, it seems there's no function to actually determine how a line was activated. ClassifyActor helps you determine "what" did, but it couldn't help you discern between player bumps and player uses.
User avatar
Tormentor667
Posts: 13554
Joined: Wed Jul 16, 2003 3:52 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)
Location: Germany
Contact:

Re: Find out "how a script has been activated"

Post by Tormentor667 »

KeksDose wrote:That returns how to activate a line, not how it has been activated. I'd go with ClassifyActor, too.
Also, it seems there's no function to actually determine how a line was activated. ClassifyActor helps you determine "what" did, but it couldn't help you discern between player bumps and player uses.
This is my problem. I actually need to differ between "player using a switch" or "player punching a switch" - how would I do that? ClassifyActor doesn't seem to be the solution for this case.
User avatar
kodi
 
 
Posts: 1361
Joined: Mon May 06, 2013 8:02 am

Re: Find out "how a script has been activated"

Post by kodi »

I don't recall if the player or the puff/projectile acts as the script activator in ACS, but if it's the puff/projectile you can just go if(GetActorClass(0)=="MyPunchPuff") { stuff} else {other stuff}I think
Locked

Return to “Editing (Archive)”