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!
Quick Reply
Search this Thread
Miss BHAVing
retired moderator
Original Poster
#1 Old 26th Jan 2009 at 11:40 PM Last edited by MogHughson : 28th Jan 2009 at 7:56 PM.
Default Adding a Semi-Global BHAV
Can you add a BHAV to a semi-global group?

I naively assumed you could - created it - called it from another semi-global BHAV within the same group - SimPE linked them together (i.e. could correctly see the BHAV name in the caller), but in the game it fails with "Bad gosub tree number"

So now I'm thinking it's not as simple as that.

I could just put all my new code in the appropriate place in the existing semi-global BHAV - it just looked tidier wrapped up in it's own function was all.

Also, can you add semi-global BCONs? SimPE only believes they are there if you use the next free number - skip one and it doesn't believe it exists.

Cheers
Mog
Advertisement
Slippery When Wet
#2 Old 27th Jan 2009 at 12:30 AM
You can add either type. It's hard to tell why it's not working in your case without seeing the package.

Sorry if this is a silly question, but are you sure you need to modify the global code though?
If this is to support your custom object, then importing the semi-globals into your object is safer. That way you can avoid a lot of the EP checks and hack conflicts.
Miss BHAVing
retired moderator
Original Poster
#3 Old 27th Jan 2009 at 11:01 AM Last edited by MogHughson : 28th Jan 2009 at 8:07 PM.
My object has no object, it is a global hack updating what the "Get Dressed" BHAV does when a Sim gets out of the bath/shower. Helpfully this BHAV has not changed since the Base Game so I am saved the usual need to add code to cover different EPs which I have had to do with other semi-global changes. Unfortunately I do not believe there is anyway to avoid a hack conflict with any other hack that changes this BHAV as this is where the code needs to go.

EDIT: Package attached
EDIT: I did something dumb - sometimes you can spend too long looking at something!

Thanks for the confirmation that I am not trying to do something that is known not to be allowed.

EDIT: OK - sorted out my fuddled brain. I think what I hit upon is that there must be an upper limit to the number you can make a semi-global. I decided it is probably a good idea not to simply take the next one free in a group as you will probably be broken by a future EP (although might be a moot point?). However, also you are presumably more likely to clash with another hack. So I picked a random number by taking the hex number representing each letter in MOG (as good as anything before you laugh ) which is 0xD (13), 0xF (15) and 0x7 which have me 0x00002DF7 which is high enough not to clash hopefully, but maybe too high.

Using this high number gave me bad gosub so I changed it to the next free one and still got bad gosub (but I hadn't changed it everywhere - doh!).

So now I just wonder what the upper limit is?

Cheers
Mog
Back to top