Jump to content

Photo

RPG.zh, An RPG System Engine for Zelda Classic

header engine alpha xp script global functions rpg rpgzh

  • Please log in to reply
39 replies to this topic

#31 Binx

Binx

    Formerly Lineas

  • Members
  • Real Name:Brian
  • Location:Lancaster, CA

Posted 01 February 2015 - 10:58 AM

I know it's still being used, but 0 is the default setting. It's purely so I wouldn't have to set misc 11 attributes manually on every enemy. I'd still prefer having separate XP for each boss enemy, but I may end up using the FFC, after all.



#32 justin

justin

    Adept

  • Members

Posted 01 February 2015 - 01:29 PM

I know it's still being used, but 0 is the default setting. It's purely so I wouldn't have to set misc 11 attributes manually on every enemy. I'd still prefer having separate XP for each boss enemy, but I may end up using the FFC, after all.

 

ok, makes sense. saves some time.

 

here's the formula in code

XP += LogToBase(enem->HP,2) * (1+ enem->Attributes[11]);    // this version is your formula, its always going to add 1 to MA11 value.
 
// XP += LogToBase(enem->HP,2) * Cond(enem->Attributes[11] == 0, 1, enem->Attributes[11]);    // this version gives a multiplier of 1 if MA11=0, or MA11 as the multiplier otherwise.

Edited by justin, 01 February 2015 - 01:30 PM.


#33 Binx

Binx

    Formerly Lineas

  • Members
  • Real Name:Brian
  • Location:Lancaster, CA

Posted 21 February 2015 - 04:46 PM

So, I couldn't get your code to work with the counters I set up, so I just rebuilt one from scratch, I finally got it working, except two things

if(Game->Counter[CR_LEVEL] == l) //l = current level
    {
    Game->Counter[CR_MAX_XP] = x; //x= XP to next level
    Link->MaxHP = h; //h = Max HP
    Link->MaxMP = m; //m = Max MP
    if (Game->Counter[CR_XP] >= Game->Counter[CR_MAX_XP])
    {
        Game->Counter[CR_LEVEL] = n; //n= next level
        Link->HP += 16;
        Link->MP += 32;
        Game->Counter[CR_XP] -= Game->Counter[CR_MAX_XP];
    } 
}

I have this if statement set for each level in my script, because it was the only levelling up method that seemed to work for me (I tried "Game->Counter[CR_LEVEL] += 1;", but it didn't work, for some reason, as well as like 12 other methods before I tried this); but, while it levels up, properly, it doesn't add the HP or MP (it increases the max HP/MP, but doesn't add 16/32 to your current HP/MP), or reduce the XP total, nor does it reset the counter when I change the last line to "Game->Counter[CR_XP] = 0;". How do I get it to reset the counter and add the hp and mp properly? I'm certain the rest of the code works, it's just this part that's screwing me up.

 

EDIT: I also tried placing the level change after the rest of the code, thinking maybe it was levelling up, first, then stopping, but it still does the same thing, it levels up, but no HP/MP recovery and no XP reduction 


Edited by Binx, 21 February 2015 - 05:13 PM.


#34 justin

justin

    Adept

  • Members

Posted 21 February 2015 - 05:51 PM

So, I couldn't get your code to work with the counters I set up,


What was your problem with it?


As for your issue with your code, it sounds like it is this if statement that is never being evaluated true, so the stuff inside isn't running. Check your code that is setting those counters. Maybe run Trace statements before that if, one tracing each of those counters.

    if (Game->Counter[CR_XP] >= Game->Counter[CR_MAX_XP])


#35 Binx

Binx

    Formerly Lineas

  • Members
  • Real Name:Brian
  • Location:Lancaster, CA

Posted 21 February 2015 - 06:01 PM

I dunno, I tried setting up the custom counters on my subscreen, like normal, and tied them to the functions inside your script, but it just wouldn't register, anything. I'll try tracing it, but at least some of the if statement is running, that's what's confusing me. It's increasing the level. I added traces to the if statement and to all the functions, and they all printed out in allegro.log, so the compiler's definitely seeing that it SHOULD do something, there, but it's not.

 

EDIT:Here are some screenshots, if it helps explain things:

zelda195.png

zelda197.png

zelda198.png

 

See, if the thing was working properly, the XP (SP) totals (The first 4 digits on the top-left) in the second and third shots, should be 0 and 1, respectively, as the level (represented by the star) rises, and the HP(EP) and MP isn't being added (the dark ones on the bottom are full, light are empty, and vice-versa on top), like it should, it apparently IS being added, sometimes, but only when a heart container ISN'T being added, and I haven't levelled up enough to find if the same is true for MP, but I'd think so.

 

EDIT EDIT: Perhaps it's trying to add the HP before the HP increase? that would explain why the HP and MP recovery aren't working, I'm still stumped on the xp, though


Edited by Binx, 21 February 2015 - 06:46 PM.


#36 justin

justin

    Adept

  • Members

Posted 21 February 2015 - 06:46 PM

ok, well then i'd guess that either things are being displayed wrong on your subscreen.  or some of your values are wrong, like you're trying to set hp+16 but you didn't actually increase the max. trace each value, Trace(Link->MaxHP), Trace(Link->HP), etc.  compare with what you see on your subscreen.  if the traces are wrong, then you're math is wrong somewhere.  if the trace is correct, then it is being displayed wrong.



#37 Binx

Binx

    Formerly Lineas

  • Members
  • Real Name:Brian
  • Location:Lancaster, CA

Posted 21 February 2015 - 06:54 PM

Yeah, I wasn't adding to the max HP early enough. still trying to figure out why the XP isn't dropping, because without the level increase, that line of code works fine

 

EDIT: Yeah, I've tried tracing it, I've checked my math, I've checked the subscreen objects, it's just not subtracting the XP amount. Unless I take out the part that increases the level number, then it resets fine, it just doesn't increase level number.

 

MORE EDIT: I tried moving the XP reduction to the beginning of the next level, and I tried hardcoding the amount of XP I want drained, but neither did anything.

 

EVEN MORE EDIT: Figured it out, I was reducing CR_XP, but the game assigns CR_XP based on a function of CR_BASE_XP, by reversing the function, and removing the amount from the base xp, instead, it works exactly as intended.


Edited by Binx, 21 February 2015 - 07:54 PM.


#38 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 04 May 2015 - 11:21 PM

Updated, 5th May, 2015. The next update should include an XP table, and level functions that are easier to use (flexibility), but ZC counters won't work with that one without much shenanigans...
 
This version has a fair amount of added experimental code, and it's broken into separated library files.
 
Depends on stdCombos.zh (special, included version).

Here is a preflight library file that you may patch in, if desired:

RPG_Experimental_Ext.zh

This is how I'm approaching the revised awards system. A series of tables, that match the enemy editor indices.

Scripted enemies can give their own awards, and this allows saving registers of NPC data for something more valuable.

Versions that award based on enemy HP, will remain in future headers, but I'll be shifting focus over to the array versions, as when tired together, they will essentially give me expanded room for NPC->D,

Edited by ZoriaRPG, 05 May 2015 - 07:31 AM.


#39 kurt91

kurt91

    Follower of Destiny

  • Members
  • Real Name:Kurtis
  • Location:Eastern Washington University

Posted 10 July 2015 - 08:44 PM

I was looking into the mechanics behind the Kingdom Hearts games, trying to see where the stat cap was, and found an idea that you might want to add to your header.

 

In Kingdom Hearts II, you can create various items that increase an individual stat by one point. The cap on each stat appears to be something like 200. However, when you fight a boss battle, it sets a temporary cap of 80 on your stats (not HP, but damage stats like Attack, Defense, and Magic), so that you don't end up killing the boss in a single combo attack. This only applies to story-related boss battles and the various bonus bosses. Optional fights like in the Colosseum don't apply the lowered cap, so if you want to one-shot Cerberus or the full Final Fantasy crew in one massive AoE attack, you can do that.

 

Do you think that it would be a good idea to add a function to your header, to where either your stats are temporarily lowered when certain enemies or on screen or when you're on a specific screen in particular? I can imagine people wanting to add an RPG system to their game would appreciate players not being able to powergrind and instantly kill boss battles.



#40 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 12 August 2015 - 05:39 AM

The latest RPG.zh build is 0.97.4, with 0.97.5 forthcoming. I anticipate Alpha 1.0.0 by the end of the year.

At that point, I'll need some testers, and I plan no less than three template quest files, for people who want to make games based on the header, without needing scripting knowledge.

Your feedback is appreciated!

The latest RPG.zh build is 0.97.4, with 0.97.5 forthcoming. I anticipate Alpha 1.0.0 by the end of the year.

At that point, I'll need some testers, and I plan no less than three template quest files, for people who want to make games based on the header, without needing scripting knowledge.

More than anything, I;d appreciate some answers to the following:

  • Is anyone actually interested in using this.
  • Is anyone attempting to use RPG.zh?
  • Has anyone read through it?
  • What details, in terms of documentation, and support do you need?
  • What features do you feel you want to see perfected, first.
  • What would you want to see in the Alpha 1.0.0 package, that isn't already here?
Your feedback is greatly appreciated!

Mods: Feel free to post-merge again. I had to edit it, and couldn't due to the buffer length. :shrug:


Here's one of the newer extensions to RPG.zh:

Enemy Explosion Death Animations



[ ... ]

Edited by ZoriaRPG, 12 August 2015 - 05:47 AM.




Also tagged with one or more of these keywords: header, engine, alpha, xp, script, global, functions, rpg, rpgzh

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users