| Search this Thread |
|
|
|
|
douglasveiga
Original Poster
|
i cloned the "Flamingo", then i just changed the InstanceName (OBJD) to "FlamingoX", but when i try to call him using scripts, my game can't find it. >>> this works (calling the original Flamingo) (the game will add the "Flamingo" in the world, with all the functionally(interactions) of the original Flamingo) Flamingo aa = GlobalFunctions.CreateObjectOutOfWorld("Flamingo") as Flamingo; aa.AddToWorld(); aa.SetPosition(position); >>> this doesn't work. (calling my cloned FlamingoX) (the game will add a "White Box" in the world, with all the functionally(interactions) of the original Flamingo) Flamingo aa = GlobalFunctions.CreateObjectOutOfWorld("FlamingoX") as Flamingo; aa.AddToWorld(); aa.SetPosition(position); what's wrong? i mean, why a "White Box"? ps: if i just leave the InstanceName,"Flamingo", as S3OC did, the game will Not add anything in the world using the script above. |
|
|
|
|
|
#2 |
|
Inge Jones
|
When you want to refer to a cloned object in a script, you need to use the "Use 32 bit ID" option in s3oc, because that is how the name is hashed. Not sure if that alone will be enough to fix your problem, but it is a prerequisite. |
|
simlogical Please do not PM me with questions about modding. Please post in an appropriate forum and send me a link to the thread if you would like me to try and help. |
|
|
|
|
|
|
#3 | ||
|
Buzzler
1978 gallons of pancake batter
|
Quote:
The game gets the instance id of the related OBJD from a NameGuidMap (NGMP) resource. Quote:
| ||
|
Robot Armed With Down Comforter Levels Apartment Building, Holds Mayor Hostage. |
|||
|
|
|
|
|
#4 |
|
Inge Jones
|
Not sure how much clearer I can get. Of course it only applies to those creators who use s3oc. You can leave off the bit after the comma, on second thoughts, as you pointed out it's not a hash of the name. |
|
simlogical Please do not PM me with questions about modding. Please post in an appropriate forum and send me a link to the thread if you would like me to try and help. |
|
|
|
|
|
|
#5 | |
|
douglasveiga
Original Poster
|
thanks for the answers Buzzler and Inge_Jones. i found the
Code:
but, how can i do to make the game recognize my cloned object, using the InstanceName or the hashed name? |
|
|
|
|
|
|
#6 |
|
douglasveiga
Original Poster
|
i got it, using the ResourceKey. What i did: i created a script to get the resource key of my cloned obj, so i got this string "319e4f1d:00000000:c1970eebed792964", then i used the function ResourceKey.FromString("319e4f1d:00000000:c1970eebed792964") to get back the ResourceKey; then i got the cloned item, using: Flamingo aa = GlobalFunctions.CreateObjectOutOfWorld(ResourceKey.FromString("319e4f1d:00000000:c1970eebed792964")) as Flamingo; aa.AddToWorld(); aa.SetPosition(position); so, it's working thank you very much guys! |
|
|
|
|
|
#7 |
|
Inge Jones
|
Well that;s interesting. Means we don't have to use 32bit IIDs to call from scripts after all? |
|
simlogical Please do not PM me with questions about modding. Please post in an appropriate forum and send me a link to the thread if you would like me to try and help. |
|
|
|
|
|
|
#8 | |
|
douglasveiga
Original Poster
|
Quote:
i think so. after testing several times, i got that the Instancename or the hashed name (64 or 32), makes no difference in cloned objects (i don't know why). the only way i found was that, using the resourcekey. that's really cool |
|
|
|
|
|
|
#9 |
|
Inge Jones
|
It could be that EA changed the definition of that data type to allow longer numbers, after realising what modders were doing about allocating IIDs - once they saw what the 3rd party tools were outputting. |
|
simlogical Please do not PM me with questions about modding. Please post in an appropriate forum and send me a link to the thread if you would like me to try and help. |
|
|
|
|
|
|
#10 | |
|
douglasveiga
Original Poster
|
Quote:
yes, maybe. |
|
|
|
|
|
|
#11 |
|
misukisu
|
If you need more info about how the mapping is done, see this thread: http://modthesims.info/showthread.php?t=435589& |
|
|
|
![]() |



Twitter
del.icio.us
StumbleUpon
Google