Budget - Make Transaction
| Budget - Make Transaction | ||
|---|---|---|
| Instance: | 0x0294 | |
| Game Version: | The Sims 2 | |
Contents |
Code
###
# Group = 0x7FD46CD0, Instance = 0x294
# Title = Budget - Make Transaction
#
# Format = 8009, Params = 4, Locals = 3
# Tree type = 0, Header flag = 6, Tree version = FFFF8015 (-32747), Cache flags = 0
0: Param 1 Flag Set? 2; true: 37, false: 36
1: Local 0 := Param 0; true: 2, false: error
2: Param 1 Flag Set? 1; true: 39, false: 5
3: Alter Budget: subtract Param 0 Multiplied by value in Temp2 as misc expense; true: 3B, false: false
4: Local 0 *= -1 (0xFFFF); true: 35, false: error
5: Param 2 == Const 0x13F(Expense Types):0x0(0); true: 3, false: 6
6: Param 2 == Const 0x13F(Expense Types):0x1(1); true: E, false: 7
7: Param 2 == Const 0x13F(Expense Types):0x2(2); true: F, false: 8
8: Param 2 == Const 0x13F(Expense Types):0x3(3); true: 10, false: 9
9: Param 2 == Const 0x13F(Expense Types):0x4(4); true: 11, false: A
A: Param 2 == Const 0x13F(Expense Types):0x5(5); true: 12, false: B
B: Param 2 == Const 0x13F(Expense Types):0x6(6); true: 13, false: C
C: Param 2 == Const 0x13F(Expense Types):0x7(7); true: 14, false: 3E
D: Break Point: if (1 != 0); true: false, false: error
E: Alter Budget: subtract Param 0 Multiplied by value in Temp2 as job income; true: 3B, false: false
F: Alter Budget: subtract Param 0 Multiplied by value in Temp2 as misc income; true: 3B, false: false
10: Alter Budget: subtract Param 0 Multiplied by value in Temp2 as food expense; true: 3B, false: false
11: Alter Budget: subtract Param 0 Multiplied by value in Temp2 as bill payment; true: 3B, false: false
12: Alter Budget: subtract Param 0 Multiplied by value in Temp2 as maintenance expense; true: 3B, false: false
13: Alter Budget: subtract Param 0 Multiplied by value in Temp2 as purchase; true: 3B, false: false
14: Alter Budget: subtract Param 0 Multiplied by value in Temp2 as architecture; true: 3B, false: false
15: Alter Budget: add Param 0 Multiplied by value in Temp2 as misc expense; true: 3B, false: 2E
16: Param 2 == Const 0x13F(Expense Types):0x0(0); true: 15, false: 17
17: Param 2 == Const 0x13F(Expense Types):0x1(1); true: 1F, false: 18
18: Param 2 == Const 0x13F(Expense Types):0x2(2); true: 20, false: 19
19: Param 2 == Const 0x13F(Expense Types):0x3(3); true: 21, false: 1A
1A: Param 2 == Const 0x13F(Expense Types):0x4(4); true: 22, false: 1B
1B: Param 2 == Const 0x13F(Expense Types):0x5(5); true: 23, false: 1C
1C: Param 2 == Const 0x13F(Expense Types):0x6(6); true: 24, false: 1D
1D: Param 2 == Const 0x13F(Expense Types):0x7(7); true: 25, false: 42
1E: Break Point: if (1 != 0); true: 1E, false: error
1F: Alter Budget: add Param 0 Multiplied by value in Temp2 as job income; true: 3B, false: 2D
20: Alter Budget: add Param 0 Multiplied by value in Temp2 as misc income; true: 3B, false: 2C
21: Alter Budget: add Param 0 Multiplied by value in Temp2 as food expense; true: 3B, false: 2B
22: Alter Budget: add Param 0 Multiplied by value in Temp2 as bill payment; true: 3B, false: 2A
23: Alter Budget: add Param 0 Multiplied by value in Temp2 as maintenance expense; true: 3B, false: 29
24: Alter Budget: add Param 0 Multiplied by value in Temp2 as purchase; true: 3B, false: 28
25: Alter Budget: add Param 0 Multiplied by value in Temp2 as architecture; true: 3B, false: 27
26: Param 1 Flag Set? 1; true: 35, false: 4
27: Break Point: if (1 != 0); true: 27, false: error
28: Break Point: if (1 != 0); true: 28, false: error
29: Break Point: if (1 != 0); true: 29, false: error
2A: Break Point: if (1 != 0); true: 2A, false: error
2B: Break Point: if (1 != 0); true: 2B, false: error
2C: Break Point: if (1 != 0); true: 2C, false: error
2D: Break Point: if (1 != 0); true: 2D, false: error
2E: Break Point: if (1 != 0); true: 2E, false: error
2F: Generic Sims Call: Perform Money Effect Temp 0:amount, Temp 2:multiplier; true: 3D, false: error
30: Temp 0 := Local 0; true: 31, false: error
31: Temp 1 := Param 3; true: 2F, false: error
32: Budget - Update Personal Wealth(Param 0, stack obj's person data neighbor id (0x1F), Local 1); true: 3A, false: error
33: Verify - Person ID(Param 3); true: 32, false: 3A
34: Stack Object := Param 3; true: 33, false: error
35: Verify - Object ID(Param 3); true: 30, false: true
36: Temp 2 := 1; true: 38, false: error
37: Local 1 := 1; true: 1, false: error
38: Local 1 := 0; true: 1, false: error
39: Local 2 := Temp 2; true: 34, false: error
3A: Temp 2 := Local 2; true: 16, false: error
3B: Wants - Trigger - Funds Change; true: 26, false: error
3C: Play / Stop Sound Event: Play Sound Global id = 0x3, with stack obj as source; true: true, false: error
3D: Stack Object := Param 3; true: 3C, false: error
3E: Param 2 == Const 0x13F(Expense Types):0x8(8); true: 40, false: 3F
3F: Param 2 == Const 0x13F(Expense Types):0x9(9); true: 41, false: 48
40: Alter Budget: subtract Param 0 Multiplied by value in Temp2 as success; true: 3B, false: false
41: Alter Budget: subtract Param 0 Multiplied by value in Temp2 as unknown; true: 3B, false: false
42: Param 2 == Const 0x13F(Expense Types):0x8(8); true: 44, false: 43
43: Param 2 == Const 0x13F(Expense Types):0x9(9); true: 45, false: 49
44: Alter Budget: add Param 0 Multiplied by value in Temp2 as success; true: 3B, false: 46
45: Alter Budget: add Param 0 Multiplied by value in Temp2 as unknown; true: 3B, false: 47
46: Break Point: if (1 != 0); true: 46, false: error
47: Break Point: if (1 != 0); true: 47, false: error
48: Param 2 == Const 0x13F(Expense Types):0xA(10); true: 41, false: D
49: Param 2 == Const 0x13F(Expense Types):0xA(10); true: 45, false: 1E
Purpose
This is, in effect, a more convenient, easy to use form of the Alter Budget primitive. It is also more effective, as it will alter the budget, make the kaching sound, and have the amount of money that is added or subtracted shown about the Sim's head. It also will properly affect a Sim's memories (IE the amount of money they've made so far in their life) which would be a pain to do if you had to do that manually every time you wanted to subtract an amount of money. So Maxis made the smart move of wrapping it all up into a nifty Global function. :)
Usage
There are four arguments to this Global.
Argument 1 (Parameter 0): The amount of money that you want to add or subtract. Can be any value in the range of 1 to 32776.
Argument 2 (Parameter 1): The action you wish to take with this amount of money. The following are valid arguments:
0 - Subtract the amount
1 - Add the amount
2 - Multiply the amount of money by a value set in Temp 0x0002 and subtract that value
The argument with the value of 2 may seem strange, but it is very useful when you think about it. What if we wanted to charge the Sim 50000 simoleans for using a super mega ultra deluxe cheat object of doom that will give them eternal life and happiness? Well, in that case, since we can't subtract more than 32776 simoleans, we could specify that 25000 simoleans should be subtracted, set Temp 0x0002 to 2, feed in value 2 for Argument 2, and TAH-DAH! The Global will subtract 50000 simoleans from the Sim's account. But what if you want to add 50000 simoleans? Well you big cheater, that's what MOTHERLODE is for!
Argument 3 (Parameter 2): The category of expenses or income this money falls under. The following values are valid categories:
0 - Miscellaneous Expense
1 - Job Income
2 - Miscellaneous Income
3 - Food Expense
4 - Bill Payment
5 - Maintainence Expense
6 - Purchase
7 - Architecture
You may be wondering, "Why on earth does this matter?!" Well, in all honesty, it had much more function in the Sims 1 days. The Sims 1 game let you click the funds in the bottom left hand corner and a window would pop-up showing you where all the money had come from and gone to in the past few days. Therefore, this is a vestigial thing, but it is still in good practice to use the categories anyhow. (Who knows, maybe the budget screen will reappear!)
Argument 4 (Parameter 3): Stack object ID of Sim whose funds are being altered.
So, with all that in mind, let's say you want so subtract 30 simoleans from the sim currently using the object as a Miscellaneous expense. You would give the following arguments:
07 1E 00 07 00 00 07 00 00 03 0B 00 01 00 00 00
Which should yield this from SimPE's BHAV editor:
[global 0x0294] Budget - Make Transaction (4 args: Literal 0x001E, Literal 0x0000, Literal 0x0000, My 0x000B (object id))
For more information on how arguments work, refer to this page: Using BHAVs With Arguments.
Examples
You can see this example in use in all the Maxis careers, the Sellafone kiosk from Uni, or the Money Tree aspiration reward object.