[SOLVED] Actor completely stops targeting

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

[SOLVED] Actor completely stops targeting

Postby TDRR » Tue May 21, 2019 2:31 am

*removed link*

I'm using ACS+DECO to control a player to do player-y stuff. It works just fine, except that it only attacks once or twice and once it's target is dead, it will NEVER target anything else, no matter what. I tried many different things to fix it, and none of them worked.

The relevant code is contained in Source/DECOBOT.acs and acscodepointers.dec. DECORATE also has a bit of relevant code but it's not exactly critical to the rest. Type in the console "addbot" to spawn the actor that has this problem. (Does not work in any IWAD or weapons mod that is not Doom, Heretic, Hexen, Chex Quest or Strife)

The main thinking code is in DECOBOT.acs though, and acscodepointers.dec is used mostly as an interface with the actor.
Last edited by TDRR on Thu May 23, 2019 5:26 pm, edited 2 times in total.
User avatar
TDRR
putting jelly on this hot dog
 
Joined: 11 Mar 2018
Location: Venezuela

Re: Actor completely stops targeting

Postby Dan_The_Noob » Tue May 21, 2019 3:28 am

what does the "YeahSeen" token do exactly? it's hard to follow

--edit--
I'm just trying to follow a line from spawn to attack... does the bot have infinite ammo or something?
Also, i couldn't get bots to spawn period so have no ingame reference.
User avatar
Dan_The_Noob
 
Joined: 07 May 2019
Twitch ID: Dan_The_Noob
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia with Vulkan support

Re: Actor completely stops targeting

Postby TDRR » Tue May 21, 2019 3:51 pm

Dan_The_Noob wrote:what does the "YeahSeen" token do exactly? it's hard to follow

--edit--
I'm just trying to follow a line from spawn to attack... does the bot have infinite ammo or something?
Also, i couldn't get bots to spawn period so have no ingame reference.


Sorry, was in a hurry yesterday so couldn't post the full instructions.

Here's some more detail: YeahSeen is a token used for basically anything but i named it like that because it originally was for checking line of sight with the target, you will see it always immediately after some codepointer, because it's an item given by those codepointers to indicate a successful script execution/jump to another "state".

You need a bot config to spawn the bots, for instance the one posted here: viewtopic.php?f=43&t=64527
Alternatively, just loading the bots in Zandronum removes the need for any bot config.
The bot's ammo is dictated by the real weapon it's carrying, internally they work like real players, not monsters, their targeting system is still almost entirely monster-like though. Which is why you can spectate them with F12 and see them actually firing their weapon exactly like a real player, animation and everything.
User avatar
TDRR
putting jelly on this hot dog
 
Joined: 11 Mar 2018
Location: Venezuela

Re: Actor completely stops targeting

Postby Dan_The_Noob » Tue May 21, 2019 10:49 pm

TDRR wrote:
Dan_The_Noob wrote:what does the "YeahSeen" token do exactly? it's hard to follow

--edit--
I'm just trying to follow a line from spawn to attack... does the bot have infinite ammo or something?
Also, i couldn't get bots to spawn period so have no ingame reference.


Sorry, was in a hurry yesterday so couldn't post the full instructions.

Here's some more detail: YeahSeen is a token used for basically anything but i named it like that because it originally was for checking line of sight with the target, you will see it always immediately after some codepointer, because it's an item given by those codepointers to indicate a successful script execution/jump to another "state".

You need a bot config to spawn the bots, for instance the one posted here: viewtopic.php?f=43&t=64527
Alternatively, just loading the bots in Zandronum removes the need for any bot config.
The bot's ammo is dictated by the real weapon it's carrying, internally they work like real players, not monsters, their targeting system is still almost entirely monster-like though. Which is why you can spectate them with F12 and see them actually firing their weapon exactly like a real player, animation and everything.


I had a bit of a look at it yesterday... my best guess is it's out of ammo and not checking?
if it operates like a player its guns would need ammo checks, i guess?
User avatar
Dan_The_Noob
 
Joined: 07 May 2019
Twitch ID: Dan_The_Noob
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia with Vulkan support

Re: Actor completely stops targeting

Postby TDRR » Wed May 22, 2019 12:39 am

Dan_The_Noob wrote:I had a bit of a look at it yesterday... my best guess is it's out of ammo and not checking?
if it operates like a player its guns would need ammo checks, i guess?


Nope, the bot is not aware of how much ammo it has. It does, however, switch to the next best weapon with ammo, which if it happens to be the fist (or some other melee weapon), then it rushes forward to it's target and furiously punches it.

The thing is, it doesn't even target anything at all after killing the first couple targets. Doesn't face them, doesn't attempt to attack and isn't even aware of their existence. I'm stumped as to why this is.
User avatar
TDRR
putting jelly on this hot dog
 
Joined: 11 Mar 2018
Location: Venezuela

Re: Actor completely stops targeting

Postby TXTX » Thu May 23, 2019 1:50 pm

Do you use A_Chase after it stops targeting? That usually handles all targeting procedures for monsters. Hexen firedemons had a similar problem with a mod of my own. If anything you could have it call A_Cleartarget which will also clear up its currrent target, past target, and heard target. Might give you a place to look at least.
User avatar
TXTX
Insane Feline, Hacking through ZScript
 
Joined: 12 Sep 2013
Location: A Hidden Location

Re: Actor completely stops targeting

Postby TDRR » Thu May 23, 2019 5:22 pm

TXTX wrote:Do you use A_Chase after it stops targeting? That usually handles all targeting procedures for monsters. Hexen firedemons had a similar problem with a mod of my own. If anything you could have it call A_Cleartarget which will also clear up its currrent target, past target, and heard target. Might give you a place to look at least.


Oh wow, it works! Thanks a lot mate, i can finally continue these bots the proper way!
User avatar
TDRR
putting jelly on this hot dog
 
Joined: 11 Mar 2018
Location: Venezuela

Re: Actor completely stops targeting

Postby Dan_The_Noob » Thu May 23, 2019 11:15 pm

TDRR wrote:
TXTX wrote:Do you use A_Chase after it stops targeting? That usually handles all targeting procedures for monsters. Hexen firedemons had a similar problem with a mod of my own. If anything you could have it call A_Cleartarget which will also clear up its currrent target, past target, and heard target. Might give you a place to look at least.


Oh wow, it works! Thanks a lot mate, i can finally continue these bots the proper way!


so... it WAS token/list related?
User avatar
Dan_The_Noob
 
Joined: 07 May 2019
Twitch ID: Dan_The_Noob
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia with Vulkan support

Re: Actor completely stops targeting

Postby TDRR » Fri May 24, 2019 1:19 am

Dan_The_Noob wrote:
TDRR wrote:
TXTX wrote:Do you use A_Chase after it stops targeting? That usually handles all targeting procedures for monsters. Hexen firedemons had a similar problem with a mod of my own. If anything you could have it call A_Cleartarget which will also clear up its currrent target, past target, and heard target. Might give you a place to look at least.


Oh wow, it works! Thanks a lot mate, i can finally continue these bots the proper way!


so... it WAS token/list related?


Actually, the bug seems to be ZDoom specific, and after testing it in Zandro (which i did above) the problem dissapeared. That's unacceptable, so i just cherry-picked the best parts for the TDBots instead of rewriting it using the DecoBot AI.
User avatar
TDRR
putting jelly on this hot dog
 
Joined: 11 Mar 2018
Location: Venezuela


Return to Scripting

Who is online

Users browsing this forum: Semrush [Bot] and 2 guests