Page 1 of 1

How does a voodoo doll know which player to follow?

Posted: Fri May 13, 2022 8:54 pm
by Matt
It clearly doesn't have a working player pointer and players[x].mo wouldn't point to it, so where would this info be stored?

Re: How does a voodoo doll know which player to follow?

Posted: Sat May 14, 2022 7:57 pm
by 7Soul
Maybe this has the answer


Re: How does a voodoo doll know which player to follow?

Posted: Sat May 14, 2022 9:18 pm
by Rachael
Matt wrote:It clearly doesn't have a working player pointer and players[x].mo wouldn't point to it, so where would this info be stored?
actor.player is the very essence of how voodoo doll logic works, even in GZDoom. Can you post an example of it not working?

Re: How does a voodoo doll know which player to follow?

Posted: Sun May 15, 2022 4:47 am
by Graf Zahl
Matt wrote:It clearly doesn't have a working player pointer?
You are clearly wrong here. :P

It works as follows:

First player instance is spawned, linked to player x and player x linked to this instance.
Second instance is spawned, linked to player x and player x linked to this instance.

Now the first instance still points to the player, but the player points to something else. VoilĂ , you just got a voodoo doll.

Re: How does a voodoo doll know which player to follow?

Posted: Mon May 16, 2022 6:13 pm
by Matt
...welp, time to fix a bunch of code before trying to do whatever it was I was trying to do that led to this question!