PDA

View Full Version : Working on a chemistry set


Frenchie
24th Jan 2009, 10:41 PM
Hello,
I've been working on a chemistry set inspired by the one from Livin' Large. So far, thanks to Echo's tutorials I've managed to make a skilling BHAV to make the sim using it gain Logic and to make the skill gain message appear on the right hand side of the screen.

http://www.modyourpanties.com/images/090124074116-ChemistrySet2.jpg

However, I'll need to ask more questions about how to make it a truly awesome item here.

First question: I'd like an item to appear next to the chemistry set after a set amount of time (say 6 sim hours) of working on it. Those six hours wouldn't have to be six hours in a row, it'd somewhat work like an easel, on which you can resume your work. How could I do that?

Later functions I'd wish to implement:
- the item generated is random (different potions modded from the NL ones... maybe even gold?)
- sims with under 5 logic may, now and then, set the chemistry set on fire.
- different potions may include: maxing out of three random motive bars (or just one), disease, evil clone (NPC that would copy the appearance of the drinker?), cure for the disease...

But so far, I only need the know-how to make potions appear after a certain time of working on the set :D Can someone help?

Numenor
25th Jan 2009, 12:31 AM
You could include in the main interaction BHAV a line that increase by 1 unit an object attribute at each loop; then, add a check for the attibute value: if it's greater than a given constant, the "item" is created next to the chemistry set and the attribut is reset to zero. If I remember well, I used a similar technique in my ZX Spectrum, to store the owner and the progress of the program writing.

As for choosing a random potion, the easiest way (though not particularly elegant, but effective nonetheless) is to get a Random number and use it to create the potion by GUID. For example, if you have 4 potions:
- Temp0 =: Random number from 0 to 3
- If Temp0 = 0 then create potion with GUID 0xAAAAAAAA
- If Temp0 = 1 then create potion with GUID 0xBBBBBBBB
etc...

As for setting the chemical on fire, look in the code for cooking meals: it works exactly that way (if cooking skills are less than minimum, there is high chance of filre).


PS: though still without texture, the chemical set looks gorgeous! But pay particular attention to the poly counts: spirals are the Black Beast of the 3D modelers! ;)