Raised This Month: $23 Target: $400
 5% 

[ANY] Map Rewards (v1.001, 1/28/19)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
NIGathan
Senior Member
Join Date: Aug 2011
Location: /dev/null
Plugin ID:
6372
Plugin Version:
1.001
Plugin Category:
Fun Stuff
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    2 
    Plugin Description:
    Setup custom rewards or pickups around the map. Or gmod, whatever.. I don't even know anymore.
    Old 12-17-2018 , 04:03   [ANY] Map Rewards (v1.001, 1/28/19)
    Reply With Quote #1

    • Description
      Map Rewards allows you to create custom entities around the map. In theory, you are free to customize these entities to the full extent that Hammer/Source SDK allows.
      These entities are also able to detect when touched or hurt by a player and run a defined command on the server. This command can contain two special strings in the definition: #player to use the touching player as targets and #reward to resolve to the ID or name (if the reward was named) of the triggered reward. As well as #inflictor for hurt events only, resolves to the actual entity that inflicted the damage.
      Also provided with Map Rewards are two seemingly unrelated commands, sm_exec2 and sm_teleplus, they are included because these types of commands are commonly used as the reward for the entities.

    • Cvars
      Spoiler

    • Commands
      Spoiler

    • Demonstrations
      Fun rotations: https://streamable.com/8z512
      Example of a full map with rewards spawned all throughout: https://streamable.com/w87q5
      Example of loading/saving configs and relatively loading them too: https://streamable.com/xv22x

    • Example Usage
      Spoiler


    • About the CFG files
      Spoiler


    • About the different respawn_methods
      Spoiler


    • About sm_exec2 and sm_teleplus
      Spoiler


    • About models
      Spoiler


    • About scripts, overridescript and entity_property_script
      Spoiler


    • About Reward ID's and Names
      Spoiler


    • Dependencies
      There are no longer any dependencies for Map Rewards. :)

    • Installation
      If you wish to use the included aliases.cfg or scripts.cfg you can place them in the cfg/maprewards/ folder.
      Neither of these cfg files are required, but aliases.cfg defines a lot of models for TF2 and scripts.cfg adds a couple useful entity scripts to get you started. Primarily np should really be used on any entity you don't want to have physics. It also disables shadows for the entity which can be a source of lag for some users.

    • Changelog
      Quote:
      1.001 - 1/28/19
      • Fixed bug with sm_mrw_cfg_load. Loading large files causes the server command buffer to overflow, only loading part of the cfg file.
      • Introduced a new bug in the process. Now when loading a cfg file, some bits of garbage data seem to be sent to the server. It is seemingly harmless and all the proper data is still processed and sent to the server correctly. Will require further investigation.
      1.000 - 1/28/19
      • First officially stable release!
      • Reward names can no longer contain '@' or '..'.
      • sm_teleplus now accepts a target as the second argument.
      • Removed the following commands in favor of sm_mrw_modify:
        • sm_mrw_add_custom
        • sm_mrw_copy
        • sm_mrw_copyhere
        • sm_mrw_move
        • sm_mrw_turn
        • sm_mrw_release
      • Better code organization.
      • Integrated strplus.inc internally, so the separate include is no longer needed.
      • Removed colors.inc. Now color is handled internally.
      • Fixed sm_teleplus bug that incorrectly processed XYZ arguments as a target client string.
      • Fixed sm_mrw_trigger bug automatically setting the -X switch when a target is provided.
      • Optimized colors in chat.
      • Hopefully fixed sm_mrw_add help message being cut off.
      • Removed error output when trying to kill an incorrect entity.
      • sm_mrw_info is now more comprehensive and colorful.
      • Decreased precision of -T settings to 2 decimal places when saving rewards.
      • Now the -X switch in sm_mrw_modify will unset the hurt command if no command is provided.
      Pre Stable Versions (240 builds)


    • Additional notes
      Quote:
      Originally Posted by Disclaimer
      This plugin has some very sensitive syntax, but I have tried
      to make it intuitive.

      An amount of care should be taken when summoning certain
      entities with certain property values. Incorrect or careless
      values could result in server and/or client crashes.

      Map Rewards is released without warranty of any kind.
      In all of my testing I have yet to witness a crash of any sort, just be cautious of what you are attempting to do. This plugin only affects the current session, so if the server crashes it should be fine when it comes back. If you have auto-saving enabled and manage to add a server breaking entity, you may need to manually delete or modify the cfg file so the plugin doesn't attempt to re-create it; the entity in question should end up as the very last line of the cfg file.

      This is the first plugin like this I have made, and I am not very familiar with entities or their datamaps so please don't hesitate to point out any errors I might have made.
      And although I am rather familiar with SourcePAWN, I don't actually know the language, so there may be some parts of my code that could be simplified.

    Get the plugin or the source!
    Optional aliases.cfg and scripts.cfg files to be placed in cfg/maprewards/
    Attached Files
    File Type: sp Get Plugin or Get Source (maprewards.sp - 244 views - 161.1 KB)
    File Type: cfg aliases.cfg (3.0 KB, 135 views)
    File Type: cfg scripts.cfg (78 Bytes, 142 views)

    Last edited by NIGathan; 01-29-2019 at 00:46.
    NIGathan is offline
    NIGathan
    Senior Member
    Join Date: Aug 2011
    Location: /dev/null
    Old 12-20-2018 , 18:35   Re: [ANY] Map Rewards (v0.161, 12/20/18)
    Reply With Quote #2

    Updated to v0.161

    Changes
    Fixed a bug causing timers in charge of rotating entities created with the -T switch to incorrectly apply garbage rotations to unrelated entities.
    NIGathan is offline
    Snack Patrol
    Member
    Join Date: Jan 2012
    Location: Earth
    Old 12-22-2018 , 02:35   Re: [ANY] Map Rewards (v0.161, 12/20/18)
    Reply With Quote #3

    Dude this seems really cool, I kinda was looking for something like this to for instance place custom props (like pots) around the maps that when either broken or touched (maybe the TF2 gift models) that it would give credits for the Store plug-in I am going to run. This sounds like a really fun thing if I'm reading the description correctly. I am definitely going to check this out.
    Snack Patrol is offline
    NIGathan
    Senior Member
    Join Date: Aug 2011
    Location: /dev/null
    Old 12-22-2018 , 18:49   Re: [ANY] Map Rewards (v0.161, 12/20/18)
    Reply With Quote #4

    Quote:
    Originally Posted by Snack Patrol View Post
    Dude this seems really cool, I kinda was looking for something like this to for instance place custom props (like pots) around the maps that when either broken or touched (maybe the TF2 gift models) that it would give credits for the Store plug-in I am going to run. This sounds like a really fun thing if I'm reading the description correctly. I am definitely going to check this out.
    Yep, this can do that. Except for the breaking part. I plan to add in a means for determining if an entity's lifespan has ended, like when a tf_pumpkin_bomb gets shot, but I've got no real idea how I'm going to go about that yet.
    NIGathan is offline
    NIGathan
    Senior Member
    Join Date: Aug 2011
    Location: /dev/null
    Old 12-23-2018 , 22:37   Re: [ANY] Map Rewards (v0.172, 12/23/18)
    Reply With Quote #5

    v0.173 is now up!

    This update adds some exciting features, now entities that can take damage can trigger commands when they are hurt or killed. They will also respawn automatically using whichever respawn method you have selected.

    Full changelog:
    Quote:
    0.173 - 12/23/18
    • Fixed sm_mrw_cfg_save so the HOOK_DEACTIVE flag is no longer saved.
    • Added new usage response for new options added in v0.172.
    0.172 - 12/23/18
    • Added new reward respawn methods (-d):
      • hurt shortcut -H - Sets the trigger method to when the reward is hurt by a player.
      • kill shortcut -K - Sets the trigger method to when the reward is killed by a player.
      • notouch shortcut -N - Removes any on player touch events for the reward.
        • The actual respawn methods will still apply for when a reward is activated, whether it be by touch or hurt.
          • constant will not allow a hurt reward to never be killed.
          • static will allow it to be killed only if enough damage is dealt, otherwise, while it is deactive, the reward cannot be killed. When it is hurt, but still alive, touch will also be deactive until the respawn time is up.
          • pickup does not affect hurt or kill, both will work independent of eachother.
        • Using shortcuts will now only remove conflicting settings, using multiple shortcuts can be used to combine options:
          • -C -H -N will create a reward that can only be triggered when shot and will never die or despawn.
          • -S -d constant -N -d kill will only apply -d kill. All -d options except for hurt and notouch completely reset to the provided option.
          • -d static -N -d hurt will apply all three in the order provided, it will be static activate when touched, disable activation on touch, enable activation on hurt.
        • All of the old options automatically apply on touch while hurt and kill automatically apply on hurt. With only hurt or kill set, it will respawn as if pickup had been set without touch.
      • hurt will kill the entity (unless static or constant is set), so for something that explodes, for example, use kill.
      • Even if you don't want to run a command for the entity, you can still use kill incase the entity is killed, so that it can respawn on its own.
    • You can also use -d # where # is the set of desired values OR'd together:
      Code:
      #define HOOK_NOHOOK         0
      #define HOOK_DEACTIVE       1
      #define HOOK_TOUCH          2
      #define HOOK_HURT           4
      #define HOOK_STATIC         8
      #define HOOK_CONSTANT       16
      #define HOOK_KILL           32
      • HOOK_DEACTIVE is used internally when a static reward is in its disabled state. You can use this value only upon creation or modification to make it wait respawn_time before appearing or activating.
      • HOOK_TOUCH must be used to hook when a player touches the reward. With no other values, this acts the same as -d pickup
      • HOOK_HURT must be used to hook when a player damages the reward. With no other values, this acts the same as -d hurt
      • To re-create -d kill you need to OR HOOK_HURT with HOOK_KILL to get -d 36.
    • Added another special string for reward's command definition: #inflictor will resolve to the entity ID of the entity that directly damaged the reward.
      • Only gets evaluated if the reward was triggered by a hurt event.
      • #player will always be the player that caused the damage. The value of both #player and #inflictor will be the same unless the damage was caused indirectly.

    Last edited by NIGathan; 12-23-2018 at 22:38.
    NIGathan is offline
    zipcore
    Veteran Member
    Join Date: Mar 2010
    Location: m_flZipcore
    Old 12-30-2018 , 02:01   Re: [ANY] Map Rewards (v0.179, 12/23/18)
    Reply With Quote #6

    Awesome plugin, but I prefer to write plugins for such things instead of using something limited like this.
    __________________
    zipcore is offline
    NIGathan
    Senior Member
    Join Date: Aug 2011
    Location: /dev/null
    Old 01-03-2019 , 01:03   Re: [ANY] Map Rewards (v0.179, 12/23/18)
    Reply With Quote #7

    Quote:
    Originally Posted by zipcore View Post
    Awesome plugin, but I prefer to write plugins for such things instead of using something limited like this.
    Thanks for the feedback, but as much as I agree with you on that for those specific cases, this plugin is for everything else. This plugin aims to easily create rewards on the map and on the fly. In almost every case, this plugin far exceeds the needs to do that.

    With each update, more and more limitations are being lifted. You can fully customize the entity itself as much as you can in SourceSDK and there are tons of customizable options and combinations to configure the entity's interactions to your liking. With the most recent update, you can safely create something as unique as a tf2 pumpkin bomb that copies itself upward each time it explodes:

    Code:
    sm_mrw_add -e tf_pumpkin_bomb -c @aim -K -X "sm_mrw_add -b #reward -c ~ ~ ~50;sm_mrw_remove #reward"
    Now you have an infinite pumpkin ladder that climbs as it's broken.

    This was possible in older versions, but it's actually tested and working properly as of v0.188. I think there were some slight problems with this similar setup before.

    And of course, if you can think of anything else you think I should add, please let me know.

    Edit: Actually, after some consideration, this would be a simpler way to achieve the same thing:
    Code:
    sm_mrw_add -e tf_pumpkin_bomb -c @aim -K -X sm_mrw_modify #reward -c ~ ~ ~50
    However, I have noticed that sometimes the hurt event will trigger twice and I'm not yet sure if there is much I can do it about it.

    Last edited by NIGathan; 01-03-2019 at 01:42.
    NIGathan is offline
    NIGathan
    Senior Member
    Join Date: Aug 2011
    Location: /dev/null
    Old 01-14-2019 , 00:53   Re: [ANY] Map Rewards (v0.195, 1/13/19)
    Reply With Quote #8

    Lots of bug fixes and some new stuff in v0.195:
    Quote:
    0.195 - 1/13/19
    • Fixed bug wtih StrFind from strplus.inc not returning properly.
    • Fixed bug with sm_mrw_cfg_load failing to load relatively.
    • Fixed bug with reward ID range in the format of #.. where the end point would incorrectly be 0.
    • Fixed bug with sm_mrw_copy* commands not copying the turn interval from the -T switch, effectively making them not turn.
    • Fixed -b switch in sm_mrw_add and sm_mrw_modify not copying -T options.
    • Now sm_mrw_respawn can accept multiple reward ID arguments and ranges, just like sm_mrw_remove.
    • Now sm_mrw_move accepts reward ID ranges.
    • Added new switch for sm_mrw_add and sm_mrw_modify, -U, to make script, model, and entity_property aliases evaluate at spawn time.
    • Added new switch for sm_mrw_cfg_load, -N, will not add the origin to the commands before sending them to the server. Useful for cfg's with dangerously long commands.
    • Made string sizes consistent throughout the plugin, hopefully fixing various bugs due to limited "fake" size constraints.
      • This, combined with the new -N switch, seems to have fixed a weird bug with sm_mrw_cfg_load that certain configs wouldn't load every reward. (Don't get me started on this bug.. It makes no sense at all.)
    • Increased max command length to 1024 (from 128), however it will be impossible to actually use the entirety of this space, the largest possible command is realistically 1007.
    • Increased max reward limit to 512 entities.
    I'm trying to prepare the code to transition into a better reward ID system that will allow better control over multiple entities at the same time, it should be ready soon!

    Last edited by NIGathan; 01-14-2019 at 00:55.
    NIGathan is offline
    NIGathan
    Senior Member
    Join Date: Aug 2011
    Location: /dev/null
    Old 01-19-2019 , 22:20   Re: [ANY] Map Rewards (v0.222, 1/19/19)
    Reply With Quote #9

    Several bugs have been smashed thanks to a lot of major code rewrites. Also aliases are evaluated much faster and smarter, most commands allow targeting multiple rewards at the same time, and you can colorize and even make rewards invisible now!

    Check out the full changelog for v0.222 in the OP for all the details and usage examples.
    NIGathan is offline
    NIGathan
    Senior Member
    Join Date: Aug 2011
    Location: /dev/null
    Old 01-28-2019 , 03:45   Re: [ANY] Map Rewards (v1.000, 1/28/19)
    Reply With Quote #10

    The first officially stable v1.000 release is here!

    This is the 241st build of Map Rewards and hopefully only new features come from here. In my testing I haven't found any bugs and deem it stable.

    Changes since v0.223:
    PHP Code:
    /* * * * * * * * * * * * * * * *\
    \*                             */
    /*          CHANGELOG          *\
    \*                             */
    /*      v0.224_Pre-Stable      *\
    \*                             */
    /* Reward names can no longer  *\
    \*     contain '@' or '..'     */
    /*                             *\
    \*  sm_teleplus now accepts a  */
    /*  target as the second arg.  *\
    \*                             */
    /* Removed the following cmds: *\
    \*      sm_mrw_add_custom      */
    /*        sm_mrw_copy          *\
    \*       sm_mrw_copyhere       */
    /*        sm_mrw_move          *\
    \*        sm_mrw_turn          */
    /*       sm_mrw_release        *\
    \*  All functionality exists   */
    /*    within sm_mrw_modify.    *\
    \*                             */
    /*  Better code organization.  *\
    \*                             */
    /*      v0.234_Pre-Stable      *\
    \*                             */
    /*     Removed strplus.inc     *\
    \*     Removed colors.inc      */
    /*                             *\
    \*      v0.235_Pre-Stable      */
    /*                             *\
    \* Fixed sm_teleplus bug that  */
    /*  incorrectly processed XYZ  *\
    \* as a target client string.  */
    /*                             *\
    \*      v0.236_Pre-Stable      */
    /*                             *\
    \*  Fixed sm_mrw_trigger bug   */
    /*  automatically setting the  *\
    \* -X switch when a target is  */
    /*          provided.          *\
    \*                             */
    /*      v0.237_Pre-Stable      *\
    \*                             */
    /*  Optimized colors in chat.  *\
    \*                             */
    /*      v0.238_Pre-Stable      *\
    \*                             */
    /* Hopefully fixed sm_mrw_add  *\
    \* help message being cut off. */
    /*                             *\
    \*      v0.239_Pre-Stable      */
    /*                             *\
    \* Removed some useless error  */
    /*           output.           *\
    \*                             */
    /*   sm_mrw_info is now more   *\
    \* comprehensive and colorful. */
    /*                             *\
    \*      v0.240_Pre-Stable      */
    /*                             *\
    \*  Decreased precision of -T  */
    /*    settings when saving.    *\
    \*                             */
    /*           v1.000            *\
    \*                             */
    /*    First stable release!    *\
    \*                             */
    /*    Now the -X switch in     *\
    \*  sm_mrw_modify will unset   */
    /* the hurt command if none is *\
    \*          provided.          */
    /*                             *\
    \* * * * * * * * * * * * * * * */ 
    NIGathan is offline
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 04:39.


    Powered by vBulletin®
    Copyright ©2000 - 2020, vBulletin Solutions, Inc.
    Theme made by Freecode