[REQUEST] Understanding actor pointers

Handy guides on how to do things, written by users for users.

Moderators: GZDoom Developers, Raze Developers

Forum rules
Please don't start threads here asking for help. This forum is not for requesting guides, only for posting them. If you need help, the Editing forum is for you.
Post Reply
Double(Super)Shotgun
Posts: 75
Joined: Fri Jul 25, 2014 2:16 pm

[REQUEST] Understanding actor pointers

Post by Double(Super)Shotgun »

The wiki entry has a lot of information, but I think it assumes a slightly higher level of programming understanding from users. I think this might be a fairly easy-to-understand topic, at least for basic implementations, but as it stands I'm having trouble even getting the gist of the basics. For example, I don't get what tracers do, how they differ from the target category, at all. Is it something to do with where an actor is 'aiming', somehow? That's the kind of question I'm having.

If nobody feels up to it, once I wrap my head around the subject (and if I even then feel competent enough to talk on it), I'll turn this thread into short tutorial on actor pointers. :geek:

Also, I realize it probably IS meant for modders who already know what they're doing, but even so, a brief explain-it-like-I'm-five explanation might work wonders.
User avatar
Arctangent
Posts: 1235
Joined: Thu Nov 06, 2014 1:53 pm
Contact:

Re: [REQUEST] Understanding actor pointers

Post by Arctangent »

Are you having trouble understanding the second, third, and fourth sections of the page? Those explain the usage of the points for projectiles, monsters, and special cases, respectively, and they seem pretty clear to me.
User avatar
ibm5155
Posts: 1268
Joined: Wed Jul 20, 2011 4:24 pm
Contact:

Re: [REQUEST] Understanding actor pointers

Post by ibm5155 »

Isn't pointers the same explanation as C pointers?
User avatar
Ghastly
... in rememberance ...
Posts: 6109
Joined: Fri Jul 06, 2007 2:34 pm

Re: [REQUEST] Understanding actor pointers

Post by Ghastly »

ibm5155 wrote:Isn't pointers the same explanation as C pointers?
Yes, but those are honestly pretty hard to understand if you don't know programming or are new and coming from a language like Java. Additionally, a lot of textbooks don't explain pointers very well, usually explaining them like "it points to this area of memory, so if we add this amount to the pointer, we're then pointing at this other area of memory" which makes them seem useless.

So still, for those who aren't familiar and comfortable with C pointers, a tutorial would still be useful.
Harbltron
Posts: 1
Joined: Fri May 06, 2016 2:24 pm

Re: [REQUEST] Understanding actor pointers

Post by Harbltron »

Literally joined the forums just for help in understanding pointers... the wiki is pretty unforgiving to those of us with no coding background.

A basic primer on pointers for newbies would be indispensable.
User avatar
Arctangent
Posts: 1235
Joined: Thu Nov 06, 2014 1:53 pm
Contact:

Re: [REQUEST] Understanding actor pointers

Post by Arctangent »

I think you guys are overthinking it; as far as the stuff you need to know to make use of them in Decorate and such, they're just variables that "point" to other actors.

Basically, when a projectile is spawned by a projectile function, its target pointer is usually set to the actor that spawned it. Because of this, you can use the projectile's target pointer to refer to its spawner.

It's not terribly complicated, and there names are pretty self-explanatory except for the fact that a projectile's target is its spawner ( its actual target is its tracer, although that requires specific setup to be used in normal circumstances ). For example, a monster's target is stored in the target pointer, which means you can refer to its target through that pointer.
User avatar
ibm5155
Posts: 1268
Joined: Wed Jul 20, 2011 4:24 pm
Contact:

Re: [REQUEST] Understanding actor pointers

Post by ibm5155 »

an actor pointer is quite easy.
It's just like your house address, it's a unique text/number and there'll be no other house with the same address around your city.
so, if you gave your house address to someone, they'll know how to find you, and also they'll know the size of the terrain, how old is it,...

And in the doom world, it's the same thing, the actor pointer is just the address from where this actor is on the memory, with that, you could know where the monster is, his health, the state...
So when you set like, the target pointer to a barrel. a monster will know where that barrel is and he'll try to follow an imaginary line betwhen he and the barrel.

And if you gave a wrong pointer (ie a wrong house address) either the actor and your friends will get lost to go to it...

EDIT: kinda old question but it's on tutorial folder so someone else may help with this if they are looking about what the heck are actor pointers
Post Reply

Return to “Tutorials”