View Full Version : I Need Help Bad with tokens can some one help me
JonathenCH
8th Feb 2007, 9:43 PM
I am creating a mod wear sims can pay life insurance. when a sim dies for what ever reason u get paid or when a sim is sick u get paid to buy medication for him. I created my mod and the sims have to click on the computer and click apply for life insurance and all was going well my sim was being charged for life insurance. But when i deleted the sims computer all of the information is wiped out and my sim no longer has life insurance they have to start all over again and apply once again. So all of the money that my sims have paid is gone so i was reading up on the manage sims inventory command and decided to create a token to store in my sims inventory. So that when the computer was delete and balt again it would check my sims inventory for a insurance token. Then read how much money my sims have applied for and the amount of there premium and the amount they have paid in so far. But i have 2 problem how do i store that information in the token and get that information from the token to the main object?
Echo
10th Feb 2007, 4:57 AM
Eep, big question there.
I'm assuming you have no problem actually creating the token package? (Basically just clone, rename and give a new guid to an existing token) Once that's done, then the follow is probably generally accurate:
To assign the token to a sim (assuming that the sim is "Me"):
Manage Inventory (Add token,
token: GUID [Your token's GUID here],
Inventory (singular): Neighbor: My person data 0x001F (neighbor id)
To load a token into the temp token (so that it can be read/changed etc):
Expression (Temp 0x0000 := Literal 0x0000)
Manage Inventory (Read token into My Temp Token,
token: GUID [Your token's GUID here],
index: Temp 0x0000,
Inventory (singular): Neighbor: My person data 0x001F (neighbor id)
To read a property from a token:
Access the token as above, then
Manage Inventory (Get from My Temp Token,
index: {Index of token} [property: {Where to store the value},
Inventory (singular): Neighbor: My person data 0x001F (neighbor id)
To add a property to a token
Manage Inventory (Push onto token,
index: {Index of token} [property: {Value for token to get}],
Inventory (singular): Neighbor: My person data 0x001F (neighbor id)
To save a modified token back to the sim from the temp token:
Manage Inventory (Save My Temp Token back to the location it was loaded from,
Inventory (singular): Neighbor: My person data 0x001F (neighbor id))
The best thing I can suggest though, would be to grab one of the career reward objects from the Harry Potter set, then read through each of the functions starting with "Magic - ", because they have simple code to cover pretty much most things you describe above. And it should be fairly easy to just copy that code and substitute in your GUIDs etc...
JonathenCH
10th Feb 2007, 12:49 PM
Thanks Echo u helped me alot but one more thing i understand how to do every thing else now thanks 2 u. But when u say "index of token" what exactly are u refering to is that were i put the slot number of were the token is stored or is that wear i put the property slot number of were i wont to store my value example
Example
Token Guild 0x12EF167E
Token Flags 0
Token Property 0:1246
Token Property 1:300
Token Property 2:400
Token Property 3:0
Token Property 4:1280
now lets say that i wonted to add a property to a token
so i use the code
Manage Inventory (Push onto token,
index: {Index of token} [property: {Value for token to get}],
Inventory (singular): Neighbor: My person data 0x001F (neighbor id)
so were it says index do i put the number of the property slot i wont my value to go in
like if i wonted it to go store 6000 in property slot 3 on my toke my code would look like this
Manage Inventory (Push onto token,
index: {Literal 0x0003} [property: {Literal 0x6000}],
Inventory (singular): Neighbor: My person data 0x001F (neighbor id)
or is index just refearing to the slot number of were my token can be found?
linolino
13th Feb 2007, 11:47 AM
I'm almost certain of what i posted below, but you'll have to test it or read through the functions of the harry potter set as Echo suggested, to make sure.
The "Push" command will add a property at the first property slot of the token, pushing the others properties one slot ahead. So I'm guessing "index" refer to the actual index that identifies the token itself, while "property" is the value you want to store.
For what i've observed, a property is just a value stored in the token, and not a indexed slot wich contains a value. this would be an attribute.
JonathenCH
13th Feb 2007, 2:12 PM
Thank you linolino for your help u have helped be out alot and i thank u
vBulletin v3.0.14, Copyright ©2000-2013, Jelsoft Enterprises Ltd.