Items & Properties [Unanswered]

This forum is meant for posting anything related to Adventure Maker that doesn't fit in the other forums.Please post technical questions in the Technical Support Forum!

Moderators: time-killer-games, Vengeance66, Candle, reneuend, GM-Support

Items & Properties [Unanswered]

Postby Merrie » Mon Dec 31, 2007 4:20 am

Hum I might have run into a snag, I hope not.

Here is an example, lets say a player clicks on a picture of a chest and finds a potion, it drops into their inventory.

They have a health variable that = 100 points.

The potion has a property of add +10 points to health when its clicked on in the inventory or would you have to set up some type of 'use' button? to execute a script?

I know this would be something like (On click) (potion) add +10 points to health if health is not = > 100, else destroy potion.

I don't want them to use a potion that will increase their health over 100.

Can you add properties to items? Or do you need to do some other type of work around?

Thank you folks for being so patient and answering these questions.
Registered User - Full Edition - Commercial
Windows 7
User avatar
Merrie
Member
 
Posts: 29
Joined: Fri Mar 16, 2007 3:53 pm

Postby Chromegloss55 » Tue Jan 29, 2008 7:45 pm

I cannot believe someone hasn't answered this yet!

I'm not sure I understand the question, but here's my solution.

When the user clicks the hotspot have this code:

If Health < 100 then
Action.AddItem"Potion"
Else
Message "You can't carry anymore potions"
End If

This code will only add the item if the health is less than 100. Is this what you mean?
_________________
effects of the great depression
Last edited by Chromegloss55 on Tue Feb 24, 2009 3:10 pm, edited 1 time in total.
Chromegloss55
Forum Master
 
Posts: 630
Joined: Sat Nov 03, 2007 2:49 pm
Location: God Knows!

Postby Mystery » Tue Jan 29, 2008 7:59 pm

I must have overlooked this topic, I'm sorry :oops:

I think if the maximum of the health should be 100, and the potion has a health value of 10, then it should rather look something like this:

Code: Select all
If Health <= 90 then
  Action.AddItem"Potion"
  Health = Health + 10
Else
  Message "You can't carry anymore potions"
End If
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby Chromegloss55 » Tue Jan 29, 2008 8:29 pm

Oh right...

I thought that when you click the Potion, health isn't added straight away... I thought you had to manually use the potion on the character...

Well, the code is still pretty much the same anyway...
_________________
Chronic Fatigue Forum
Chromegloss55
Forum Master
 
Posts: 630
Joined: Sat Nov 03, 2007 2:49 pm
Location: God Knows!


Return to Adventure Maker General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests