Jump to content

Photo

RPG Script Set for ZC (Request Features Here!)

rpg functions items header global script

  • Please log in to reply
15 replies to this topic

#1 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 09 April 2014 - 12:22 PM

I'm continuing my work on the RPG script system. At present, I have quite a lot of it working, and am happy to share it with anyone who wants to use it, but I think I should better annotate the code, and provide instructions for using it.

In this thread, I would appreciate if people would post feature requests, for things they want to see in this kind of system.

The present version (v0.29) is 1,462 lines long, so posting it here (i.e. as a post in the thread) is out of the question. Although I am writing it in sections, i have a combined script that you can use to test it out. If anyone wants to try this, please let me know, as I do not know how may people want PRG-ish features in ZC.

 

It includes six statistics, tied into functions; as well as randomly rolled HP & MP increases, that are also tied into stats. I hope to eventually tie attacks to stats, and convert the damage from weapons/spells into a system based on random die rolls. I may also eventually do this with monster HP, and with eWeapon attacks.

Some elements are already present to create enemies that are vulnerable to certain magic spells, certain weapons, and so forth. The PX system is working, and the money system is at least partly working, including wallets of differing sizes, that can hold a certain number of coins, based on coin size, instead of denomination; or other items.

Items stored in wallets (or pockets) will all need a size rating, to determine if they are too large to carry. At present, I don't have a way to put items back into chests, that you can't carry.

If anyone has a suggestion on how to do that, I'm happy to know it.

Again, please request features for this here. I plan to tie some of its aspects into a few headers, so it will have dependencies, and I am mostly worried about running out of global variables, and global constants.

I am planning to include a skill section, but the max globals makes it difficult, and I am going to try to cheat the system in that regard, if I can.

In the next few days, I plan to re-make a good number of item scripts, enemy scripts, and so forth, to work with the system, and then both make a new build of TGC that uses it, and an archive of all the files; after cleaning them up.

I'd really like to know how many people are interested in this, so that I know if I should focus on any aspects of it.
 


Edited by ZoriaRPG, 09 April 2014 - 12:25 PM.


#2 Mero

Mero

    Touch Fluffy Tail

  • Banned
  • Real Name:Tamamo No Mae
  • Location:Rainbow Factory

Posted 09 April 2014 - 12:42 PM

I might be mistaken but isn't Gleeok already working on something similar to this.


  • Shane likes this

#3 Avaro

Avaro

    >w<

  • Members

Posted 09 April 2014 - 01:09 PM

Make sure to have a lot of customization in it :). Some people might not like to have MP, for instance, while others don't want a weakness system.

This does look like an amazing project though. To be honest, I would not use the set in a quest, because I'm a scripter myself and would rather make my own stuff (I'll definetly use it for reference and to get ideas of how things are done, though), BUT I hope to see it being used in other peoples quests, I'm sure this adds a lot of strategy to the quest.

Good luck!
  • coolgamer012345 likes this

#4 Moosh

Moosh

    The Mush

  • Moderators

Posted 09 April 2014 - 01:10 PM

This is probably something so incredibly obvious that you didn't even mention it, but does your script make it so damage appears above enemies/your head when you hit them or they hit you?


  • Avaro likes this

#5 anikom15

anikom15

    Dictator

  • Banned
  • Real Name:Westley
  • Location:California, United States

Posted 09 April 2014 - 02:52 PM

Can't you use arrays to reduce the number of globals?

#6 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 10 April 2014 - 02:02 PM

This is probably something so incredibly obvious that you didn't even mention it, but does your script make it so damage appears above enemies/your head when you hit them or they hit you?


Actually, that wasn't obvious to me, as it isn't something that I would use (giving away enemy HP), but it shouldn't be that hard. It might slow the game down considerably though, as it would need to create an FFC for each enemy on the screen, that moves with that enemy. I think there is already something like this in the Scripting DB, or in a discussion on the forum.

Can't you use arrays to reduce the number of globals?


That's something that I've considered. If the number of globals does exceed the bounds of what is usable in ZC, it will be mandatory. I planned to use arrays to handle variables on skill checks, because using two globals per item, object, or location that would allow a skill check, is just plain stupid.

I;d run out of available globals very quickly, and it should be possible to pass the information between functions without a global. That's part of why I needed more information on the correct method for handling information passing.

---

I don't know what Gleeok is doing. I'm creating this to fit a similar model to an actual pen & paper RPG, with nuances that RPG authors would consider, versus those that a video-game RPG creator would find to be required, or elementary; which is why feedback from others is important.

With regard to not using components, it isn't hard to disable things. if you don;t use MP or magic in a game, you could just ignore the functions, and not place the counter on your subscreen. Other, more precise alterations, will of course require comprehensive instructions; which will be packaged in the script set, when complete.

#7 Moosh

Moosh

    The Mush

  • Moderators

Posted 10 April 2014 - 02:38 PM

Actually, that wasn't obvious to me, as it isn't something that I would use (giving away enemy HP), but it shouldn't be that hard. It might slow the game down considerably though, as it would need to create an FFC for each enemy on the screen, that moves with that enemy. I think there is already something like this in the Scripting DB, or in a discussion on the forum.

Not necessarily. I once did something like this using just one script and arrays to keep track of the enemies. Of course because of how the enemy list is frequently changing as enemies are killed and spawned in and when changing screens you'd have to put in checks to account for that.



#8 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 10 April 2014 - 02:38 PM

You don't need to use FFCs for every enemy's hit popups.

 

For example, here's some of the code for the health bars in CiS (in the global script)

 

//In global while(true)
for ( int i = Screen->NumNPCs(); i > 0; i-- ){ //For each enemy
                    npc enem = Screen->LoadNPC(i); //Load the enemy
                    
                    //Initialize max HP
                    if ( enem->Misc[MISC_MAXHP] == 0 ){ //If max health not set
                        enem->Misc[MISC_MAXHP] = enem->HP; //Set to current health                        
                    }
                        
                    //Detect when enemy is hurt
                    else if ( enem->HP < enem->Misc[MISC_LASTHP] ) //If enemy was hurt
                        enem->Misc[MISC_DRAWTIME] = SCANNER_DRAWTIME; //Enable health bar for 2 seconds
                        
                    //If bar is enabled and enemy is damaged but alive
                    if ( enem->Misc[MISC_DRAWTIME] > 0 && enem->HP < enem->Misc[MISC_MAXHP] && enem->HP > 0 ){
                        int barX1 = enem->X;
                        int barX2 = enem->X + Max(enem->HitWidth*(enem->HP/enem->Misc[0]), 0);
                        //Draw black background (width = enemy width)
                        Screen->Rectangle(7, barX1, enem->Y-1, enem->X+enem->HitWidth, enem->Y-1, COLOR_BG, -1, 0, 0, 0, true, 128);
                        //Red meter (width = BG width * HP/max)
                        Screen->Rectangle(7, barX1, enem->Y-1, barX2, enem->Y-1, COLOR_RED, -1, 0, 0, 0, true, 128);
                        //White border (same dimensions and location as BG)
                        Screen->Rectangle(7, barX1, enem->Y-1, enem->X+enem->HitWidth, enem->Y-1, COLOR_TEXT, -1, 0, 0, 0, false, 128);
                        enem->Misc[MISC_DRAWTIME]--;
                    }
                    
                    enem->Misc[MISC_LASTHP] = enem->HP; //Set last HP to current HP
                }


#9 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 10 April 2014 - 06:46 PM

That's actually quite interesting, however, it is using a bar, instead of a numeric display. Perhaps I could do something similar using Tango, to overlay HP numerals, although as i said, i would disable that for my own games. I also don't see a point in having it over the PC sprite, unless you are going to do that in place of having it on a subscreen, where it would be more legible.

I honestly feel that putting numbers, or metres over each NPC looks awful, but if people want that, i will try to include it in a package. I would also be certain to use three commands, for normal enemies, Link, and bosses. Bosses would need an FFC, to flag them as an enemy not to include in the list for normal enemies, and to display their health using a bosssHPOverlay() function.

Breaking it into three commands allows more flexibility, so that a questmaker can enable it for any combination of the three.

The enemy editor list shouldn't be important, as any method of doing this, would just read the present list on every frame, and update enemies that exist. The reason I was thinking of using FFCs is to produce text, but after I get more experience with Tango, I may be able to work some magic with that.

The only drawback there, is that custom font particles (tiles) would be required, so I'd need to put graphics packs with the script set, but I foresee that as a mandatory requirement in the end, as I also plan to make JRPG style (or, DQ style, which is usually how I refer to them) menus in the package.

TGC will be the script set-up demo in the end, or one of them, as most of this is going to be used in TGC. If any feature isn't used in TGC, I will still present a build that uses them

I also hope to have enemy and boss template scripts with it, as an entire RPG game package, as well as a bunch of headers, including the stdWeapons.zh header project that Aludcard recovered, as it will be used for items; and stdArguments.zh, which will be required for item, and enemy set-up.

Really, this is going to give me a lot of practice on array usage, function usage, and argument usage in shared functions. It's too bad that ZScript doesn't allow the creation of shared libraries. (My mind is still stuck in Cobol mode, where everything is a shared.global resource.)

Please continue to post suggestions, or requests; bearing in mind that this is a massive project, and will take a good while for me to complete. If anyone wishes to contribute to it, please PM me.

Edited by ZoriaRPG, 10 April 2014 - 06:57 PM.


#10 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 10 April 2014 - 08:48 PM

Sounds neat. I always said it's possible to make a retro Wizardry 1 type game in ZC. Got any screen-shots?

I'm not really requesting anything, but way back when (when I messed with something similar) I used arrays for most of the stuff. Of course nowadays enemies have a misc[] array so that's even better--you can keep instanced stats/effects/bonuses separated more easily. Never got anywhere near letting enemies cast spells and such though; that would be cool to see.

#11 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 10 April 2014 - 10:47 PM

I was just showing you the concept. You can easily store the enemy's change in HP (in NPC->Misc[]) and use Screen->DrawInteger() to show it instead of my bar example.



#12 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 11 April 2014 - 02:52 AM

The latest public demo of TGC is in the DQPD: The link in my signature (The Golden Cenotaph) will whisk you away to it.

 

Try to keep in mind that this is a very early release of the game, and my initial objective was item scripts; it does use a rudimentary level system, but nothing as complex at this one, and I have yet to script the majority of enemies, and bosses, or implement the JRPG menus, or lots of planned features as of that demo version.

 

I think that, in the end, it will play like a mash-up of Wizardry, Chrystalis, and Secret of Mana; assuming that makes sense.

 

I may end up renaming parts of the present overworld, but it is only one area. I plan to have several planets in the game, separated by space; with the ability to steal a space-ship as part of the story. FOr that, I will be including an entirely different, type of interface. :)

 

I plan to have at least one 'space' DMAP, where the Link sprite becomes a space-ship FFC, acting like a shooter. If I can use smooth scrolling for this, it will be even more fantastic.

 

I was hoping to use your Z3 scrolling script for Delves, as they don't involve combat. Do you know if any FFCs work in your scrolling demo script? I know that built-in enemies won't work, but I was hoping that FFCs, including NPCs (conversational/merchants), and possibly ghosted FFC enemies might, because it would be really neat, and I could vastly improve design, if I could use 2x2 screen segments, instead of single screens.

 

The overworld is in a way, planned to be similar to FF/DQ, with areas not drawn to scale. battles will be like Zelda/Crystalis, but walking into a village/city/site, will open a new DMAP. It's a pretty big undertaking, to be sure; especially as I have no active assistants.

 

For Arrays

My number one use for arrays, will be skill checks, assuming that i can use them as intended. I would like many items to have three discreet 'levels', for instance: WHen you get an item, either it does not work, or does not work at its full potential. making a lore check, to identify it, unlocks abilities. I can handle that easily enough with a series of globals, but it would need many globals for the gigantic inventory list in the game. Beyond that, I was hoping to include a 'item mastery' skill level, that unlocks further abilities.

 

I'm not certain at that the best way to do this is going to be, but I assume that as long as the base function driving the use of skill checks passes information to other functions, using arrays, that I can avoid globals. Tracking item usage may be tricky though, as i would need to call the function that levels up items, from the item's use script, and pass an update through to the functions that govern that item, which will need to be in the main while loop. Still a lot to do here, but if you didn;t know, I'm an RPG author, so what I am doing here is turning one of my original stories, combined with science-fiction, and fantasy trope, using similar mechanics to one of my actual RPG systems.

 

One thing that I am hoping to find a way to accomplish is to replace all damage/power ratings, when dealing damage to enemies , or to 'Link', with a command set, running in the active loop, that ignores the pre-set damage, and replaces it with 'rolled damage'. If I could programme LW_SWORD, LW_WAND, and LW_HAMMER< as LWeapons, it would have a lot of headaches in making this work; but as I can't do that, I need to find a way to replace the damage done with these items, without using different LW_Types for them.

 

My other option is to script every enemy in the game. :/

 

Inventory management

Does anyone else like the idea of coins having different sizes? In my set-up, a 100 Dsari coin would be the same size as a 1-Dsari coin, whereas a 500-Dsari coin would be the same size as a 5-Dsari coin. The larger coins, therefore do not always mean larger value, compared to other coins; and currency can be of any denomination, but is always the same relative size. This is logical, but I don't know how others will feel about it. Crystal Dsari discs have mucb larger values, but are the some size as normal Dsari. Thus, the player can accrue a lot of wealth, to carry around, if they pay attention to free wallet, and free pocket space.

 

Pockets, and packs, will also contain some small, essential items, such a a knife, some mystical objects, scrollcases (to hold scrolls), a lighter, a pocket torch--in America, this would be a 'flashlight'--small items (e.g. rings), and so forth, so the player will need to manage resources in a more RPG-esque manner.

 

This is of course, optional for the package, but will be in there as a base series of functions.

 

Selected, Passive Items

One very important thing in this concept is that the player must choose what 'passive items' are active. Aside from the obvious nature of limiting items (number of rings, gauntlets, bracelets, armour, boots, and so forth); it will also help to fix the ladder and flippers conflict. Choose the one to be active: Viola!

 

I would like to script armour that protects against certain forms of attacks in the process. Essentially passive items will retain their 'passive' nature, bot the player must select the current, equipped items, like in most RPGs. The Daleks, BTW, are not arbitrary They are a plot point, and a sort of in-joke, concerning how much inventory Link is able to carry; although the PC in the game is not Link in this case. The 'bigger on the inside' reference of 'Time Lord Technology' is something I intend to exploit as a gimmick, based on how much stuff Link is able to pull out of his arse in most games.

 

I'm going to need to script a subscreen series, and I really wish that I had more examples of scripted subscreens to use as a template. I would like to use a multi-page active subscreen, at the least, in addition to the menus.

 

Important Stuff

I wish there was a way to allow the player to 'not pick up' treasure in a chest, if they don;t have room for it; and I may need to find a creative way to fix this. The game will have banks/currency exchange, to deposit funds, and to reduce the amount of space taken up in wallets & pockets, without reducing the value of that money. (Dsari, is the word for currency, meaning 'exchange'.)


Edited by ZoriaRPG, 11 April 2014 - 03:14 AM.


#13 Master Maniac

Master Maniac

    Earth, Wind, Fire, and Water.

  • Members
  • Real Name:kris

Posted 12 April 2014 - 06:00 PM

I've considered doing RPG stuff myself. It does seem like a daunting task, however. I applaud your initiative :P

 

I'd like to see a leveling and stat distribution system. Which is kind of a given in RPG stuff.

 

Maybe some form of system that modifies enemies based on the character's level, and the general level of the next area.

 

Possibly a few different combat systems as well. Turn based would be difficult, as would meter-based (like Chrono Trigger), but it would be an interesting mechanic.



#14 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 13 April 2014 - 03:06 AM

I've considered doing RPG stuff myself. It does seem like a daunting task, however. I applaud your initiative :P
 
I'd like to see a leveling and stat distribution system. Which is kind of a given in RPG stuff.
 
Maybe some form of system that modifies enemies based on the character's level, and the general level of the next area.
 
Possibly a few different combat systems as well. Turn based would be difficult, as would meter-based (like Chrono Trigger), but it would be an interesting mechanic.


The script set already includes a level system, and a stat system, including statistic increases, and ties stats into HP & MP. (I plan to tie stats into skills, and combat as well, and even more general, and outlandish things, such as the length of tie that a jinx affects Link.)

 

If you download the file in the OP (v0.78, or whatever is the latest release), you can use the level system, and stat mechanics in a game. I included Level function (1 through 20, although you can modify this to suit your needs), which are mostly empty at present. Each does give increases to HP & MP, based on random die rolls, plus a statistic-derived base. I also included a message that the player will see when gaining a level, that is courteous enough to wait until all the enemies on a screen are dead, or until you move to a new screen, before it is displayed.

 

You wouldn't want combat to pause, to see a level-up message (or 'What a terrible night to have a curse!').  The system has a constant set for level message strings (for levels 1 through 20), allows you to start at Level-0, and uses an XP counter pair that can go up to 999,999 by design. The XP award system is from MoscowModder's XP script, and awards XP based on the HP of a creature. I could expand on this, to use other variables too; but the system also allows for direct XP awards, XP drops, and has a checking system that prevents breaking the level mechanic if you gain a large amount of XP in one single instance.

 

That is,if you gain enough XP for Level-2 while you are still Level-0, you will simultaneously gain Level-1, and Level-2 abilities. I have checked that this works all the way through to Level-20, which requires 210,500 XP in the scripts, but you can easily change the values needed, and now that I have a dual-counter, you could require XP totals over 1,000,000, if you wish, with some slight modifications.

 

{The maximum 'safe' value for an XP cap (without worrying about integer caps), using only two counters, is around 200,000,000.}

Turn-based combat is out of the question. If you want that, ZC is not the medium. (The reason I am doing this, is because ZC uses active combat.)  I don;t honestly see any reason to use turn-based combat in ZC, unless you want to make all battles specific events, in which enemies can move only so far, and the player can move so far, and finally be able to battle, but the execution of this (I think that the Ys series did something like it) isn't well-received.

 

A system like that in Shining Force doesn't make much sense for ZC either. I want to keep the live combat, while introducing RPG features, which I suspect is what anyone using this would want, as anything else would require enough set-up to warrant using another engine entirely.

 

I do plan to include certain combat mechanics, but really, they are rhe usual requests, such as elemental weaknesses, weapon type weaknesses, and so forth; but in a way that is different to the normal in-built enemy editor mechanics.

 

Please do keep tossing ideas at me.



#15 Master Maniac

Master Maniac

    Earth, Wind, Fire, and Water.

  • Members
  • Real Name:kris

Posted 13 April 2014 - 07:17 AM

Just a thought on your leveling system, by the way. Instead of making levels require larger and larger amounts of XP to reach (and risking the interger cap), why not make experience work based on percentages? Then, each level could require the same amount of experience to reach, and players could level indefinitely (if they so desired). Normal enemies would give about .75% of your experience bar, while bosses could give upwards of 10%, and quests even more than that.

 

When a player outlevels a normal enemy, simply diminish the ratio by 1/3 of their typical yield for every level above. For instance, at 1 level above an enemy, it would give .5% instead of .75%. At 3 levels over, the player gets nothing. Of course these values could be tweaked, but still.

 

On a percentage system, requiring 10,000 exp total for every level would leave plenty of room for precise exp yields, while still giving the player a reason to continue leveling. When/if a quest system is introduced, and if a questmaker desires so, certain quests could be repeatable. If quests work on a level-basis, then add in diminishing returns for quests as well. However, I'm aware that a quest system would be rather difficult to achieve, given ZQ's limitations.

 

EDIT: Also, options for enemy level scaling (and equivalent stat distribution) with the player's level would be a nice touch. I hate getting into games and outleveling enemies to the point that they can't damage me. It takes a lot away from quests and tasks, and general exploration of underleveled areas.

 

A variant of this can be seen in Guild Wars 2, where instead of enemies scaling to your level, the player's level is "capped" at the level rating of the area, and their stats are temporarily decreased to match. So though you may be level 80, you'll only be an effective level of 15 in any starting zone, max. And depending on other conditions, you may be much lower than that depending on what part of that zone you're in.


Edited by Master Maniac, 13 April 2014 - 07:21 AM.




Also tagged with one or more of these keywords: rpg, functions, items, header, global, script

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users