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
Retired Duck
retired moderator
#76 Old 19th Jan 2007 at 11:38 PM
Quote:
so for what i undertood, stack object is kind of a variable. Stack ID is the ID of the object/sim, and so I can change the stack object's attributes, like if it is a Sim i can change the stack object's motives?

Yes, stack object is a variable. It can store the "object ID" of any object in game, including both sims and more traditional objects. When your function first starts, the stack object value is copied from the function which called it. The upside of that is that for an interaction, the stack object will be the object you clicked on to run the interaction. (Note that this is not necessarily the case for all functions - for example, a Function - Init is called directly by the game engine and not from another function, so the Stack Object defaults to 0). As you noted, if the Stack Object is pointing to a Sim, then changing the Stack Object's Motives will change the Sim's motives. If the stack object is a table, then changing Stack Object's Motives will probably result in an error (tables have no motives!).

Quote:
ok.. but how will i know what object is the Stack Object ID in my instruction?
I mean, In a behavior of a sim interacting with a object, Stack Object ID will be referring to the Sim or the Object?

Like any variable, the stack object will stay the same unless you specifically do something to change it. The most common way to do that is "Stack Object ID 0x0000 := [some other object ID]", although other commands can change it too (in Numenor's example of scanning for a table, "Set To Next" changes the stack object to a different object). If you're writing a BHAV from scratch, you can generally rely on the Stack Object to remain the same unless you specifically try to change something.

<self promotion alert>A lot of this stuff is covered in the sections "Understanding the call stack" and "'Me' and the 'Stack Object'" here: http://www.modthesims2.com/showthread.php?t=212101</self promotion alert>
Advertisement
Lab Assistant
#77 Old 19th Jan 2007 at 11:58 PM
First, let me thank a LOT, i mean really a LOT you guys. I wasn't expecting to get my doubts answered by you 3 masters of SimAntics, AdidasSG2, Numenor and Echo! i mean, just cool..!!

Yey! That really explained SO!! I wasn't getting it at all.

Quote: Originally posted by Echo
<self promotion alert>A lot of this stuff is covered in the sections "Understanding the call stack" and "'Me' and the 'Stack Object'" here: http://www.modthesims2.com/showthread.php?t=212101</self promotion alert>

I really thought if that. That maybe there was already a tutorial explaining that, and that i would be making you answer things twice. I'm sorry for that.
I just posted because I'm following the AdidasSG2 tutorials, and i coudn't understand SO entirely from the tutorials, but i understood everything else, so i thought asking just that...

well, i think i got it now.
Imagine I want to creat a set of instructions that will do the following, when the mouse click the action on the pie menu:

1) check if the selected sim's comfort is higher than 50%
2) store a value in a variable in the object that the sim is interacting with.

In the case, the SO is the object, and the sim is the My?
So a sim will only be considered a SO in a social Interaction with another sim, where on of them is the My and the other the SO?
right?
Retired Duck
retired moderator
#78 Old 20th Jan 2007 at 2:35 AM
Quote: Originally posted by linolino
In the case, the SO is the object, and the sim is the My?
Yes, exactly!
Quote:
So a sim will only be considered a SO in a social Interaction with another sim, where on of them is the My and the other the SO?
right?
Not really sure about socials, I don't play much with them... But that seems a good possibililty.

As a small side note on sims as stack objects though, you can explicitly set the stack object to be the "My" Sim if you want, by running something like:
Stack Object Id := My Object ID
Instructor
#79 Old 20th Jan 2007 at 3:55 AM
Quote: Originally posted by linolino
In the case, the SO is the object, and the sim is the My?So a sim will only be considered a SO in a social Interaction with another sim, where on of them is the My and the other the SO?
right?


I believe the Stack Object will be the controller for the social interaction and both sims will by My, but each running in a seperate stack.

Tired of getting ripped off by paysites?
http://paysites.mustbedestroyed.org/
The ModFather
retired moderator
Original Poster
#80 Old 20th Jan 2007 at 12:18 PM
Yes, the social interactions often use a Controller (which is in most cases the SO), but in the very moment you click on a sim and choose an interaction, the SO is the clicked sim, and "Me" is the currently selected sim. Then, a Controller might be spawned to manage the social interaction, and it becomes the SO, but not necessarily.

An example: in Nightlife, when a sim is idle, he frequently scans the room (or the lot) for an attractive sim; in this case, a "Set to next" loop is performed, and every sim that is found becomes temporarily the SO; then the game checks the attraction between "Me" (the idle sim) and the SO (the sim currently pointed by the Set to Next loop). No controllers are involved in this example.

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.
Lab Assistant
#81 Old 20th Jan 2007 at 8:20 PM
with all this info from you guys, I think I now can make a object i had in mind.. the socials might be a problem though, but i'll try to leave that for last, if it is really needed... I'll try to upload it when i get it done and working!

By the way, wouldn't anyone know how to put in my object a pie menu like the "influence to" menu? I want that effect that disables it and turns it gray if the sim does not have the appropriate requirements..
Instructor
#82 Old 21st Jan 2007 at 10:01 PM
You would use the "Add/Change the Action String" primitive to gray the Pie Menu option out.

Tired of getting ripped off by paysites?
http://paysites.mustbedestroyed.org/
The ModFather
retired moderator
Original Poster
#83 Old 22nd Jan 2007 at 3:05 PM
This is interesting, I've never examined carefully the "Add/Change" primitive... Which operand(s) make the menu entry grayed out?

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.
One horse disagreer of the Apocalypse
#84 Old 22nd Jan 2007 at 3:15 PM
I would simply return false or skip to the next iteration of the loop if the test was not met.

"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
The ModFather
retired moderator
Original Poster
#85 Old 22nd Jan 2007 at 4:20 PM
But Linolino seems to want that gray-out effect; and anyway I've answered my own question: SimPE offers a handy wizard for the Add/Change primitive, thanks to PJSE -

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.
Lab Assistant
#86 Old 22nd Jan 2007 at 4:39 PM
yes, that's right. i want that effect because I want the player to see the disabled options, so he will try to met the conditions to activate it.

I love when SimPE has a specific wizzard for the operands of a function! that's a good news then!
One horse disagreer of the Apocalypse
#87 Old 22nd Jan 2007 at 5:53 PM
Well while we are talking about wizards, what are the next three wizards you would most like to be implemented?

"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
The ModFather
retired moderator
Original Poster
#88 Old 22nd Jan 2007 at 7:26 PM
Quote: Originally posted by Inge Jones
Well while we are talking about wizards, what are the next three wizards you would most like to be implemented?

"Animate Sim" and "Animate Object"
As for the third wish (we are talking about Wizards, so three wishes are the canonical number ) I'll think about it before asking :D

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.
One horse disagreer of the Apocalypse
#89 Old 22nd Jan 2007 at 8:25 PM
Quote: Originally posted by Numenor
"Animate Sim" and "Animate Object"


I have added those to Peter's todo list. He had been waiting for Quaxi to do that core redesign work on SimPE which but now it won't be done before Seasons so he will be able to work on some wizards.

"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
Lab Assistant
#90 Old 26th Jan 2007 at 2:50 AM
It would really help a wizard for the prim 0x0033 Manage Inventory
It is really confusing!
One horse disagreer of the Apocalypse
#91 Old 26th Jan 2007 at 10:01 AM
Noted. Sorry Numenor you lost your chance of the 3rd wish :P

"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
Lab Assistant
#92 Old 26th Jan 2007 at 1:52 PM Last edited by linolino : 26th Jan 2007 at 5:21 PM.
I hope Numenor won't get mad at me for suggesting the manage inventory.. i really need help from you guys...

and while on the manage inventory subject... I have read the attached documentation of AdidasSG2 for this primitive, and I got this doubt:

1) "Neighbor Counted inventory with ID in Local Varaible 0x0001 Find Token with GUID 0xEE8E8647 , Put count into Temporary Storage 0x0000"

For what I understood, if the function FINDS a specific TOKEN, it will it will ADD a count to Temp 0x0000. And for "ADD", i understand that its going to sum Literal 0x00001 to what ever value is already in Temp 0x00000.
Example: if Temp 0x0000 = 5, then the function will add 1 + 5, and Temp 0x0000 will be = 6.

But then, in another part, I got the impression that the COUNT that is PUT into Temp 0x0000 is actually the position of the SLOT where the TOKEN was found.
Example: Whatever is the value in Temp 0x0000, if a TOKEN is found in slot 2 of the inventory, the function will do Temp 0x0000 := 2

So, wich one is right?

2) Also, what's the deal with:
"Neighbor Counted inventory with ID of My Person Data 0x001F (neighbor id), Add Token with GUID of 0xCC58DF85 Pull count from Literal 0x0001"


Whats "Pull count from Literal 0x0001"????
How can you pull a count from a Literal? It's not a variable...

3) Why all these things about put/pull count are relevant anyway? I never saw the Temp, in wich the count was put, beeing used later in the function...

4) and last... If Neighbor Counted is the backpack, what is the Neighbor Singular ?
The ModFather
retired moderator
Original Poster
#93 Old 26th Jan 2007 at 2:08 PM
The "Manage Inventory" is perfect for me either Thanks Linolino for suggesting it and thanks to the Jones' for making them! :D

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.
Retired Duck
retired moderator
#94 Old 26th Jan 2007 at 11:54 PM
I think you've just got a minor misunderstanding of terminology.

There are two types of token you can have - "Counted Tokens" and "Instance Tokens" (aka "Singular Tokens").

Counted Tokens - a sim can have at most one of these in their inventory at any time. These tokens contain a count variable in them, so instead of adding the same token 5 times, you can add the token once then set the count in it to 5.

Instance Tokens - Sims can have multiple tokens of the same sort in their inventory, and can have any number of properties associated to them.

When a command says "put count into x", it means get the value of the count in the currently selected counteded token, and store that in x variable.

As for the "Pull Count from literal 1", that command is adding a new counted token. The count for that token needs to be given an initial value (because I believe that counted tokens that reach 0 get automatically deleted?) and in this case it should "pull" its count value from literal 1, in other words, set the count to 1. If you'd put a variable in there, say a local, then it would have pulled its initial value from that variable instead.
Lab Assistant
#95 Old 27th Jan 2007 at 1:01 AM
Ooohhh, so basically I got it all wrong! Well even so i think it's good that I asked this because other people may have the same doubts (or not, maybe i'm just slooow.. )

Then if i'm not wrong again, when it says Neighbor Counted it's referring to a Count Token in a Sim's Inventory?

Can regular object be a Singular Token then?
Retired Duck
retired moderator
#96 Old 27th Jan 2007 at 6:17 AM
The "Neighbour" part is telling you that it's an item in a sim's inventory. There are also (I believe,) global, house and family inventories which can also contain tokens. Don't know much about them except that they exist though.
One horse disagreer of the Apocalypse
#97 Old 28th Jan 2007 at 2:23 PM
Numenor, please would you test the animate(thisthatandtheother) in this build: http://www.simlogical.com/externall...070128-1359.zip

I have never used them so I am not the best person to test. He did all three of the animate wizards, as well as the random primitive wizard.

I don't advise anyone else downloading this test release unless you really want to be a guinea pig.

"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
The ModFather
retired moderator
Original Poster
#98 Old 29th Jan 2007 at 12:57 AM
Thanks Inge, I've downloaded the "guinea pig" version of the PJSE I think I'd better report my findings (if any) to Simlogical, so not to clog this thread.

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.
Test Subject
#99 Old 29th Jan 2007 at 10:23 PM Last edited by AdidasSG2 : 31st Jan 2007 at 10:14 PM.
Ooops! My Simlogic went haywire---I missed everything from #75 on.

Hehehe! I guess I better read better.

BTW-I have been working on something new for SimAntics Tutorials-

I am trying to include all the tutorials plus any new ones to come in a
Windows Vista Sidebar Gadget!

So between going through the BHAVs and learning JavaScript and CSS (which I am almost getting down pat) I am a bit behind!

SimAntics, What would life be without 'em!
Lab Assistant
#100 Old 30th Jan 2007 at 1:30 AM Last edited by linolino : 30th Jan 2007 at 4:44 PM.
Quote: Originally posted by AdidasSG2
linolino:

That depends on the instuction set. If you are modifying the object you would use something similar to:

StackObjId = object id;

If it's a sim:

StackObjID = my object id;

(I hope I got this correct)...I've been doing toooo much digging in BHAV's I am kind of screwing my mind up
AAARRRRRHHHHH!

Anyway, I hope this help you out.
I appreciate your answer AdidasSG2, but I'm not undertanding to what question it is the answer to...

[EDIT] Oh... I think i know now. it's the post #75 isn't it? [/EDIT]
Page 4 of 7
Back to top