CallACS/ACS_NamedExecuteWithResult can't be used on refs

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
User avatar
Marrub
 
 
Posts: 1193
Joined: Tue Feb 26, 2013 2:48 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Arch Linux
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Contact:

CallACS/ACS_NamedExecuteWithResult can't be used on refs

Post by Marrub »

Due to ACS_NamedExecuteWithResult and CallACS both being expressions, this is malformed code:

Code: Select all

let mo = Spawn("thing");
mo.CallACS("DoAThing");
While other ACS script call functions work fine, this one is arguably the most useful and not being able to use it on actor references is really annoying.
User avatar
Marrub
 
 
Posts: 1193
Joined: Tue Feb 26, 2013 2:48 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Arch Linux
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Contact:

Re: CallACS/ACS_NamedExecuteWithResult can't be used on refs

Post by Marrub »

Terribly sorry for the bump but this actually causes more issues for me than I thought. It's really difficult not being able to get a result value from ACS on a specific actor, having to rely on where the CallACS function actually gets called from.
User avatar
gwHero
Posts: 360
Joined: Mon May 08, 2017 3:23 am
Graphics Processor: Intel with Vulkan/Metal Support
Location: The Netherlands

Re: CallACS/ACS_NamedExecuteWithResult can't be used on refs

Post by gwHero »

CallACS is not static. So you can call CallACS from inside a function in your class. Wouldn't that be sufficient as a bypass?
User avatar
Xaser
 
 
Posts: 10772
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: CallACS/ACS_NamedExecuteWithResult can't be used on refs

Post by Xaser »

Not if he's trying to run CallACS on an actor of a non-custom class (e.g. a DoomImp, or just some arbitrary Actor). It isn't a universal workaround.
User avatar
Marrub
 
 
Posts: 1193
Joined: Tue Feb 26, 2013 2:48 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Arch Linux
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Contact:

Re: CallACS/ACS_NamedExecuteWithResult can't be used on refs

Post by Marrub »

Xaser wrote:Not if he's trying to run CallACS on an actor of a non-custom class (e.g. a DoomImp, or just some arbitrary Actor). It isn't a universal workaround.
Yeah, this is exactly the issue, besides which it's kind of horrifying that such a basic function that should work as intended simply doesn't...
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Re: CallACS/ACS_NamedExecuteWithResult can't be used on refs

Post by Matt »

I second this. It just doesn't make any sense why this function of all functions would have such an unusual limitation.

Unless there's some other way to call ACS scripts (like how you have to rename "return state" to "resturn resolvestate")...?
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: CallACS/ACS_NamedExecuteWithResult can't be used on refs

Post by _mental_ »

Because they are not functions in usual meaning but sort of compiler intrinsics.
Played a bit with related code just after this was reported and gave up fixing it.
User avatar
Marrub
 
 
Posts: 1193
Joined: Tue Feb 26, 2013 2:48 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Arch Linux
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Contact:

Re: CallACS/ACS_NamedExecuteWithResult can't be used on refs

Post by Marrub »

_mental_ wrote:Because they are not functions in usual meaning but sort of compiler intrinsics.
Played a bit with related code just after this was reported and gave up fixing it.
Yeah, they're built like expressions, same as functions like Random, which makes it really difficult to detangle. The easiest solution I can think of is just adding a function where ACS_NamedExecuteWithResult would normally be, with a different name, like ACS_ScriptCall or something... which is, er, troubling, in a lot of ways. I can't really think of any way to do it besides that.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: CallACS/ACS_NamedExecuteWithResult can't be used on refs

Post by _mental_ »

I was thinking about the same. Here is what we will have
  • New function needs to be added to Actor class. It will invoke CallACS on self implicitly
  • Actor.ACS_NamedExecuteWithResult is unusable because "intrinsic" with the same name is handled before method resolution. It needs to be renamed in order to become accessible
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49066
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: CallACS/ACS_NamedExecuteWithResult can't be used on refs

Post by Graf Zahl »

This is the result of some old DECORATE hack, unfortunately the only solution is to make a differently-named real function that calls the same code.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: CallACS/ACS_NamedExecuteWithResult can't be used on refs

Post by _mental_ »

In this case the best thing we can do is renaming of Actor.ACS_NamedExecuteWithResult to expose it as a proper method. I think ACS_ScriptCall is suitable for that.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49066
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: CallACS/ACS_NamedExecuteWithResult can't be used on refs

Post by Graf Zahl »

Agreed.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: CallACS/ACS_NamedExecuteWithResult can't be used on refs

Post by _mental_ »

Fixed in 1679065.
User avatar
Marrub
 
 
Posts: 1193
Joined: Tue Feb 26, 2013 2:48 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Arch Linux
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Contact:

Re: CallACS/ACS_NamedExecuteWithResult can't be used on refs

Post by Marrub »

_mental_ wrote:Fixed in 1679065.
Wait, this introduces a huge issue, you can't use ACS_NamedExecuteWithResult in state parameters anymore! You need to add a new function, not rename it.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: CallACS/ACS_NamedExecuteWithResult can't be used on refs

Post by _mental_ »

Are you sure? I cannot check at the moment but IIRC the renamed function didn’t have any effect. ACS_NamedExecuteWithResult() is handled here and it’s excluded from name resolution in a few other places.
Post Reply

Return to “Closed Bugs [GZDoom]”