I've created a base class for modders that lets you create an item that appears as different items for different player classes.
Readme and download: https://github.com/jekyllgrim/Class-dependent-pickups/
Showcase:
It allows you to create items that look differently and provide different items to the player depending on the player class. Should be multiplayer-compatible, but I'm not entirely sure if it'll handle respawning properly. It works if the item is given directly (through scripts or cheats) as well.
The pickup will not copy all the appearance of the intended item perfectly, however; only its sprite, frame, scale and some generic appearance flags (like float bobbing). It will not display the full Spawn animation of the pickup because that would run a good chance of causing a desync. It also won't be able to inherit dynamic lights or 3D models attached to the intended pickups, so the use of this item is fairly limited (but you're free to extend the library to your liking).
[ZScript] Player class-dependent item
Forum rules
Before posting your Resource, please make sure you can answer YES to any of the following questions:
Consult the Resource/Request Posting Guidelines for more information.
Please don't put requests here! They have their own forum --> here. Thank you!
Before posting your Resource, please make sure you can answer YES to any of the following questions:
- Is the resource ENTIRELY my own work?
- If no to the previous one, do I have permission from the original author?
- If no to the previous one, did I put a reasonable amount of work into the resource myself, such that the changes are noticeably different from the source that I could take credit for them?
Consult the Resource/Request Posting Guidelines for more information.
Please don't put requests here! They have their own forum --> here. Thank you!
-
- Global Moderator
- Posts: 1117
- Joined: Mon Jul 21, 2008 4:08 am
- Preferred Pronouns: He/Him
- Graphics Processor: nVidia (Modern GZDoom)
-
- Global Moderator
- Posts: 1117
- Joined: Mon Jul 21, 2008 4:08 am
- Preferred Pronouns: He/Him
- Graphics Processor: nVidia (Modern GZDoom)
Re: [ZScript] Player class-dependent item
Library updated to version 3.0:
- Refactored and streamlined the process of receiving the final item from the class-dependent pickup. The pickup will now properly call Touch() when the item is received from world, or CallTryPickup() when received directly. This means:
- Any behavior in the final item's Touch() override will work as intended.
- The mugshot will properly use its "grin" state if the pickup is a weapon.
- The class-dependent pickup can be giveт directly through scripts or cheats), and the correct pickup will be given to the player depending on their playerclass.
- The class-dependent pickup will not be picked up when not supposed to (for example, if you already have maximum amount of it). - Restructured the library. Example classes are now in a separate file, and all of the main code is now in a CDP_ZScript directory.
- Added MIT License (see LICENSE.txt).