Replicate "Player.StartItem" for a custom non-player class

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

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!)
User avatar
Nash
 
 
Posts: 17422
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Replicate "Player.StartItem" for a custom non-player class

Post by Nash »

I want to replicate the functionality of Player.StartItem property for a custom, non-player class I'm making.

Specifically, the functionality of being able to specify a multiple list of arbitrary classes in the Default {} block and then have my custom class do what it will with that information.

How would I set this up?
ZzZombo
Posts: 309
Joined: Mon Jul 16, 2012 2:02 am

Re: Replicate "Player.StartItem" for a custom non-player cla

Post by ZzZombo »

Well... Player.StartItem is actually just DropItem hijacked... so you can hijack DropItem for that as well. IIRC there is no much magic behind the latter, so replicating a similar system shouldn't be too hard, with the grammar being the only obvious obstacle I can think of.

Return to “Scripting”