Giter Site home page Giter Site logo

class-dependent-pickups's Introduction

Class-depended pickups for GZDoom

© 2021-2023 Agent_Ash aka Jekyll Grim Payne

Description

ZScript-based class-dependent pickups for GZDoom. The JGP_ClassDependentPickup class allows defining pickups that will look like different items and will give different items depending on the player's playerclass. It's compatible with multiplayer: the item will still look like and give different items to different players, but once one player picks it up, it'll disappear for everyone.

Includes two example player classes for demo purposes. They can be replaced with any other player classes.

How to use

You only need the base class defined in CDP_ZScript/cdp_base.zs. The cdp_examples.zs file contains example player classes and an example pickup that you don't need to copy into your own project.

Once you copied the JGP_ClassDependentPickup class defined in cdp_base.zs into your project (you may also want to find & replace "JGP" with a custom prefix), you can do one of the following:

  1. Create your own pickup based on the base class and use its ClassPairs argument to define the pairs of classes.

  2. Use the JGP_ClassDependentPickup.Create(pos, pairs) static function to spawn a custom pickup from anywhere. The pos argument determines the position to spawn, and the pairs argument functions the same way as the ClassPairs property.

Class pairs, whether defined through a property or a static function argument, uses the following syntax:

"FirstPlayerClass:FirstItemClass|SecondPlayerClass:SecondItemClass" and so on. So, place : between a playerclass name and an item name, and place | between each pair. There's no limit on the number of pairs.

Note that the player classes must be defined via the class name, not their displayname (for example, DoomPlayer is valid, Doom Marine is not).

License and permissions

This resource is licensed under MIT license. See LICENSE.txt for details. Short version: anyone can use it for any purpose, just copy my LICENSE.txt somewhere into your project.

class-dependent-pickups's People

Contributors

jekyllgrim avatar

Stargazers

Oto Brachtel avatar Brandon Lopez avatar Arsalan "Aeria" Kazmi avatar Kizoky avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.