Welcome to
Mod The Sims
Online: 1914
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: 9 (Who?), Viewed: 1162 times.
Search this Thread
Old 4th Aug 2007, 08:37 AM DefaultDisplaying accessories using BHAV's #1
ScoobyDoo
Original Poster

Lab Assistant

Join Date: Jan 2007
Posts: 167
Thanks: 299 in 1 Posts
4 Achievements


Crammyboi's bhavs are confusing as heck. I like to redo it to something simplier. Basically:

if (size == 1)
displaymesh (1) ;
else if (size == 2)
displaymesh(2) ;
....etc;


the if (size == 1) i can do with Expression (size, ==, 1) true -> next statement, false -> skip next statement.

But the really big question is how do you display the mesh? He's using Change Material (My object id, Me (MaterialName:[Temp 0x000]), Me ("meshsize"))

ok is My object id, simply referring to itself, the accessory?

the second parameter in Temp appears to be referring to the texture.

If I add my own entry, (for those that can view the pacakge, Set Skin, line 4) before any size/age/flag checking occurs. I get this two errors:

"Missing Material / Mesh Group Name."
and
"Object referred to must be a person." (this one repeat indefinetely)

Any ideas what I'm doing wrong? Or am barking up the wrong tree and Change material doesn't change meshes?
Old 4th Aug 2007, 08:57 AM #2
Echo
Duck



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

View My Journal


Well without seeing your package I can't really be certain, but I can translate the errors for you if nothing else.

The "Missing material/mesh group name" is pretty much what it says - either the material name or the mesh group name you're pointing to are wrong. Material names are stored in text list 0x88 and need to reference the txmt for the texture you want to display. Mesh group names are stored text list 0x87 and must reference a subset name from the SHPE (or the GMDC, same names). In the example above, your material name is being referenced via temp 0x00, so the first thing you need to check is that you're setting temp 0x00 to the line number of the material you want to show. My guess is that it's not getting set, and so it's not pointing to a valid texture.

The "Object referred to must be a person" is generally caused by a mix up between "My" and "Stack Object", although if you're using the SO it can also be caused by mis-setting the SO id. How is this code getting called? As an interaction?


Edit: And no, change material doesn't change meshes, it changes materials. You can use it to create the effect of mesh switching by switching between materials with different parts of the texture set to transparent though. If you actually need to change the mesh and all associated parts, you need to change (My/SO's) graphic to point to the line in text list 0x85 which points to the different cres.
Old 4th Aug 2007, 09:28 AM #3
ScoobyDoo
Original Poster

Lab Assistant

Join Date: Jan 2007
Posts: 167
Thanks: 299 in 1 Posts
4 Achievements


Ok is see 0x88, he uses "Material Names", I'm not touching materials just yet.
0x87, he uses "Mesh Group Names", these look like the individual meshes correct?
in 0x85, he uses "3D Object Names", these look like the mesh groups?

First, before I attempt to handle this display mesh I should first make sure I'm attaching the meshes correctly. Is there a simple tutorial on how to correctly add a mesh correctly to the package? I know how to import it, are there any other entries that need to be modified? 0x87 seems to be needing editing, using the same name as the mesh, for sanity sake.
Last edited by ScoobyDoo : 4th Aug 2007 at 09:35 AM.
Old 4th Aug 2007, 09:38 AM #4
Echo
Duck



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

View My Journal


0x87 only needs to be edited if (a) you've changed the name of the subsets in your imported mesh, and (b) your bhavs reference that text list. Same with materials. The cloning process will fix them all up based on the stuff already in game, you only need to change them if you change the subset/material names and your object bhavs need those text lists to be populated.

There may be other lists that need to be changed, that depends on how your code works.
Old 4th Aug 2007, 09:45 AM #5
ScoobyDoo
Original Poster

Lab Assistant

Join Date: Jan 2007
Posts: 167
Thanks: 299 in 1 Posts
4 Achievements


subsets?

ok in GMDC he has: anBLAH-crammboy-tslocator-gdmc
it contains the following models: A, B, C, D, E, F, and I added G (ok their not really A, B, C.. but you get the idea)

in the STR#, x87 he has A, B, C, D, E, F plus a few extras (including an empty one), I added G. This right? Ignoring how the code works for the moment, one battle at a time. BTW what does STR# do exactly? Is it just a resource that connects ID's with string text messages? (Sorta like what old .RC files did with Windows code?)
Old 4th Aug 2007, 10:42 AM #6
Echo
Duck



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

View My Journal


You call them models, I call them subsets. Same beasts. And that STR is pretty much just a resource to link BHAVs to GMDCs. Since BHAVs can't actually hold string values or anything like that, the strings have to be stored in Text Lists and referenced by number.
Old 4th Aug 2007, 11:05 AM #7
ScoobyDoo
Original Poster

Lab Assistant

Join Date: Jan 2007
Posts: 167
Thanks: 299 in 1 Posts
4 Achievements


Ok that makes sense Enough of the leasons for one night, I KNOW I'll have more questions tomorrow.
Old 6th Aug 2007, 03:46 AM #8
ScoobyDoo
Original Poster

Lab Assistant

Join Date: Jan 2007
Posts: 167
Thanks: 299 in 1 Posts
4 Achievements


I think I'm making some slight progress, at least it's not complaining to me anymore.


Dialog (message, Title: "Setting Size", Message:DialogString:[Temp 0x003])
Expression (Temp 0x000 := Literal 0x003)
Expressoin (My graphic := Temp 0x000)

Ok you said 0x085, "3d object names", but this refers to the mesh group, rather than the subset. When you change a mesh do you have to first reset the mesh group then the subset?

Next question, how do I assign My graphic to the correct subset? I assume you have to somehow get my Graphic to point to 0x087.

Btw I noticed in the GMDC->Groups theres a Link Reference, with each entry having a unique number (0,1,2....) is this of any use or just another value?
Old 8th Aug 2007, 10:44 PM #9
ScoobyDoo
Original Poster

Lab Assistant

Join Date: Jan 2007
Posts: 167
Thanks: 299 in 1 Posts
4 Achievements


Ahhh I think I found something important, is the function "main" work the same way as a windows c++ "main" function? I.e. it does some work, idles away, then repeats? Because thats the only place I see where he modifies the My graphic property.

Also is the init like a constructor? It gets called before main?

note to self: the GMND reference instance points to the GMDC's instance.
Last edited by ScoobyDoo : 9th Aug 2007 at 01:01 AM.
Old 9th Aug 2007, 04:15 AM #10
ScoobyDoo
Original Poster

Lab Assistant

Join Date: Jan 2007
Posts: 167
Thanks: 299 in 1 Posts
4 Achievements


Ohhhhhhhh I've found his secret....

In Set Skin he first applies the texture to temp 0. Then he does a series of Expression ifs to apply the texture to a specific subobject. Once it is applied he then sets temp 0 to empty (0). Then goes through an applies that texture to all the other subobjects. So only the subobject with the material actually gets the texture.

I should see if I can rewrite it with more of a "switch" style.
Reply


Section jump:


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