Hello,
when I build something and then I save the game and play again I lose the thing I has built. How can I prevent it?
Here the code:
What is wrong in Object.KeepInMemory($OBJ) = True?
Thanks!![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
when I build something and then I save the game and play again I lose the thing I has built. How can I prevent it?
Here the code:
Code:
{$CLEO .cs}
//-------------MAIN---------------
0000: NOP
:NONAME_2
wait 0
if and
Player.Defined($PLAYER_CHAR)
not Actor.Driving($PLAYER_ACTOR)
else_jump @NONAME_2
if or
0AB0: key_pressed 48
0AB0: key_pressed 49
0AB0: key_pressed 50
0AB0: key_pressed 51
else_jump @NONAME_2
if
0AB0: key_pressed 48
else_jump @NONAME_76
$KIT = 1
:NONAME_76
if
0AB0: key_pressed 49
else_jump @NONAME_98
$KIT = 2
:NONAME_98
if
0AB0: key_pressed 50
else_jump @NONAME_120
$KIT = 3
:NONAME_120
if
0AB0: key_pressed 51
else_jump @NONAME_142
$KIT = 4
:NONAME_142
if
$KIT == 1
else_jump @NONAME_168
$MODEL = 1239
:NONAME_168
if
$KIT == 2
else_jump @NONAME_194
$MODEL = 988
:NONAME_194
if
$KIT == 3
else_jump @NONAME_220
$MODEL = 1634
:NONAME_220
if
$KIT == 4
else_jump @NONAME_246
$MODEL = 2150
:NONAME_246
04C4: store_coords_to 21@ 22@ 23@ from_actor $PLAYER_ACTOR with_offset 0.0 5.0 1.15
:NONAME_275
wait 0
Model.Load($MODEL)
if
Model.Available($MODEL)
else_jump @NONAME_275
18@ = Actor.Angle($PLAYER_ACTOR)
$OBJ = Object.Create($MODEL, 21@, 22@, 23@)
25@ = 0.0
26@ = 0.0
0453: set_object $OBJ XYZ_rotation 25@ 26@ 18@
Object.ToggleInMovingList($OBJ) = True
Object.CollisionDetection($OBJ) = True
wait 100
jump @NONAME_384
:NONAME_384
wait 0
if
Player.Defined($PLAYER_ACTOR)
else_jump @NONAME_1882
if or
0AB0: key_pressed 188
0AB0: key_pressed 190
else_jump @NONAME_432
jump @NONAME_1143
:NONAME_432
if
0AB0: key_pressed 74
else_jump @NONAME_604
Object.ToggleInMovingList($OBJ) = True
04C4: store_coords_to 11@ 12@ 13@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0
04C4: store_coords_to 14@ 15@ 16@ from_actor $PLAYER_ACTOR with_offset 0.0 3.0 0.0
0063: 14@ -= 11@ // (float)
0063: 15@ -= 12@ // (float)
0063: 16@ -= 13@ // (float)
Object.Throw($OBJ, 14@, 15@, 16@)
0453: set_object $OBJ XYZ_rotation 25@ 26@ 18@
wait 5
0400: store_coords_to 21@ 22@ 23@ from_object $OBJ with_offset 0.0 0.0 -0.2
jump @NONAME_645
:NONAME_604
Object.Throw($OBJ, 0.0, 0.0, 0.0)
0453: set_object $OBJ XYZ_rotation 25@ 26@ 18@
Object.ToggleInMovingList($OBJ) = False
:NONAME_645
if
0AB0: key_pressed 81
else_jump @NONAME_720
Object.ToggleInMovingList($OBJ) = True
Object.Throw($OBJ, 0.0, 0.0, 3.0)
wait 5
0400: store_coords_to 21@ 22@ 23@ from_object $OBJ with_offset 0.0 0.0 -0.2
:NONAME_720
if
0AB0: key_pressed 69
else_jump @NONAME_795
Object.ToggleInMovingList($OBJ) = True
Object.Throw($OBJ, 0.0, 0.0, -3.0)
wait 5
0400: store_coords_to 21@ 22@ 23@ from_object $OBJ with_offset 0.0 0.0 -0.2
:NONAME_795
if
0AB0: key_pressed 101
else_jump @NONAME_844
25@ = 0.0
26@ = 0.0
0453: set_object $OBJ XYZ_rotation 25@ 26@ 18@
:NONAME_844
if
0AB0: key_pressed 53
else_jump @NONAME_887
18@ += 1.0
0453: set_object $OBJ XYZ_rotation 25@ 26@ 18@
wait 5
:NONAME_887
if
0AB0: key_pressed 52
else_jump @NONAME_930
18@ -= 1.0
0453: set_object $OBJ XYZ_rotation 25@ 26@ 18@
wait 5
:NONAME_930
if
0AB0: key_pressed 56
else_jump @NONAME_973
25@ -= 1.0
0453: set_object $OBJ XYZ_rotation 25@ 26@ 18@
wait 5
:NONAME_973
if
0AB0: key_pressed 57
else_jump @NONAME_1016
25@ += 1.0
0453: set_object $OBJ XYZ_rotation 25@ 26@ 18@
wait 5
:NONAME_1016
if
0AB0: key_pressed 55
else_jump @NONAME_1059
26@ += 1.0
0453: set_object $OBJ XYZ_rotation 25@ 26@ 18@
wait 5
:NONAME_1059
if
0AB0: key_pressed 54
else_jump @NONAME_1102
26@ -= 1.0
0453: set_object $OBJ XYZ_rotation 25@ 26@ 18@
wait 5
:NONAME_1102
if and
8AB0: not key_pressed 45
8AB0: not key_pressed 13
else_jump @NONAME_1827
if
8AB0: not key_pressed 46
else_jump @NONAME_1882
jump @NONAME_384
:NONAME_1143
wait 0
if
$KIT == 1
else_jump @NONAME_1172
jump @NONAME_1247
:NONAME_1172
if
$KIT == 2
else_jump @NONAME_1197
jump @NONAME_1392
:NONAME_1197
if
$KIT == 3
else_jump @NONAME_1222
jump @NONAME_1537
:NONAME_1222
if
$KIT == 4
else_jump @NONAME_1247
jump @NONAME_1682
:NONAME_1247
wait 0
Object.Destroy($OBJ)
Object.RemoveReferences($OBJ)
if and
0AB0: key_pressed 190
8AB0: not key_pressed 188
else_jump @NONAME_1323
if
$MODEL > 1207
else_jump @NONAME_1315
$MODEL -= 1
jump @NONAME_1323
:NONAME_1315
$MODEL = 1325
:NONAME_1323
if and
0AB0: key_pressed 188
8AB0: not key_pressed 190
else_jump @NONAME_1385
if
not $MODEL >= 1325
else_jump @NONAME_1377
$MODEL += 1
jump @NONAME_1385
:NONAME_1377
$MODEL = 1207
:NONAME_1385
jump @NONAME_275
:NONAME_1392
wait 0
Object.Destroy($OBJ)
Object.RemoveReferences($OBJ)
if and
0AB0: key_pressed 190
8AB0: not key_pressed 188
else_jump @NONAME_1468
if
$MODEL > 966
else_jump @NONAME_1460
$MODEL -= 1
jump @NONAME_1468
:NONAME_1460
$MODEL = 998
:NONAME_1468
if and
0AB0: key_pressed 188
8AB0: not key_pressed 190
else_jump @NONAME_1530
if
not $MODEL >= 998
else_jump @NONAME_1522
$MODEL += 1
jump @NONAME_1530
:NONAME_1522
$MODEL = 996
:NONAME_1530
jump @NONAME_275
:NONAME_1537
wait 0
Object.Destroy($OBJ)
Object.RemoveReferences($OBJ)
if and
0AB0: key_pressed 190
8AB0: not key_pressed 188
else_jump @NONAME_1613
if
$MODEL > 1575
else_jump @NONAME_1605
$MODEL -= 1
jump @NONAME_1613
:NONAME_1605
$MODEL = 1697
:NONAME_1613
if and
0AB0: key_pressed 188
8AB0: not key_pressed 190
else_jump @NONAME_1675
if
not $MODEL >= 1697
else_jump @NONAME_1667
$MODEL += 1
jump @NONAME_1675
:NONAME_1667
$MODEL = 1575
:NONAME_1675
jump @NONAME_275
:NONAME_1682
wait 0
Object.Destroy($OBJ)
Object.RemoveReferences($OBJ)
if and
0AB0: key_pressed 190
8AB0: not key_pressed 188
else_jump @NONAME_1758
if
$MODEL > 1942
else_jump @NONAME_1750
$MODEL -= 1
jump @NONAME_1758
:NONAME_1750
$MODEL = 2359
:NONAME_1758
if and
0AB0: key_pressed 188
8AB0: not key_pressed 190
else_jump @NONAME_1820
if
not $MODEL >= 2359
else_jump @NONAME_1812
$MODEL += 1
jump @NONAME_1820
:NONAME_1812
$MODEL = 1942
:NONAME_1820
jump @NONAME_275
:NONAME_1827
wait 0
if
0AB0: key_pressed 107
else_jump @NONAME_1860
Object.KeepInMemory($OBJ) = True
jump @NONAME_1865
:NONAME_1860
Object.RemoveReferences($OBJ)
:NONAME_1865
Model.Destroy($MODEL)
wait 500
jump @NONAME_2
:NONAME_1882
wait 0
Object.Destroy($OBJ)
Object.RemoveReferences($OBJ)
Model.Destroy($MODEL)
jump @NONAME_2
What is wrong in Object.KeepInMemory($OBJ) = True?
Thanks!