Author Topic: TotalRPG - Full featured RPG event system (HUD Extension support)  (Read 36040 times)

Ever wanted to make an RPG server just by eventing things? Sure, it's all possible. VCE has made it possible for a long time. However, there are quite a few inherent problems with VCE which make it extremely messy and difficult to use. This is also partially the fault of the event system simply not being designed for that level of complexity. I've created this mod with the idea of making an RPG server out of events in mind. I've taken every aspect of a VCE-evented RPG, and created new events which make doing those specific tasks much simpler. In short, these events, unlike VCE, are specifically designed for making an RPG server rather than trying to be the jack of all trades VCE was.

Money
This is probably the simplest feature of RPG events, the money system. There are also /giveGold and /giveMoney commands which allows players to trade money.
Self > addGold [amount]
Self > checkGoldMoreThan [amount]
> onHasSufficientGold
> onHasInsufficientGold




Items and Key Items
Items are stack-able 'items' which players can collect through various means (They are not tools that appear in the tools menu). Players can view what normal items they have with the /inventory command, and key items via the /keyItems command.

Client > addRPGItem [item name] [amount]
Client > addRPGKeyItem [item name]
Client > removeRPGKeyItem [item name]
Client > sellRPGItem [item name] [price]
Self > checkItemMoreThan [item name] [amount]
Self > checkHasKeyItem [item name]
> onHasSufficientItem
> onHasInsufficientItem

You can give an item.

Sell items for a specific price.

checkItemMoreThan has an alternate syntax which allows you to check for more than just one item. In this case, the second box is unused.

Use a key item to specify that a player has unlocked certain things.

Check if a player has a key item before allowing them into an area.



Skills
If you've ever tried to implement skills and EXP in a VCE system, you probably gave up. It just gets too complicated. No longer! Includes /skills command.

Client > addSkillEXP [skill name] [amount]
Self > checkSkillMoreThan [skill name] [amount]
> onHasSufficientSkill
> onHasInsufficientSkill

A simple resource-gathering skill.
\
And then checking for a high enough level for a higher tier resource.



Quests
This is arguably one of the most advanced features of TotalRPG. The checkpoint-based quest system allows for the creation of long quests with many stages without needing a hundred VCE variables to keep track of everything. Includes a /quests command to display quest log.

Self > questStart [quest name] [quest description]

This event will only work if the quest of the specified name has already been started.
Self > questCheckpoint [quest name] [chapter name] [chapter description]

This event will only work if the quest of the specified name has already been started.
Self > questComplete [quest name] [finished description]

This input will only be called once. Once the questStart or questCheckpoint event for the given names has been activated for the first time, it can't be triggered again.
> onQuestUpdated

Also only called once when you trigger the questComplete event for the given quest name. Can't be triggered again.
> onQuestCompleted

Starting a quest is easy.

Make your quest have multiple stages by using the questCheckpoint event. These events don't enforce a specific order that the player must activate the checkpoints in, so make sure they can't access a checkpoint early. You can manipulate key items to make sure that players can't trigger a checkpoint for which they have not yet earned.

A more advanced example of a bot which is used as both a starting and ending place for a quest.



The HUD
The TotalRPG event system comes built-in with a bottomprint HUD that displays the essential RPG elements. It displays their current health, the amount of money they currently have, and it displays the level and EXP of the last skill they earned EXP in. The HUD also plays fair with bottomprint events, and will not appear again until the bottomprint has timed out.




Misc.
Also included is a saving system which automatically saves and loads all player data related to the RPG events whenever they disconnect or spawn. Player position, health, tools, etc. are not saved. I recommend using Script_Player_Persistence to save that data. Other than that, there is also a random event which is just there for whatever you might need it for.

This will pick a number randomly from 0 to maximum, and then call true if the number falls between 0 and range, or false otherwise.
Self > checkRandom [range] [maximum]
> onRandomTrue
> onRandomFalse


Download
If you now feel thoroughly sold on the coolness of this system, you can download it right now!



Other highly recommended mods to use with this
Script_Player_Persistence (Default)
Event_AddItem
Event_SetPlayerTransform/Teleport
Event_Prompt

Theoretically you could also use VCE to add a secondary layer of complexity to the events, but that's more up to the way you want to design your events.

Advanced
$pref::server::TotalRPG::savingProfile              //The name of the folder to save and load data out of. Useful if wanting to switch 'profiles' on the server.
$pref::server::TotalRPG::enableSaving               //Set to false to disable automatic saving
$pref::server::TotalRPG::preferredNotificationMode  //Default is "chatMessage", can be changed to "centerPrint"
$pref::server::TotalRPG::hudTickTime                //Tick time in milliseconds
$pref::server::TotalRPG::deathMessage               //Text to display in HUD when dead or playerless
$pref::server::TotalRPG::currencyName               //Sets the name of the currency
$pref::server::TotalRPG::disableHUD                 //Set to true to disable the HUD
$pref::server::TotalRPG::enableBrickCost            //Turns on the 'pay to build' system, which charges people to build. Off by default.
$pref::server::TotalRPG::BrickCostMultiplier        //Default: 20 - Costs 1 gold per 1x1f of volume.
$pref::server::TotalRPG::BrickCostDiscounts         //Offers a small discount on larger bricks to discourage spammy building. On by default.
$pref::server::TotalRPG::BrickBaseplatePremiums     //Makes baseplate bricks more expensive. Off by default. You'll need a mod to enforce baseplate rules if you want to use this effectively.
« Last Edit: August 13, 2017, 03:46:00 PM by Pecon »


$pref::server::TotalRPG::savingProfile              //The name of the folder to save and load data out of. Useful if wanting to switch 'profiles' on the server.
$pref::server::TotalRPG::enableSaving               //Self explanitory
$pref::server::TotalRPG::preferredNotificationMode  //Default is "chatMessage", can be changed to "centerPrint"
$pref::server::TotalRPG::hudTickTime                //Tick time in milliseconds
$pref::server::TotalRPG::deathMessage               //Text to display in HUD when dead or playerless

more legible

looks rad, definitely checking this out.

is there no way to disable/enable the HUD ingame?
« Last Edit: March 15, 2015, 03:12:30 AM by Kobewarrior »


is there no way to disable/enable the HUD ingame?
Well if you're just developing then you can do
function gameConnection::showHudLoop(){}
to disable it

I'll probably throw that in as a pref in the first update.
« Last Edit: March 15, 2015, 03:19:47 AM by Pecon »

Well if you're just developing then you can do
function gameConnection::showHudLoop(){}
to disable it

I'll probably throw that in as a pref in the first update.
ah, alright

Why gold?  Why not a placeholder event labeled "currency", with a pref to say what that currency is?

Why gold?  Why not a placeholder event labeled "currency", with a pref to say what that currency is?
Honestly, there is almost never a case where a custom currency actually sounds any good. You end up getting Zapkcoins and Aokidollars all over the place. Every respectable RPG game uses gold as it's currency, there isn't much reason not to. If you really want to though I'll make the currency name a preference in the next update.

Zapkcoins and Aokidollars
I wouldn't say that the fault of a few pretentious individuals would warrant a limitation on a mod that hinders creativity.  With a custom name, it can still be called "Gold", but something within the realms of the creator's RPG world would be more possible by allowing them to customize more.  Suppose trade occurred in an empire where paper money was of more value than gold, due to the empire's influence over the region's economics.  The currency would be more appropriately named after something that would fit with the empire's lore.  Simply naming the currency after yourself would be a childish act and would mean that the host would fail to put the server quality ahead of their ego.


can't wait to start printing SgtDaeMone!!


this is so awesome

so many uses outside of just RPG too

Why do the targets for the input events work? You never define the arguments for them.

Also comes with a /giveMoney and /credits command :P (which will give a console error if you use it and it wasn't already defined by a previous mod)

I love you

I have wanted this forever