PDA

View Full Version : Creating new pie menu for the computer and assigning existing actions..


perdita_x_dream
14th May 2007, 03:32 PM
Hello!

I have been trying to read a bunch of tutorials on the SimPE site and also here, about creating new pie menus and about BHAV:s.. My intention is to create a global mod for the computers (or at least one..) that allows you to buy stuff from the Sellafone Gadget Kiosk. It's not the easiest of tasks, but I haven't really gotten the pie menu to work either, so I would like some help if possible..

I'm not sure if it's even possible to make this kind of global mod, does anyone know if the computers are possible to affect in this way? I have seen the shop-at-home modded computer, but no global mod alternative and that makes me wonder...

I am using the objects.package from Seasons, and have found the pie menu functions and strings from the expensive computer (0x7F96C47B) and I have also extracted a bunch of BHAV:s from the gadget kiosk (0X7F011AE9).

I have made a new pie menu string, with the name 'buy gadgets' and it has number 0x001F, and created a new pie menu function - 0x1F - pointing it to a clone of Function - Init to test the pie menu. All have group "0x7F96C47B", is that correct? I am wondering if they should have group 0xFFFFFFFF, but when I assigned this to Pie menu functions they all went beserk and read zeros instead of pie menu words..

When I try to Add BHAV:s from the kiosk into the package, and point the new pie menu to one of them, it mostly sais "invalid BHAV", I am not sure what instance numbers I should give them, and if I assign a different group to them, I think that something goes wrong with the instance-numbers, since they are connected in some way.. I don't think I'll figure this out by playing around with the BHAV:s.. What would be the correct way to point the new pie menu to a function that enables the Buy-function from the kiosk? I have not found a tutorial that sheds light on this yet, just some text in a programmers guide to BHAV:s about importing semi-globals from a foreign library means that you have to "import all the semi-globals that are called by the function and repeat the same process", and that didn't make much sense.. I am guessing it has to do with the conflict between stuff from different groups that have the same instancenumber, but I don't really get what I can do about it.. Or am I totally wrong?

I guess I'm out to deep, but I'll try to keep learning, if anyone can help me to at least get the pie menu to show up, I would be very happy :)

Hugs
/Linnea

Echo
15th May 2007, 01:44 PM
Hi Linnea,

Yes, you've picked a real doozie. :)

There are a few reasons why global pie menu hacks for computers are so rare. The first is that pie menus tend to exist on a one-per-object basis, so if you change one pie menu you only change one objects. It won't affect any of the other objects, or anything cloned from that original object, because they have their own pie menus. The second is that computers change drastically in almost every EP, and a hack made for one EP will almost never work in any of the others. Computer global hacks are some of the biggest causes of broken games come new EP time. ;)

As to why your code isn't working...

When we make a clone of an object, a copy of all the relevant parts of the object are made and put into a package, then those parts are given the group 0xFFFFFFFF. That group means "When you load this into game, come up with a random group and assign it to every file in group 0xFFFFFFFF in this package". That means that when you actually load the game with one of these items, it'll end up with some completely different group number, but that's okay because all the files in the package will have the same group number.

BHAVs, Pie Menus etc, can only see each other if (a) they are in the same group as each other, or (b) the object for one references a semi-global library containing the other. As long as all the items are in the same group, no problem.

Unfortunately, you're trying to make a semi-global for the computer point to a semi-global for the kiosk. That obviously won't work, because they have different groups. They're pretty much invisible to each other.

One work around is to make a copy of all the code from the kiosk you want, and put it into the computer semi-globals. The problem there is that you'll now have two BHAVs with the same group and the same instance, and only one of them can actually exist in game. That means that you have to change the instances of the BHAVs you've imported to numbers which aren't currently used by the computer semi-global library. Then you need to go through all your imported code and fix up those references to each other, since they won't be pointing at the right functions any more. It can get really quite messy, and I really don't recommend it as a good task for a beginner in BHAVs. ;)

If you still plan to try it though, best of luck! :D

perdita_x_dream
16th May 2007, 05:45 PM
Thanks for your reply, and your help :)

Yeah, I figured I wouldn't be able to manage that task, so I have tried to come up with some other ideas.. I thought that I would use the summoner-tutorial on the SimPE-site (this: http://sims.ambertation.de/bhavtutorialcarrigon.shtml ) and see if I could clone some object and have it conjure the three objects that one gets from the kiosk (the hand game, the cellphone and the mp3-player)..

I was thinking that the object would be an electronics mail order catalogue and that it would state that you were ordering the things, with instant delivery.. :) But I tried to clone a piece of homework, and I can't get any piemenus to work at all, I think it was a bad choice of object thinking about that it probably does a lot of age-thinking and the like.. So I thought that maybe I could clone a magazine, but I can't find it in the object workshop, so I can't clone it... My last thought is to clone the restaurant menue, since it kind of looks like a catalogue with the right recoloring, I haven't tried it yet though..

Does anyone know where in the object workshop I can find a magazine to clone? And how do I find the GUID:s for the kiosk-objects.. I have found them, at least the hand game, in the object workshop catalog, and there is a number (0x7F----asf) after it, is that the right number to use for the calling of the object? (I have no idea if my questions are utterly stupid or not, since I'm such a newbie, please forgive me..)

Thanks Echo!
/Linnea

Echo
17th May 2007, 01:57 PM
Just a heads up, the kiosk items are all quite messy - they're not your normal objects, which is why there are so few hacks around for them. Not telling you to quit, just giving you some forewarning! ;)

Anyways, you should be able to find the magazines under the "Unknown" section of OW. They're listed by title ("Beyond Belief" etc). You'd be better off trying to code it into a statue first though, then moving that code to a magazine afterwards, since magazines are a bit wonky to get in game as standalone objects. Try to make one thing work at a time, you'll save yourself a lot of stress that way! :)

The numbers in brackets after the object are their group id. That's not what you want for a Create New Object Instance. You want the object's GUID. You can get that by cloning the object you're looking for, then opening it's OBJD. The GUID is displayed there.

Best of luck. :)