Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
More newbie gumper problems :P
Author Message
Rayvolution
Journeyman
*

Posts: 135
Likes Given: 0
Likes Received: 2 in 2 posts
Joined: Jul 2012
Reputation: 1

Aetharia

Post: #1
More newbie gumper problems :P
In my grand plan to rewrite alchemy, I am removing the entire original skill menu and replacing it with recipes gumps. Basically, you create the potions off the "recipe gump" instead of the skill menu.

I completely disabled the normal alchemy skillmenu, and the only way to trigger MAKEITEM is via the recipe scrolls I created. But, I'm having one small problem.

When the player moves away from the recipe item, I'd like the gump to close (Like how containers do when you walk away from them). Because I can't get the gump to close when someone leaves behind the recipe, it's allowing players to just leave the gump open. Assuming they never close the gump, the recipe itself is no longer required in the process and can be left behind.

To get around that, I have to do a RESTEST to see if they have the recipe on their person. That works great! But I'd like people to "read" recipes locked down in the alchemy stores or in other player's houses so they can "borrow" the recipes assuming they stay in the area while they're mixing. But, I can't do that because they can DClick the scroll and run off, and continue to make the potions as long as they never close the gump.

Here's the current gump, with the RESTEST to check if they have the recipe on their person.

Code:
[ITEMDEF i_alchemy_recipe_weak_poison]
ID=I_MAP_ROLLED
VALUE=50
NAME=Weak Poison Recipe
WEIGHT=1
CATEGORY=Infinity Items
SUBSECTION=Alchemy Recipes
DESCRIPTION=Weak Poison

ON=@DCLICK
SRC.DIALOG d_alchemy_recipe_weak_poison
RETURN 1

[DIALOG d_alchemy_recipe_weak_poison]
0,0
page 0
resizepic 34 59 9380 259 281
button 251 291 30009 30008 1 0 1
text 69 100 984 0
text 77 143 984 1
text 77 163 100 2
text 224 288 58 3
text 69 288 984 4
gumppic 250 95 1227
gumppic 58 125 2091
gumppic 58 273 2091
gumppic 60 145 2087
gumppic 60 165 2087
text 77 183 58 5
gumppic 60 185 2087

[DIALOG d_alchemy_recipe_weak_poison text]
Weak Poison
Mortar and Pestle
Small Bottle of Water
Mix
Skill Required: 15
3 Nightshade

[DIALOG d_alchemy_recipe_weak_poison button]
ON=1
// Button 1
//
IF (<SRC.ALCHEMY> < 15.0)
SRC.SYSMESSAGENEG You lack the skill to make this poison.
DIALOG d_alchemy_recipe_weak_poison
ELSE
IF (<SRC.RESTEST i_mortar_pestle>) && (<SRC.RESTEST 3 i_reag_nightshade>) && (<SRC.RESTEST 1 i_bottle_small_water>) && (<SRC.RESTEST 1 i_alchemy_recipe_weak_poison>)
SRC.EMOTE starts making a Weak Poison
SRC.SOUND 578
MAKEITEM=i_potion_weak_poison
DIALOG d_alchemy_recipe_weak_poison
ELSE
SRC.SYSMESSAGENEG you don't have all the required materials!
DIALOG d_alchemy_recipe_weak_poison
ENDIF
RETURN 1

Attached is a screenshot of the gump.


Attached File(s) Thumbnail(s)
   

[Image: 4_Logo.png]
An MMORPG based on the Ultima Online engine.
Completely Custom Map, GUI, AI, Combat, Skills, Crafts, Art, Music and so much more.
http://aetharia.com - Home of Ambition!
(This post was last modified: 07-30-2012 03:44 AM by Rayvolution.)
07-30-2012 03:42 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 246
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #2
RE: More newbie gumper problems :P
I really like your crafting ideaShock

For solving the problem, you can try this

PHP Code:
[FUNCTION near_alchemy_scroll]
FORITEMS 2 //Radius 2
 
IF <baseid> == <args// I don't remember to use ID or Baseid
        
return // I found the alchemy scrool i need!
ENDIF
ENDFOR
return 


So your if construct will look like
PHP Code:
IF (<SRC.RESTEST i_mortar_pestle>) && (<SRC.RESTEST 3 i_reag_nightshade>) && (<SRC.RESTEST 1 i_bottle_small_water>) && (<SRC.near_alchemy_scroll  i_alchemy_recipe_weak_poison>)
 
SRC.EMOTE starts making a Weak Poison
 SRC
.SOUND 578
 MAKEITEM
=i_potion_weak_poison
 DIALOG d_alchemy_recipe_weak_poison
 
ELSE
 
SRC.SYSMESSAGENEG you don't have all the required materials!
 DIALOG d_alchemy_recipe_weak_poison
 ENDIF
 RETURN 1 

I can't test it right now but i think the idea is right Big Grin
(This post was last modified: 07-30-2012 04:06 AM by darksun84.)
07-30-2012 04:05 AM
Find all posts by this user Like Post Quote this message in a reply
Rayvolution
Journeyman
*

Posts: 135
Likes Given: 0
Likes Received: 2 in 2 posts
Joined: Jul 2012
Reputation: 1

Aetharia

Post: #3
RE: More newbie gumper problems :P
HAH! It worked. Although I'd rather the GUMP close. But this is still a lot better than what I had. Wink

I did have to tweak it though, your script worked like a charm, but couldnt detect when the recipe was in your pack, so I still had to do the original RESTEST:
Code:
IF (<SRC.RESTEST i_mortar_pestle>) && (<SRC.RESTEST 3 i_reag_nightshade>) && (<SRC.RESTEST i_bottle_small_water>) && ((<SRC.near_alchemy_scroll i_alchemy_recipe_weak_poison>) || (<SRC.RESTEST i_alchemy_recipe_weak_poison>))

Once I complete my new alchemy system I plan on posting in here, it completely rewrites the entire system. I think a lot of people will like it, and it's a solid base for remaking other similar could-be recipe based skills, like Cooking for example.

But, in my new Alchemy system I have:
- 3 Bottle sizes (Small, Medium, Large. I made custom art for these.)
- You have to fill the bottles in a water source somewhere (Any water tile)
- You have to find the recipe for the potion you'd like to make
- Opening the recipe's GUMP will tell you what you need, and the skill requirements.
- Once you have the recipe, the correct bottle size (and filled with water), you click on the recipe and click "Mix"
- Checks and makes sure you have everything required, Triggers MAKEITEM
- The GUMP stays open once you click "Mix", so you just have to re-click "Mix" again to make a second potion. Making the process a little smoother too.

I also disabled @DCLICK on all the reagents, the mortar and t_empty_bottle, so people can't bring up the old skillmenu in any way shape or form. The only way to trigger MAKEITEM is via the recipe's mix button.

[Image: 4_Logo.png]
An MMORPG based on the Ultima Online engine.
Completely Custom Map, GUI, AI, Combat, Skills, Crafts, Art, Music and so much more.
http://aetharia.com - Home of Ambition!
(This post was last modified: 07-30-2012 04:21 AM by Rayvolution.)
07-30-2012 04:21 AM
Find all posts by this user Like Post Quote this message in a reply
Gil Amarth
Journeyman
*

Posts: 189
Likes Given: 2
Likes Received: 1 in 1 posts
Joined: May 2012
Reputation: 0



Post: #4
RE: More newbie gumper problems :P
In my crafting system (which it is with recipes too), I always store the position in a CTAG when the dialog is opened, and then when the player click the item that want to be crafted, I check his position with the position stored in the CTAG.

If the distance is greater than 2, then return a failure message.
(This post was last modified: 07-30-2012 06:51 AM by Gil Amarth.)
07-30-2012 06:49 AM
Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #5
RE: More newbie gumper problems :P
try using
Code:
IF (<SRC.CANMAKE i_potion_weak_poison>) && ((<SRC.near_alchemy_scroll i_alchemy_recipe_weak_poison>) || (<SRC.RESTEST i_alchemy_recipe_weak_poison>))
instead
Code:
IF (<SRC.RESTEST i_mortar_pestle>) && (<SRC.RESTEST 3 i_reag_nightshade>) && (<SRC.RESTEST i_bottle_small_water>) && ((<SRC.near_alchemy_scroll i_alchemy_recipe_weak_poison>) || (<SRC.RESTEST i_alchemy_recipe_weak_poison>))

and to close dialogs when move the item you must use
Code:
ON=@DClick
SDIALOG d_alchemy_recipe_weak_poison
return 1

ON=@PickUp_Pack
SRC.DIALOGCLOSE d_alchemy_recipe_weak_poison

ON=@PickUp_Ground
SRC.DIALOGCLOSE d_alchemy_recipe_weak_poison

btw you can optimize the code a bit Smile
Code:
[ITEMDEF i_alchemy_recipe_weak_poison]
ID=i_map_rolled
VALUE=50
NAME=Weak Poison Recipe
WEIGHT=1
CATEGORY=Infinity Items
SUBSECTION=Alchemy Recipes
DESCRIPTION=Weak Poison

ON=@DClick
SDIALOG d_alchemy_recipe_weak_poison
return 1

ON=@PickUp_Pack
SRC.DIALOGCLOSE d_alchemy_recipe_weak_poison

ON=@PickUp_Ground
SRC.DIALOGCLOSE d_alchemy_recipe_weak_poison

[DIALOG d_alchemy_recipe_weak_poison]
0,0
resizepic 34 59 9380 259 281
gumppic 250 95 1227
gumppic 58 125 2091
gumppic 58 273 2091
gumppic 60 145 2087
gumppic 60 165 2087
gumppic 60 185 2087
dtext 69 100 984 Weak Poison
dtext 77 143 984 Mortar and Pestle
dtext 77 163 100 Small Bottle of Water
dtext 69 288 984 Skill Required: 15
dtext 77 183 58 3 Nightshade
button 251 291 30009 30008 1 0 1
dtext 224 288 58 Mix

[DIALOG d_alchemy_recipe_weak_poison BUTTON]
ON=1
IF !(<SRC.CANMAKESKILL i_potion_weak_poison>)
  SRC.SYSMESSAGENEG You lack the skill to make this poison.
ELIF (<SRC.CANMAKE i_potion_weak_poison>) && ((<SRC.near_alchemy_scroll i_alchemy_recipe_weak_poison>) || (<SRC.RESTEST i_alchemy_recipe_weak_poison>))
  SRC.EMOTE starts making a Weak Poison
  SRC.SOUND 578
  MAKEITEM i_potion_weak_poison
ELSE
  SRC.SYSMESSAGENEG you don't have all the required materials!
ENDIF
SDIALOG d_alchemy_recipe_weak_poison
return 1
(This post was last modified: 07-30-2012 01:55 PM by Coruja.)
07-30-2012 01:30 PM
Find all posts by this user Like Post Quote this message in a reply
amonvangrell
Banned

Posts: 338
Likes Given: 17
Likes Received: 32 in 20 posts
Joined: Aug 2012

britannia shard

Post: #6
RE: More newbie gumper problems :P
coruja why i dont know as much as you... damn... ;d
04-22-2013 07:11 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #7
RE: More newbie gumper problems :P
Can we PLEASE look at the dates of the previous post before we drag up threads that have been dormant for 6+ months?
Thanks

[Image: 2nis46r.jpg]
04-22-2013 07:17 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)