Problem with potions

https://attnam.com/topics/Problem-with-potions

The Cathedral of Attnam > Other Coding

#1 Dec 30, 2010, 9:44 am Hide

Mitsjol

So, I tried to add a 'bottle of milk' to the game. I first added a new liquid to material.dat and defined it in define.dat and then I added the liquid in the following code:

potion /* materialcontainer-> */
{
  DefaultSize = 30;
  Possibility = 800;
  WeaponCategory = BLUNT_WEAPONS;
  Category = POTION;
  DefaultMainVolume = 60;
  DefaultSecondaryVolume = 1000;
  StrengthModifier = 50;
  BitmapPos = 0, 160;
  FormModifier = 25;
  NameSingular = "bottle";
  MainMaterialConfig == GLASS;
  SecondaryMaterialConfig = { 12, WATER, MILK, HEALING_LIQUID, OMMEL_URINE, POISON_LIQUID, VALDEMAR, ANTIDOTE_LIQUID, VODKA, TROLL_BLOOD, OMMEL_SWEAT, OMMEL_TEARS, SULPHURIC_ACID; }
  MaterialConfigChances = { 12, 100, 55, 75, 5, 50, 1, 10, 5, 25, 5, 5, 25; }
  Alias = { 2, "potion", "drink"; }
  Roundness = 70;
  CanBeBroken = true;
  AttachedGod = NONE;
  WieldedBitmapPos = 176, 144;
  IsValuable = false;
  TeleportPriority = 200;
}

The milk is actually working ingame, but for some reason the material last in line (sulphuric acid) isn't ingame anymore, I tried wishing a bottle of sulphuric acid and it doesn't recognize the item.

So, what's going on here?
#2 Dec 30, 2010, 12:08 pm Hide

capristo

I'm pretty sure you can't wish for a certain liquid. If you wish for a bottle of something, it'll just give you a bottle with a random liquid. Try wishing for dozens of bottles, i bet you find a sulphuric acid one eventually.
#3 Dec 30, 2010, 3:38 pm Hide

4zb4

Cap's right. You could however make a sub-category of potion and make it so the only liquid it has is sulphuric acid and then wish for it. You could also do that for milk.

e.g.
  Config POTION_CARTON;
  {
    SecondaryMaterialConfig == MILK;
    Possibility = 10;
    NameSingular = "milk carton";
  }
#4 Dec 30, 2010, 5:19 pm Hide

Ischaldirh

Though a carton made of glass that looks like a bottle would be kinda weird...
#5 Dec 30, 2010, 6:55 pm Hide

Eagle V

Ischaldirh wrote
Though a carton made of glass that looks like a bottle would be kinda weird...

Weirder than an adventurer that gets his arms and legs blown off, and after some rest, just rolls on?
#6 Dec 31, 2010, 10:22 pm Hide

fejoa

Following on from 4zb4's code, and with regard to the wierdness of the carton made of glass, could the carton be made from Parchment, and have a unique bitmap position (resembling a carton) in the file item.pcx?

e.g.

Config POTION_CARTON;
{
    SecondaryMaterialConfig == MILK;
    Possibility = 10;
    NameSingular = "milk carton";

    BitmapPos = [i]x(milk carton picture)[/i], [i]y(milk carton picture)[/i];
    MainMaterialConfig == PARCHMENT;
}

#7 Jan 1, 2011, 3:42 pm Hide

capristo

there's such thing as bottled milk
#8 Jan 1, 2011, 3:56 pm Hide

BDR

Been quite some time since the days of the milkman. (most of my milk comes in gallon jugs)
#9 Jan 1, 2011, 6:48 pm Hide

fejoa

- Maybe someday there will be a side quest to lure (you would have to polymorph into a mistress) a milkman from the Gloomy Caves back to Attnam to deliver Ommel milk to the Cathedral... resulting in a newborn Bastard Son/Daughter revolutionary born to one of Petruses wives.

- Zombie of a Milkman.

- Perhaps female characters could be programmed to lactate?

Sorry to hijack the thread. In light of capristo's reminder, it would still be cool to create a milk bottle shaped graphic.
#10 Jan 1, 2011, 11:39 pm Hide

chaostrom

chaostrom wrote
<mortsoahc> Planplan 1468 today "Or eat it before an explosion make it explode ^^"
<mortsoahc> Sophia 1150 today "Lactose Intollerant, sorry."
<mortsoahc> lawl
<mortsoahc> milk explodes!
*** Shererax has quit ("shit")
<mortsoahc> that's right
<mortsoahc> next time I meet Sherarax I'mma blow her up with milk
<Bored> XD
<Somagu> I thought you said blow up her milk
<mortsoahc> LOL!
<Somagu> I was like, whooaa cowboy
#11 Jan 2, 2011, 11:54 am Hide

BDR

Warheck wrote
- Perhaps female characters could be programmed to lactate?

Elona's got that territory covered and more. I don't think IVAN needs to do it too.