Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Forum Resident
Original Poster
#1 Old 25th Jan 2009 at 3:20 AM Last edited by The_French_Sim : 28th Jan 2009 at 4:22 PM.
Default My chemistry set: miscellaneous, time-variant BHAV questions (NL required)
Hello,
I've been working on a chemistry set object and making two functions. One is called "SCIENCE!!" and is basically logic improvement. It increases the potionprogress attribute of the set by 1 every loop and, for testing purposes, is supposed to run the Potion Creation BHAV (consisting of a resetting of potionprogress, a surprised animation, a message about a potion appearing and the creation of a bottle of Vampirocillin) after four loops. The problem is that I get an "Undefined transition" error every time it's supposed to run that procedure. Am I linking my BHAVs the wrong way? Is there more to it than choosing the BHAV as an operation with no argument? What exactly is wrong with my package?

Thanks in advance!

PS: I've put the potion creation BHAV in the debug menu for easy access.
Attachments Pending Approval
File Type: rar TFS_ChemistrySet.rar
Advertisement
Fat Obstreperous Jerk
#2 Old 25th Jan 2009 at 3:30 AM
Undefined transition means you have a dangling FFFC. Don't make things lead to FFFC unless you WANT this to happen.

Grant me the serenity to accept the things I cannot change, the courage to change the things I cannot accept, and the wisdom to hide the bodies of those I had to kill because they pissed me off.
Forum Resident
Original Poster
#3 Old 25th Jan 2009 at 4:02 AM
Thank you, Pescado. After fixing that, I noticed that the animation plays, the message is displayed... but the Vampirocillin is missing. Am I putting the wrong GUID in, or is it an operand problem?
Fat Obstreperous Jerk
#4 Old 25th Jan 2009 at 9:01 AM
Not a clue. I did take a look at the code and there are FFFCs everywhere, though. You might want to remove all that and update it. Plus it looks like the GUID is pointing at a love potion, but even then, you should be getting SOMETHING. Is your create object failing because you are passing it funny arguments?

Grant me the serenity to accept the things I cannot change, the courage to change the things I cannot accept, and the wisdom to hide the bodies of those I had to kill because they pissed me off.
Forum Resident
Original Poster
#5 Old 25th Jan 2009 at 1:09 PM
I don't seem to have been able to find a tutorial for Create New Object Instance, or a page where the operands were explained, so I thought I'd be pretty much safe setting all the arguments but the GUID to 0. I've attached the new file that goes through the potion creation procedure fine and without errors, except for the fact that it creates absolutely nothing.
Attachments Pending Approval
File Type: rar TFS_ChemistrySetNoPotionCreated.rar
The ModFather
retired moderator
#6 Old 25th Jan 2009 at 6:50 PM
Personally, I don't like to get rid of all the Targets pointing to "Error" (FFFC): if an object causes an error, I'd like to know
In fact, your "fixed" chemistry set didn't spawn any error message, but still the potion wasn't created: you've swept the dust under the carpet, but the dirt is still there

I've restored the original Target to "Error" and tested the object; as expected, I got the error message, revealing that there was a problem while creating the potion.
Then, I've implemented a "safe" creation method:
1) create the object "out of the world";
2) find a suitable location (empty tile) for it near the sim;
3) if this is not possible, find a suitable location near the chemistry table;
4) if still it's not possible, spawn a debug message informing that the potion couldn't be created.

Result: the potion is correctly created As pointed out by Pescado, you used the GUID for the love potion, not the Vamprocillin, but apart from that, the postion is correctly placed in the lot, near the sim. Multiple potion creations are allowed, because the "Find Location For" opcode does not try one specific tile, but tries different ones before failing.

Screenshot 1: the potion created by Randy is created (the nearest free tile is the one behind Rhonda);
Screenshot 2: during a storm, the table was hit by a lighting and burned (the fire extinguished itself after some minutes, without damaging the table).

Find attached the fixed package.
Screenshots
Attachments Pending Approval
File Type: rar TFS_ChemistrySet.rar

I've finally started my Journal. Information only, no questions.

My latest activity: CEP 9.2.0! - AnyGameStarter 2.1.1 (UPD) - Scriptorium v.2.2f - Photo & Plaques hide with walls - Magazine Rack (UPD) - Animated Windows Hack (UPD) - Custom Instrument Hack (UPD) - Drivable Cars Without Nightlife (UPD) - Courtesy Lights (FIX) - Custom Fence-Arches - Painting-TV - Smarter Lights (UPD)


I *DON'T* accept requests, sorry.
Forum Resident
Original Poster
#7 Old 25th Jan 2009 at 7:40 PM
Thanks Numenor! I'll try to understand how to use the correct arguments for the "Find Location For" primitive by studying your code.
Since I'm in the middle of revision for an exam, I'll edit the thread to "solved" later, if I have no more questions about it.
Forum Resident
Original Poster
#8 Old 28th Jan 2009 at 4:20 PM Last edited by The_French_Sim : 28th Jan 2009 at 4:27 PM.
Some of my potions appear to not work correctly, for example, the Happy potion, supposed to make your sim go platinum, or the Transparency potion (guess) do nothing. I think I may have made a mistake in the Expression operands, when I choose "My aspiration score := 100 (decimal)", it does nothing, when I choose "Stack object's aspiration score := 100 (decimal)", I get a "Must be a person" error, leading me to believe the stack object is the potion. Same goes for the transparency potion, where "Set my alpha" doesn't seem to change anything. The animations placed after the expression functions work fine, though, so there's no error.
I've attached the two potions. Sadly, they're both shaped like a florence flask with a smiley face on it, but both are available in the general-misc section of buy mode, with an explicit description (the name of the item is "mysterious chemical" in both cases though). If someone could tell me how to fix the mistake, I'd love it Thanks in advance
Attachments Pending Approval
File Type: rar TFS_Potions.rar
Retired Duck
retired moderator
#9 Old 29th Jan 2009 at 9:08 AM
With the transparency, I think you need to set "My Render Flags" to 0x3 first, which tells it that it has to render the sim with transparency. I've found that an alpha of about 0x40 looks pretty good.
The ModFather
retired moderator
#10 Old 29th Jan 2009 at 10:00 PM
Apparently, your "Happy Potion" should work with "My aspiration score := 100 (decimal)", but it doesn't. So I checked the "Sim Modder" object that comes with NL: among the various functions, it can set the level of the Aspiration, and even change the Aspiration type.
The Sim Modder (GroupID 0x7FFFAA02) performs the trick by calling the BHAV "Aspiration - Cheat" from the PersonGlobals; and this BHAV is interesting, because it doesn't contain instructions like "My aspiration score := ...". The technique used is completely different (some Temps are set, and then the sim wants are recalculated).
My suggestion is to import the mentioned "Aspiration - Cheat" BHAV into you potion, and then call it from within the "Feel Great".
The "Aspiration - Cheat" requires two parameters: Param0 = Aspiration type (Romance, Knowledge, etc.); Param1 = Aspiration level (-100 ~ +100).
You don't want to change the aspiration type, of course, so you should pass as Param0 the current aspiration type of the sim, i.e. "My person data 0x002E (Aspiration)".

I've finally started my Journal. Information only, no questions.

My latest activity: CEP 9.2.0! - AnyGameStarter 2.1.1 (UPD) - Scriptorium v.2.2f - Photo & Plaques hide with walls - Magazine Rack (UPD) - Animated Windows Hack (UPD) - Custom Instrument Hack (UPD) - Drivable Cars Without Nightlife (UPD) - Courtesy Lights (FIX) - Custom Fence-Arches - Painting-TV - Smarter Lights (UPD)


I *DON'T* accept requests, sorry.
Forum Resident
Original Poster
#11 Old 29th Jan 2009 at 10:52 PM
Quote: Originally posted by Numenor
The "Aspiration - Cheat" requires two parameters: Param0 = Aspiration type (Romance, Knowledge, etc.); Param1 = Aspiration level (-100 ~ +100).
You don't want to change the aspiration type, of course, so you should pass as Param0 the current aspiration type of the sim, i.e. "My person data 0x002E (Aspiration)".
Ooooh, and I assume I need to use that BHAV as well if, say, I feel like adding a "Turn grilled cheese" command at the end of my insanity potion, or change the aspiration to "Grow up" on my toddlerification one?

Thanks to both of you for the tips - my transparency potion works now, by the way!
The ModFather
retired moderator
#12 Old 30th Jan 2009 at 10:13 AM
Yes, you should use the same "Aspiration - Cheat" BHAV in order to change the aspiration type, as well. Of course, you send the right value as Param0.
All the possible values are stored into global BCON 0x013E, from line 0x01 (Romance) up to line 0x09 (Grilled Cheese).

IMPORTANT: I've examined again the "Aspiration Cheat" and I realized I gave you an inaccurate piece of information.
If you DON'T want to change the aspiration type, you must send as Param0 the value of zero, and NOT the "My person data 0x002E (Aspiration)" as suggested earlier.

I've finally started my Journal. Information only, no questions.

My latest activity: CEP 9.2.0! - AnyGameStarter 2.1.1 (UPD) - Scriptorium v.2.2f - Photo & Plaques hide with walls - Magazine Rack (UPD) - Animated Windows Hack (UPD) - Custom Instrument Hack (UPD) - Drivable Cars Without Nightlife (UPD) - Courtesy Lights (FIX) - Custom Fence-Arches - Painting-TV - Smarter Lights (UPD)


I *DON'T* accept requests, sorry.
Forum Resident
Original Poster
#13 Old 31st Jan 2009 at 10:26 PM
Hmmm, for some reason, when I put 9 as the argument in Aspiration - Cheat... I get a wealth sim. I don't quite understand.
Fat Obstreperous Jerk
#14 Old 1st Feb 2009 at 12:03 AM
Quote: Originally posted by Numenor
Personally, I don't like to get rid of all the Targets pointing to "Error" (FFFC): if an object causes an error, I'd like to know
In fact, your "fixed" chemistry set didn't spawn any error message, but still the potion wasn't created: you've swept the dust under the carpet, but the dirt is still there

I only leave error tails on things that I actually WANT to see, otherwise it becomes extremely cluttered and hard to spot where you left the tails. Things like 0x02 can never produce this condition anyway, and if they somehow do, damn the torpedoes, FULL SPEED AHEAD!

Grant me the serenity to accept the things I cannot change, the courage to change the things I cannot accept, and the wisdom to hide the bodies of those I had to kill because they pissed me off.
Back to top