[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.

[REQUEST] Understanding actor pointers

Postby Double(Super)Shotgun » Fri Jul 03, 2015 11:08 am

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.
Double(Super)Shotgun
 
Joined: 25 Jul 2014

Re: [REQUEST] Understanding actor pointers

Postby Arctangent » Fri Jul 03, 2015 2:35 pm

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
Arctangent
squawky
 
Joined: 06 Nov 2014
Discord: SquawkyAtan#2371

Re: [REQUEST] Understanding actor pointers

Postby ibm5155 » Wed Sep 16, 2015 5:22 am

Isn't pointers the same explanation as C pointers?
User avatar
ibm5155
Just Spooky
 
Joined: 20 Jul 2011

Re: [REQUEST] Understanding actor pointers

Postby Ghastly » Sat Sep 19, 2015 12:26 pm

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.
User avatar
Ghastly
Rather ghastly
Spotlight Team
 
Joined: 06 Jul 2007

Re: [REQUEST] Understanding actor pointers

Postby Harbltron » Fri May 06, 2016 2:35 pm

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.
Harbltron
 
Joined: 06 May 2016

Re: [REQUEST] Understanding actor pointers

Postby Arctangent » Fri May 06, 2016 2:57 pm

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
Arctangent
squawky
 
Joined: 06 Nov 2014
Discord: SquawkyAtan#2371

Re: [REQUEST] Understanding actor pointers

Postby ibm5155 » Thu Feb 02, 2017 5:45 am

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
User avatar
ibm5155
Just Spooky
 
Joined: 20 Jul 2011


Return to Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest