Earliest reference to player upon picking up Weapon
Moderator: GZDoom Developers
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.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
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.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
-
-
- Posts: 17465
- Joined: Mon Oct 27, 2003 12:07 am
- Location: Kuala Lumpur, Malaysia
Earliest reference to player upon picking up Weapon
When a Weapon is picked up, at which point is the earliest that the reference to the owner can be retrieved; is there a virtual I can override to have access to this information?
-
- Posts: 1730
- Joined: Tue Mar 22, 2011 11:54 pm
Re: Earliest reference to player upon picking up Weapon
I assume touching it.Nash wrote:earliest that the reference to the owner can be retrieved
Code: Select all
override void touch(Actor toucher)
{
//toucher = player
}
-
- 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
Re: Earliest reference to player upon picking up Weapon
My first thought would have been TryPickup or AttachToOwner, but yeah Touch should be earlier than either of those (and I don't know if TryPickup is called if you spawn with the weapon, use the give cheat or a giveinventory function is called - Touch shouldn't be called in any of those)