Jump to content

Photo

RPG-like stats


  • Please log in to reply
3 replies to this topic

#1 OmegaX

OmegaX

    Leader of Omega GamingHunters101

  • Members
  • Real Name:Matthew
  • Location:Rochester, NY

Posted 08 May 2018 - 01:39 PM

I hope this is something easy to do but I'm going to ask anyway. I have 5 different stats, HP, MP, ATK, DEF, SPD. HP increases by 16 each time (same thing as getting heart containers). MP increases by 32 each time (just like getting magic containers). ATK increases by the weapons damage times 2. DEF increases by the damage divider for rings times 4. I want to put these into counters in the active sunscreen (inventory) So where the player can see them. How do I go about doing that?

#2 Saffith

Saffith

    IPv7 user

  • ZC Developers

Posted 08 May 2018 - 02:34 PM

The big question is: how do the stats increase? Do you want an experience system, or do these stats just reflect your inventory, or something else?



#3 OmegaX

OmegaX

    Leader of Omega GamingHunters101

  • Members
  • Real Name:Matthew
  • Location:Rochester, NY

Posted 08 May 2018 - 02:52 PM

They reflect inventory. For example, if link get the master sword he will get 16 ATK (The weapons damage *2). Same thing would go for weapons like the wand, arrows, etc. DEF increases by the damage divider by the rings and multiples it by 4, so having the blue ring would give link 8 DEF (Damage divider would still remain the same).

Edited by MegaX, 08 May 2018 - 02:56 PM.


#4 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 24 May 2018 - 04:42 AM

You have two options:

1. Counters
Every frame, prior to Waitdraw(), copy your stat values (each) to a counter, and display the counter on your subscreen.

2. Script Drawing
Every frame, prior to Waitdraw(), you can draw the values to the passive subscreen. I suggest this logic tree:

void DrawStat(int s_type, int value) 
{

     //s_type is a constant, value is the variable or array 
     //where the stat is stored.

     int s_buffer[256];
     int str_stat_att[]="Attack: "; //0
     int str_stat_def[]="Defense: "; //1
          //add for each type
     int buf2[5]; itoa(buf2,value);
     if ( s_type == S_ATTACK ) { strcat(s_buffer,str_stat_att); }

          //string literals in 2.54 make this easier
          // strcat(s_buffer, "Attack: ");
     else if ( s_type == S_DEFEND ) { strcat(s_buffer, str_stat_def); }
          //add for each type
     else return; //invalid type
     strcat(s_buffer, buf2);
     Screen->DrawString(...); //use the args that you need to draw to the passive subscreen
}



Active Subscreen

Only counters will work.


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users