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

Re: Debugging Combat

Postby Lou » September 6th, 2012, 3:48 pm

Hi,
I was able to get a portrait added to the hud.
Watch the dx and dy because they are image size parms in r_hud_image command.
See Hirato's legend that he put under the commands.

HUD.png

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

Re: Debugging Combat

Postby Hirato » September 6th, 2012, 9:26 pm

not as compact as mine, but still pretty nice; good work!
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 9th, 2012, 11:43 am

Thanks, I have a long way to go before things start getting looking good. :)

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

Re: Debugging Combat

Postby Lou » September 9th, 2012, 2:57 pm

Hi,
I seem to have done something wrong. I noticed that I am never taking any damage from the wolf.
I can attack the wolf and kill it with my sword. But I expect to take some damage and never do.
I created the status for the fangs:

Code: Select all

//Fang damage
r_status_friendly 0 //this is decidedly hostile
// instantly remove 20 HP
r_status_addgeneric $STATUS_HEALTH -20 


I created the fang item:

Code: Select all

r_item_name "Fangs"
r_item_description "If you see this, submit a bug report."
r_item_use_new_weapon // 1
r_item_use_cooldown 5
r_item_use_new_status 2 $ATTACK_SLASH 1
r_item_use_slots (| $SLOT_LHAND $SLOT_RHAND)
r_item_use_skill $SKILL_MELEE
r_item_use_range 10
r_item_use_cost 0
r_item_use_target $T_HORIZ
r_item_use_chargeflags $CHARGE_MAG
r_item_use_angle 8 //degrees
r_item_use_lifetime 0
r_item_use_recoil -5
//r_item_use_projeffect -1
//r_item_use_traileffect -1
//r_item_use_deatheffect -1


I added the script to trigger the combat:

Code: Select all

//Critter Wolf Script
//include default script
include scripts/1

//Notice faction checking is in place but in simple mode
//If you try to talk he will attack
r_script_signal talk [
  if (!= (r_get_faction self) (r_get_faction actor)) [
    r_action_clear self
    r_action_attack self actor
  ]
]

//If you hit him he will attack
r_script_signal hit [
  if (!= (r_get_faction self) (r_get_faction actor)) [
  if (= (r_get_state self) $CS_ALIVE) [
    r_action_clear self
    r_action_attack self actor
   ]
 ]
]

//If you are close to him he will attack
r_script_signal update [
  if (r_cansee self player) [
    r_action_clear self
    r_action_attack self player
  ]
]

//If you bump him he will attack
r_script_signal collide [
  if (!= (r_get_faction self) (r_get_faction actor)) [
    r_action_clear self
    r_action_attack self actor
  ]
]

r_script_signal spawn [
  //r_action_wander self 0 96 0
  //Add his weapons and equip it
  r_additem self 1 1
  r_equip self 1 0
]


Way points are not added yet.
Can you tell me if I missed something?
Regards,
Lou

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

Re: Debugging Combat

Postby Hirato » September 9th, 2012, 6:23 pm

things look right, can't be sure without knowing the indices... but this part.

Code: Select all

r_script_signal spawn [
  //r_action_wander self 0 96 0
  //Add his weapons and equip it
  r_additem self 1 1
  r_equip self 1 0
]


The second argument should be an item reference, I'm surprised the game isn't annoying you with warnings.
You want this.

[code]
r_script_signal spawn [
//r_action_wander self 0 96 0
//Add his weapons and equip it
r_additem self 1 1 [ r_equip actor self 0 ]
]
[/code[
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 9th, 2012, 8:19 pm

It Works!!!!!!
That was what it was, thanks.
I was getting an error but it was generic and not script specific so I was not sure where it was coming from.
Lou


Return to “RPG Maker Mode”

Who is online

Users browsing this forum: No registered users and 1 guest