healthpotion (RPG)

Having issues not related to a specific Sandbox game mode? Get help here!
Please also read the rules for support when posting support requests.
Failure to comply with the forum rules may result in your topic being locked without resolution.
User avatar
wildflower
Member
Member
Posts: 76
Joined: August 11th, 2011, 5:10 am
Name: Sandie

healthpotion (RPG)

Postby wildflower » January 14th, 2012, 11:50 am

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.

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

Re: healthpotion (RPG)

Postby Hirato » January 14th, 2012, 10:24 pm

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.
This is not a url, clicking it is pointless

User avatar
wildflower
Member
Member
Posts: 76
Joined: August 11th, 2011, 5:10 am
Name: Sandie

Re: healthpotion (RPG)

Postby wildflower » January 21st, 2012, 11:52 am

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?

chocolatepie33
Support Team
Support Team
Posts: 2458
Joined: April 27th, 2010, 5:31 pm
IRC Username: CP

Re: healthpotion (RPG)

Postby chocolatepie33 » January 21st, 2012, 9:10 pm

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?
Julius wrote:Contribute to http://www.opengameart.org NOW!

Save the wiki!

User avatar
kddekadenz
Member
Member
Posts: 423
Joined: July 17th, 2011, 11:02 am
Name: kdd
Contact:

Re: healthpotion (RPG)

Postby kddekadenz » January 22nd, 2012, 4:08 am

-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?
Kelgar is an advanced RPG beeing developed in Sandbox

User avatar
kddekadenz
Member
Member
Posts: 423
Joined: July 17th, 2011, 11:02 am
Name: kdd
Contact:

Re: healthpotion (RPG)

Postby kddekadenz » January 31st, 2012, 3:17 am

@hirato: Could you please give me the right command (read prev post)?
Kelgar is an advanced RPG beeing developed in Sandbox

User avatar
wildflower
Member
Member
Posts: 76
Joined: August 11th, 2011, 5:10 am
Name: Sandie

Re: healthpotion (RPG)

Postby wildflower » January 31st, 2012, 9:59 am

I'm happy to hear that I'm not the only one having problems with this :-)

User avatar
wildflower
Member
Member
Posts: 76
Joined: August 11th, 2011, 5:10 am
Name: Sandie

Re: healthpotion (RPG)

Postby wildflower » February 1st, 2012, 6:46 pm

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.

User avatar
jSoftApps
Member
Member
Posts: 426
Joined: May 2nd, 2011, 10:02 pm
Name: J.R.
IRC Username: jSoftApps
Location: jSoft Apps Software Innovations HQ
Contact:

Re: healthpotion (RPG)

Postby jSoftApps » February 1st, 2012, 6:51 pm

This is really good coding. I might have to use this
jSoft Apps Software Innovations - App, Games and More!
Visit our Website!

Image

jSoft Apps is now on indie db!
Image

User avatar
wildflower
Member
Member
Posts: 76
Joined: August 11th, 2011, 5:10 am
Name: Sandie

Re: healthpotion (RPG)

Postby wildflower » February 1st, 2012, 7:14 pm

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:


Return to “Sandbox General Support”

Who is online

Users browsing this forum: No registered users and 1 guest