Page 1 of 2

healthpotion (RPG)

Posted: January 14th, 2012, 11:50 am
by wildflower
How do I make a healthpotion? (or any kind of potion)

I know how to make the model and how to use it as a item in the game, but that's as far as I can come.
I suspect that it has something to do with concumables, but the only health-related I have figured out is r_health_get and there doesn't seam to be a r_health_set.

Re: healthpotion (RPG)

Posted: January 14th, 2012, 10:24 pm
by Hirato
You'd want to add a health related status group to the item, but with that said, consumables aren't implemented yet.

The easiest way to work around this is to rely on healing abilities...

There is slightly more difficult way...
You will need to define the health potion as a weapon with a target of T_SELF, a use cost of 1 and it must reference an ammotype.
The ammotype should contain one item entry, that of the health potion you're consuming.

That setup is more intended for throwing weapons (knives, bombs, rocks, etc) but it should suffice.

Re: healthpotion (RPG)

Posted: January 21st, 2012, 11:52 am
by wildflower
I have spent several hours trying to figure this out :oops:
But I still don't understand how it is possible to set the amount of health a potion gives?

I'm not a particular skilled programmer, but I'm an awesome "cut&paste"-er ;-)
Unfortunately there doesn't seam to be any PAS-projects (rpg) that use potions or healing?

Re: healthpotion (RPG)

Posted: January 21st, 2012, 9:10 pm
by chocolatepie33
I'm not so sure about this, I thought I saw something somewhere about potions having damage variables of "-1" to restore health. Would that work?

Re: healthpotion (RPG)

Posted: January 22nd, 2012, 4:08 am
by kddekadenz
-2 is health, -1 is mana (correct me if I'm wrong).
I'm on it. I managed it already that it can heal you, now I just need to create the ammo.

EDIT: 'r_ammo_additem is a unknown command' :(
How is the correct command?

Re: healthpotion (RPG)

Posted: January 31st, 2012, 3:17 am
by kddekadenz
@hirato: Could you please give me the right command (read prev post)?

Re: healthpotion (RPG)

Posted: January 31st, 2012, 9:59 am
by wildflower
I'm happy to hear that I'm not the only one having problems with this :-)

Re: healthpotion (RPG)

Posted: February 1st, 2012, 6:46 pm
by wildflower
I managed to make a working healing spell :D

Code: Select all

// Healing spell

r_item_name "Healing spell"
r_item_icon "items/healing.png"
r_item_description "A simple healing spell"
r_item_mdl "sandie/scroll"
r_item_worth 25
r_item_weight 1
r_item_script 7
r_item_use_new_weapon // 0
r_item_use_name "Healing spell"
r_item_use_description "A simple healing spell"
r_item_use_new_status 1 $STATUS_HEALTH -0.2 1
r_item_use_cooldown 400
r_item_use_chargeflags (| $CHARGE_RADIUS $CHARGE_MAG)
r_item_use_slots $SLOT_RHAND
r_item_use_skill $SKILL_MAGIC
r_item_use_cost 10
r_item_use_pflags (| $P_VOLATILE $P_TIME)
r_item_use_target $T_SELF
r_item_use_charge 200
r_item_use_basecharge .5
r_item_use_mincharge .5
r_item_use_maxcharge 1.5
r_item_use_elasticity 0
r_item_use_speed 2
Not sure about what all the stuff does yet, and it is very likely that it's not the right way of doing it, But it works :mrgreen:

I know it's not a healthpotion yet, but it is progress and I can use it as a temporary replacement for potions.

Re: healthpotion (RPG)

Posted: February 1st, 2012, 6:51 pm
by jSoftApps
This is really good coding. I might have to use this

Re: healthpotion (RPG)

Posted: February 1st, 2012, 7:14 pm
by wildflower
jSoftApps wrote:This is really good coding. I might have to use this
Thanks :D

Now I just have to figure out WHY it works :lol: