Debugging Combat

Chat and ask questions about the RPG Maker Mode here.
Lou
Member
Member
Posts: 59
Joined: May 29th, 2012, 11:46 am
Name: Lou

Debugging Combat

Postby Lou » August 26th, 2012, 11:44 pm

Hi,
I followed the tutorials and created my melee combat scenario and I can kill my mob, Yay!!!
Now I want to be able to see the effects of combat in my console and I wanted to know, how
do I see the stats and values for the critter and the combat with the critter? Is there a debug command I can put around the
scripts to print out the data to the console?
Regards,
Lou

Hirato
Developer
Developer
Posts: 689
Joined: May 30th, 2009, 1:23 pm
IRC Username: hirato

Re: Debugging Combat

Postby Hirato » August 27th, 2012, 10:59 pm

Turn on the status, projectile and entity debug channels.
You'll find most of the details in the "status effect" submenu anyhoo
This is not a url, clicking it is pointless

Lou
Member
Member
Posts: 59
Joined: May 29th, 2012, 11:46 am
Name: Lou

Re: Debugging Combat

Postby Lou » August 28th, 2012, 1:55 pm

Hi,
Thanks for the info, I had most of this stuff on, I turned on the "status effects" but I did not
get any more data printed out.
Now worries I am going to keep digging and coding.
Lou

Lou
Member
Member
Posts: 59
Joined: May 29th, 2012, 11:46 am
Name: Lou

Re: Debugging Combat

Postby Lou » August 28th, 2012, 2:55 pm

Hi,
Okay it looks like it did add more but I found it in the STDOUT file.

Code: Select all

DEBUG: pushed rpgchar type 0A7D5890 onto reference self
DEBUG: registering end-of-stack reference 00000000 to name actor
DEBUG: reference actor set to null
DEBUG: searching for reference ent, via reference self:0
DEBUG: reference "self" found, returning 0A8A2480
DEBUG: searching for reference obj, via reference player:0
DEBUG: reference "player" found, returning 06EAA298
DEBUG: reference "self" found, returning 0A8A2480
DEBUG: clearing AI directives for entity 0A7D5890
DEBUG: reference "self" found, returning 0A8A2480
DEBUG: reference "player" found, returning 06EAA298
DEBUG: adding attack directive to entity 0A7D5890; target 025BDFE8 priority 1
DEBUG: popping stack...
DEBUG: freeing reference actor
DEBUG: freeing reference self
DEBUG: new depth is 1
DEBUG: reference hover set to null
DEBUG: freeing reference examine
DEBUG: freeing reference inventory
DEBUG: freeing reference curmap
DEBUG: freeing reference talker
DEBUG: freeing reference trader
DEBUG: freeing reference looter
DEBUG: freeing reference hover
DEBUG: freeing reference player

I can see the attack directive kicked off, but I was hoping for the stats and values too.
Lou

Lou
Member
Member
Posts: 59
Joined: May 29th, 2012, 11:46 am
Name: Lou

Re: Debugging Combat

Postby Lou » August 28th, 2012, 3:21 pm

WOOT!!!!
I got one step closer to what I needed!!!
I modified the hud_standard file with the following:

Code: Select all

//Mod by Lou
r_hud [
   if (!= (r_get_state player) $CS_DEAD) [
      if (!= (r_reftype hover) $REF_INVALID) [
         local str
         local str2   //<---------Add a second local variable here
         case (r_reftype hover) $REF_ITEM [
            r_select_item hover [
               str = (format "%1 (%2)" (r_item_name_get) (r_item_quantity_get))
            ]
         ] $REF_CONTAINER [
            if (|| (= (r_get_faction hover) -1) [= (r_get_faction player) (r_get_faction hover)] [r_hostile player hover]) [
               str = (r_get_name hover -1)
            ] [
               //not yours and faction friendly - warn
               str = (concatword "^f3" (r_get_name hover -1))
            ]
         ] () [
            str = (r_get_name hover -1)
            str2 = (r_get_health hover)  //<--------Get the health of the critter you hover over
         ]
                       
                        //Add the string to the end of the display so that it shows after the name------------|
         r_hud_text (divf (-f $hud_right (text_width $str)) 2) (+f (divf $hud_bottom 2) 16)  1 0xFFFFFF $str $str2
      ]
      //**This is the Minimap HUD placement code
      //old hud_bottom 456)
      r_hud_minimap player (- $hud_right 288) (- $hud_bottom 1200) 256 256


Now when I mouse over the Enemy as I swing my sword I see his health drop as well as see him REGEN his health!!!!
Enjoy
Lou

Lou
Member
Member
Posts: 59
Joined: May 29th, 2012, 11:46 am
Name: Lou

Re: Debugging Combat

Postby Lou » August 29th, 2012, 11:12 pm

Hi,
Can you please give me a break down of the Status Bar Parms. I want to try and put a health bar above the head instead of a number.
So far I have this:

Code: Select all

//This is the standard text above the head and the bar will be ontop of this for now.
r_hud_text (divf (-f $hud_right (text_width $str)) 2) (+f (divf $hud_bottom 2) 16)  1 0xFFFFFF $str $str2
//Try to put a status health bar above the hover target
statusbar (divf (-f $hud_right) 2) (+f (divf $hud_bottom 2.5) 5) 1 (r_get_health hover) (r_get_maxhealth hover) 0xFF0000 1 0

The max health works but there is no bar in red so I must not have something right with the parms?
I searched around and I cannot find any DOC on the status bar is this a new GUI feature?
Regards,
Lou

Lou
Member
Member
Posts: 59
Joined: May 29th, 2012, 11:46 am
Name: Lou

Re: Debugging Combat

Postby Lou » September 1st, 2012, 4:55 pm

Hi,
In order to hover over items and not have them show the health too, you can add a check for a $REF_CHAR type.

Code: Select all

if (r_reftype) $REF_CHAR [
     str2 = (r_get_health hover)
] [ //Else path for character check
    str2 = " "
 ] 


Have Fun,
Lou

Lou
Member
Member
Posts: 59
Joined: May 29th, 2012, 11:46 am
Name: Lou

Re: Debugging Combat

Postby Lou » September 3rd, 2012, 10:29 pm

I see now. The status bar is defined right in the hud file.
I totally missed it.

Hirato
Developer
Developer
Posts: 689
Joined: May 30th, 2009, 1:23 pm
IRC Username: hirato

Re: Debugging Combat

Postby Hirato » September 3rd, 2012, 11:00 pm

the HUD stuff is a 2.7.1 feature, the HUD in its entirety is defined in the cfg, excepting the "hudlines"

http://www.svn.kids.platinumarts.net/32 ... rpghud.cpp

Code: Select all

   ICOMMAND(r_hud_minimap, "sffff", (const char *r, float *x, float *y, float *dx, float *dy),
   ICOMMAND(r_hud_horizbar, "sfffffii", (const char *i, float *x, float *y, float *dx, float *dy, float *p, int *col),
   ICOMMAND(r_hud_vertbar, "sfffffi", (const char *i, float *x, float *y, float *dx, float *dy, float *p, int *col),
   ICOMMAND(r_hud_text, "fffis", (float *x, float *y, float *sz, int *col, const char *s),
   ICOMMAND(r_hud_image, "sffffi", (const char *i, float *x, float *y, float *dx, float *dy, int *c),
   ICOMMAND(r_hud_solid, "ffffi", (float *x, float *y, float *dx, float *dy, int *c),

   ICOMMAND(hudline, "C", (const char *t), hudline("%s", t));

   ICOMMAND(r_hud, "e", (uint *body),


those are the prototypes - they're the closest to actual documentation that currently exists.
key
  • e - requires code/script
  • s/C - string
  • i - integer
  • f - floating point
  • *i - I should've used *tex - refers to an image file
  • x/y+dx/dy | sz - refers to offsets and size
  • *c - colour, eg 0xFFFFFF for white
This is not a url, clicking it is pointless

Lou
Member
Member
Posts: 59
Joined: May 29th, 2012, 11:46 am
Name: Lou

Re: Debugging Combat

Postby Lou » September 6th, 2012, 1:32 pm

Thanks Hirato that helps a bunch,
I wanted to add a portrait of the player instead of just his name so I will add that and post back with a sample.
Lou


Return to “RPG Maker Mode”

Who is online

Users browsing this forum: No registered users and 1 guest