Welcome to
Mod The Sims
Online: 1966
News:
Have an account? Sign in:
pass:
If you don't have an account, why not sign up now? It's free!
Other sites: SimsWiki
Reply  Replies: 13 (Who?), Viewed: 3256 times.
Search this Thread
Old 25th Jan 2009, 03:20 AM DefaultMy chemistry set: miscellaneous, time-variant BHAV questions (NL required) #1
Frenchie
Original Poster

Forum Resident

Join Date: Oct 2005
Posts: 826
Thanks: 7729 in 76 Posts
24 Achievements

View My Journal


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.
Download - please read all instructions before downloading any files!
File Type: rar TFS_ChemistrySet.rar (153.2 KB, 31 downloads) - View custom content

If you like Greek mythology and humour, go check "Zeus & Sons", my webcomic
Id pro lulzis feci.
Last edited by The_French_Sim : 28th Jan 2009 at 04:22 PM.
Old 25th Jan 2009, 03:30 AM #2
J. M. Pescado
Fat Obstreperous Jerk

Join Date: Oct 2004
Posts: 3,153
Thanks: 8589 in 38 Posts
14 Achievements


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.
Old 25th Jan 2009, 04:02 AM #3
Frenchie
Original Poster

Forum Resident

Join Date: Oct 2005
Posts: 826
Thanks: 7729 in 76 Posts
24 Achievements

View My Journal


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?

If you like Greek mythology and humour, go check "Zeus & Sons", my webcomic
Id pro lulzis feci.
Old 25th Jan 2009, 09:01 AM #4
J. M. Pescado
Fat Obstreperous Jerk

Join Date: Oct 2004
Posts: 3,153
Thanks: 8589 in 38 Posts
14 Achievements


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.
Old 25th Jan 2009, 01:09 PM #5
Frenchie
Original Poster

Forum Resident

Join Date: Oct 2005
Posts: 826
Thanks: 7729 in 76 Posts
24 Achievements

View My Journal


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.
Download - please read all instructions before downloading any files!
File Type: rar TFS_ChemistrySetNoPotionCreated.rar (153.2 KB, 8 downloads) - View custom content

If you like Greek mythology and humour, go check "Zeus & Sons", my webcomic
Id pro lulzis feci.
Old 25th Jan 2009, 06:50 PM #6
Numenor
The ModFather



Join Date: Sep 2004
Posts: 8,400
Thanks: 197440 in 174 Posts
39 Achievements

View My Journal


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
Click image for larger version

Name:  _Pic1.jpg
Views: 0
Size:  122.4 KB   Click image for larger version

Name:  _Pic2.jpg
Views: 0
Size:  124.2 KB  
Download - please read all instructions before downloading any files!
File Type: rar TFS_ChemistrySet.rar (152.4 KB, 30 downloads) - View custom content

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.
Old 25th Jan 2009, 07:40 PM #7
Frenchie
Original Poster

Forum Resident

Join Date: Oct 2005
Posts: 826
Thanks: 7729 in 76 Posts
24 Achievements

View My Journal


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.

If you like Greek mythology and humour, go check "Zeus & Sons", my webcomic
Id pro lulzis feci.
Old 28th Jan 2009, 04:20 PM #8
Frenchie
Original Poster

Forum Resident

Join Date: Oct 2005
Posts: 826
Thanks: 7729 in 76 Posts
24 Achievements

View My Journal


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
Download - please read all instructions before downloading any files!
File Type: rar TFS_Potions.rar (66.2 KB, 9 downloads) - View custom content

If you like Greek mythology and humour, go check "Zeus & Sons", my webcomic
Id pro lulzis feci.
Last edited by The_French_Sim : 28th Jan 2009 at 04:27 PM.
Old 29th Jan 2009, 09:08 AM #9
Echo
Duck



Join Date: Dec 2004
Posts: 3,918
Thanks: 48067 in 48 Posts
26 Achievements

View My Journal


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.
Old 29th Jan 2009, 10:00 PM #10
Numenor
The ModFather



Join Date: Sep 2004
Posts: 8,400
Thanks: 197440 in 174 Posts
39 Achievements

View My Journal


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.
Old 29th Jan 2009, 10:52 PM #11
Frenchie
Original Poster

Forum Resident

Join Date: Oct 2005
Posts: 826
Thanks: 7729 in 76 Posts
24 Achievements

View My Journal


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!

If you like Greek mythology and humour, go check "Zeus & Sons", my webcomic
Id pro lulzis feci.
Old 30th Jan 2009, 10:13 AM #12
Numenor
The ModFather



Join Date: Sep 2004
Posts: 8,400
Thanks: 197440 in 174 Posts
39 Achievements

View My Journal


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.
Old 31st Jan 2009, 10:26 PM #13
Frenchie
Original Poster

Forum Resident

Join Date: Oct 2005
Posts: 826
Thanks: 7729 in 76 Posts
24 Achievements

View My Journal


Hmmm, for some reason, when I put 9 as the argument in Aspiration - Cheat... I get a wealth sim. I don't quite understand.

If you like Greek mythology and humour, go check "Zeus & Sons", my webcomic
Id pro lulzis feci.
Old 1st Feb 2009, 12:03 AM #14
J. M. Pescado
Fat Obstreperous Jerk

Join Date: Oct 2004
Posts: 3,153
Thanks: 8589 in 38 Posts
14 Achievements


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.
Reply


Section jump:


Powered by MariaDB Some icons by http://dryicons.com.