Preserved forum archive. This topic stores the original first post and locally mirrored RPG Maker Web attachments when available. It is posted by the BMMPlay archive account, not by the original creator.
Original Source
- Original title: Simple Points System
- Original author: ashes999
- Original date: June 21, 2014
- Source thread: https://forums.rpgmakerweb.com/threads/simple-points-system.28812/
- Source forum path: Game Development Engines > Ruby Game System (RGSS) Scripts > RGSS3 Scripts (RMVX Ace)
Summary
Hi, I've created a simple points system; you can give the player points based on things they do, track, and total them (all through code). It also plays audio when you get points. It's useful for games like mine, actually Sample use: PointsSystem.add_points("Kicked the cat", -100)PointsSystem.add_points("Defeat the hidden chicken boss", 370)It has a couple of caveats presently:
Archived First Post
Hi,
I've created a simple points system; you can give the player points based on things they do, track, and total them (all through code). It also plays audio when you get points. It's useful for games like mine, actually
Sample use:
PointsSystem.add_points("Kicked the cat", -100)PointsSystem.add_points("Defeat the hidden chicken boss", 370)It has a couple of caveats presently:
- Points/events are unique, meaning you can't add the same event twice.
- It uses system sounds for audio (but it's configurable).
You can find the latest version, always, on GitHub over here. Here's a version, which I hope I remember to update:
It's nothing glamorous, I promise
I've created a simple points system; you can give the player points based on things they do, track, and total them (all through code). It also plays audio when you get points. It's useful for games like mine, actually
Sample use:
PointsSystem.add_points("Kicked the cat", -100)PointsSystem.add_points("Defeat the hidden chicken boss", 370)It has a couple of caveats presently:
- Points/events are unique, meaning you can't add the same event twice.
- It uses system sounds for audio (but it's configurable).
You can find the latest version, always, on GitHub over here. Here's a version, which I hope I remember to update:
#==============================================================================## -- A simple points system; get or lose points from events.# -- Points are via "events" which are a name + score, eg.# -- "break the statue" => 100 points# -- Author: ashes999 (ashes999@yahoo.com)# -- Version 1.0module PointsSystem # Start: variables you can customize # These map to system sounds. POSITIVE_SOUND = 21 # shop NEGATIVE_SOUND = 3 # buzzer # End variables. Please don't touch anything below this line. # Key => event name, value => score @@points_scored = {} def self.add_points(event, score) @@points_scored[event] = score if (score >= 0) then play_soundpositive) else play_soundnegative) end end def self.total_points sum = 0 @@points_scored.map { |k, v| sum += v } return sum end def self.points_breakdown return @@points_scored end # key => ositive or :negative def self.play_sound(key) Sound.play_system_sound(POSITIVE_SOUND) if key == ositive Sound.play_system_sound(NEGATIVE_SOUND) if key == :negative endend
Downloads / Referenced Files
Log in to download
Log in, then follow the RPG Maker Developers Group to see these download links.
Log in to downloadCreator Claims / Removal
If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.
Replies (0)
No replies yet.
0
replies
2
views
Topic Summary
Loading summary...