Irsis Posted July 28, 2020 Share Posted July 28, 2020 (edited) Hi. So i created blimp mod that flies in the sky as a object and created an LOD object for it so i can see it from far away. But when i load my save game, the game just crash. Turns out 0827: is the culprit. Is there anyway i can create LOD for moving object without using 0827: ? Thank you @ZAZ Script: {$CLEO .cs} 0000: NOP :Begin wait 0 if and Player.Defined($PLAYER_CHAR) $ACTIVE_INTERIOR == 0 $ONMISSION == 0 jf @Begin 077E: get_active_interior_to $ACTIVE_INTERIOR if or $ONMISSION == 1 not $ACTIVE_INTERIOR == 0 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere 877.9877 -28.3817 63.1953 radius 60.0 60.0 60.0 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere 2025.451 997.5287 10.8203 radius 60.0 60.0 60.0 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere -694.6745 956.7463 12.2547 radius 60.0 60.0 60.0 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere -2025.7168 157.9236 29.0391 radius 60.0 60.0 60.0 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere -2037.8574 -2525.165 30.625 radius 60.0 60.0 60.0 then if and Player.Defined($PLAYER_CHAR) 03CA: object [email protected] exists then end jump @Begin else 0005: [email protected] = 1374.0687 0005: [email protected] = -1889.2344 0005: [email protected] = 612.8045 0005: [email protected] = -1295.6091 if 0154: actor $PLAYER_ACTOR in_zone 'LA' then Model.Load(3151) 038B: load_requested_models jump @Create else 0005: [email protected] = -2697.0837 0005: [email protected] = 374.9268 0005: [email protected] = -1801.5999 0005: [email protected] = 1189.8759 if 0154: actor $PLAYER_ACTOR in_zone 'SF' then Model.Load(3151) 038B: load_requested_models jump @Create else 0005: [email protected] = 1574.1027 0005: [email protected] = 2159.2104 0005: [email protected] = 2486.0554 0005: [email protected] = 1407.873 if 0154: actor $PLAYER_ACTOR in_zone 'VE' then Model.Load(3151) 038B: load_requested_models jump @Create else if and Player.Defined($PLAYER_CHAR) 03CA: object [email protected] exists then end jump @Begin end end end end :Create wait 0 if Model.Available(3151) jf @Create [email protected] = 0 [email protected] = 0 [email protected] = 0 0208: [email protected] = random_float_in_ranges [email protected] [email protected] 0208: [email protected] = random_float_in_ranges [email protected] [email protected] 02CE: [email protected] = ground_z_at [email protected] [email protected] 1000.0 0009: [email protected] += 175.0 0208: [email protected] = random_float_in_ranges 0.0 360.0 Object.Create([email protected], 3151, [email protected], [email protected], [email protected]) Object.Angle([email protected]) = [email protected] Object.Create([email protected], 3151, 0.0, 0.0, 0.0) Object.Angle([email protected]) = [email protected] [email protected] = Audiostream.Load3D("CLEO\SOUND\BLIMP.MP3") Audiostream.LinkToObject([email protected],[email protected]) Audiostream.Loop([email protected],1) Audiostream.PerformAction([email protected], PLAY) 0392: make_object [email protected] moveable 1 0382: set_object [email protected] collision_detection 1 0827: assign_object [email protected] to_lod_object [email protected] 069A: attach_object [email protected] to_object [email protected] with_offset 0.0 0.0 0.0 rotation 0.0 0.0 0.0 Model.Destroy(3151) jump @Variable :Variable wait 0 0004: [email protected] = 0 0208: [email protected] = random_float_in_ranges -0.1 0.1 if or -0.05 > [email protected] [email protected] > 0.05 jf @Variable jump @If :Fly wait 0 0400: store_coords_to [email protected] [email protected] [email protected] from_object [email protected] with_offset 0.0 0.1 0.0 034E: move_object [email protected] to [email protected] [email protected] [email protected] speed 0.5 0.5 0.5 collision_check 0 [email protected] = Object.Angle([email protected]) 005B: [email protected] += [email protected] Object.Angle([email protected]) = [email protected] jump @Lights :Lights 00BF: [email protected] = current_time_hours, [email protected] = current_time_minutes if or 0019: [email protected] > 19 001B: 6 > [email protected] then if not [email protected] > 9 then 024F: create_corona_with_radius 20.0 type 1 lensflares 0 with_color 255 255 0 at [email protected] [email protected] [email protected] 024F: create_corona_with_radius 20.0 type 1 lensflares 0 with_color 255 255 255 at [email protected] [email protected] [email protected] 024F: create_corona_with_radius 15.0 type 1 lensflares 0 with_color 255 0 0 at [email protected] [email protected] [email protected] 024F: create_corona_with_radius 20.0 type 1 lensflares 0 with_color 255 255 255 at [email protected] [email protected] [email protected] 0008: [email protected] += 1 else Object.StorePos([email protected], [email protected], [email protected], [email protected]) 0400: store_coords_to [email protected] [email protected] [email protected] from_object [email protected] with_offset 0.0 0.0 7.0 0400: store_coords_to [email protected] [email protected] [email protected] from_object [email protected] with_offset 0.0 -40.0 20.0 0400: store_coords_to [email protected] [email protected] [email protected] from_object [email protected] with_offset 0.0 40.0 15.0 0004: [email protected] = 0 end end jump @If :If if 0154: actor $PLAYER_ACTOR in_zone 'LA' jf @If2 [email protected] = 1 077E: get_active_interior_to $ACTIVE_INTERIOR if or $ONMISSION == 1 not $ACTIVE_INTERIOR == 0 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere 877.9877 -28.3817 63.1953 radius 60.0 60.0 60.0 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere 2025.451 997.5287 10.8203 radius 60.0 60.0 60.0 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere -694.6745 956.7463 12.2547 radius 60.0 60.0 60.0 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere -2025.7168 157.9236 29.0391 radius 60.0 60.0 60.0 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere -2037.8574 -2525.165 30.625 radius 60.0 60.0 60.0 jf @Fly2 jump @End :Fly2 if 8154: not actor $PLAYER_ACTOR in_zone 'LA' jf @Fly5 jump @End :If2 if 0154: actor $PLAYER_ACTOR in_zone 'SF' jf @If3 [email protected] = 1 077E: get_active_interior_to $ACTIVE_INTERIOR if or $ONMISSION == 1 not $ACTIVE_INTERIOR == 0 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere 877.9877 -28.3817 63.1953 radius 60.0 60.0 60.0 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere 2025.451 997.5287 10.8203 radius 60.0 60.0 60.0 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere -694.6745 956.7463 12.2547 radius 60.0 60.0 60.0 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere -2025.7168 157.9236 29.0391 radius 60.0 60.0 60.0 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere -2037.8574 -2525.165 30.625 radius 60.0 60.0 60.0 jf @Fly3 jump @End :Fly3 if 8154: not actor $PLAYER_ACTOR in_zone 'SF' jf @Fly5 jump @End :If3 if 0154: actor $PLAYER_ACTOR in_zone 'VE' jf @End [email protected] = 1 077E: get_active_interior_to $ACTIVE_INTERIOR if or $ONMISSION == 1 not $ACTIVE_INTERIOR == 0 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere 877.9877 -28.3817 63.1953 radius 60.0 60.0 60.0 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere 2025.451 997.5287 10.8203 radius 60.0 60.0 60.0 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere -694.6745 956.7463 12.2547 radius 60.0 60.0 60.0 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere -2025.7168 157.9236 29.0391 radius 60.0 60.0 60.0 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere -2037.8574 -2525.165 30.625 radius 60.0 60.0 60.0 jf @Fly4 jump @End :Fly4 if 8154: not actor $PLAYER_ACTOR in_zone 'VE' jf @Fly5 jump @End :Fly5 if [email protected] == 1 jf @Fly6 if 8154: not actor $PLAYER_ACTOR in_zone 'LA' jf @Fly6 [email protected] = 0 jump @End :Fly6 if [email protected] == 1 jf @Fly7 if 8154: not actor $PLAYER_ACTOR in_zone 'SF' jf @Fly7 [email protected] = 0 jump @End :Fly7 if [email protected] == 1 jf @Fly if 8154: not actor $PLAYER_ACTOR in_zone 'VE' jf @Fly [email protected] = 0 jump @End :End Audiostream.Release([email protected]) if 03CA: object [email protected] exists jf @End2 Object.Destroy([email protected]) :End2 if 03CA: object [email protected] exists jf @Begin Object.Destroy([email protected]) jump @Begin Edited July 28, 2020 by Irsis Link to comment Share on other sites More sharing options...
OrionSR Posted July 28, 2020 Share Posted July 28, 2020 (edited) I'm not sure if I can be of much help as I don't have much experience with objects, but I'm expecting 0827: to work. Main.scm uses this code for the cranes, which move. Can you isolate this issue in a smaller script just to see how it works? I found something else though. {$CLEO .cs} suggests this is a PC script, so [email protected] is TIMERA, an inappropriate and ever increasing integer - bound to cause trouble for the z level of an object. Also, the extra spacing and inconsistent indenting was making it hard to read the code. I tried to clean things up but ran into a few odd quirks. I'm not sure how this would effect the script, but it should probably be looked at. Two IF THEN END statements had no commands for THEN, and when I got to the end of the main loop I had an extra END. (Nope figured that out and updated.) Reformatting only, except for added // !!! comments: Spoiler {$CLEO .cs} 0000: NOP :Begin wait 0 if and Player.Defined($PLAYER_CHAR) $ACTIVE_INTERIOR == 0 $ONMISSION == 0 jf @Begin 077E: get_active_interior_to $ACTIVE_INTERIOR if or $ONMISSION == 1 not $ACTIVE_INTERIOR == 0 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere 877.9877 -28.3817 63.1953 radius 60.0 60.0 60.0 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere 2025.451 997.5287 10.8203 radius 60.0 60.0 60.0 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere -694.6745 956.7463 12.2547 radius 60.0 60.0 60.0 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere -2025.7168 157.9236 29.0391 radius 60.0 60.0 60.0 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere -2037.8574 -2525.165 30.625 radius 60.0 60.0 60.0 then if and Player.Defined($PLAYER_CHAR) 03CA: object [email protected] exists then // !!! end jump @Begin else 0005: [email protected] = 1374.0687 0005: [email protected] = -1889.2344 0005: [email protected] = 612.8045 0005: [email protected] = -1295.6091 if 0154: actor $PLAYER_ACTOR in_zone 'LA' then Model.Load(3151) 038B: load_requested_models jump @Create else 0005: [email protected] = -2697.0837 0005: [email protected] = 374.9268 0005: [email protected] = -1801.5999 0005: [email protected] = 1189.8759 if 0154: actor $PLAYER_ACTOR in_zone 'SF' then Model.Load(3151) 038B: load_requested_models jump @Create else 0005: [email protected] = 1574.1027 0005: [email protected] = 2159.2104 0005: [email protected] = 2486.0554 0005: [email protected] = 1407.873 if 0154: actor $PLAYER_ACTOR in_zone 'VE' then Model.Load(3151) 038B: load_requested_models jump @Create else if and Player.Defined($PLAYER_CHAR) 03CA: object [email protected] exists then // !!! end jump @Begin end end end end :Create wait 0 if Model.Available(3151) jf @Create [email protected] = 0 [email protected] = 0 [email protected] = 0 0208: [email protected] = random_float_in_ranges [email protected] [email protected] 0208: [email protected] = random_float_in_ranges [email protected] [email protected] 02CE: [email protected] = ground_z_at [email protected] [email protected] 1000.0 0009: [email protected] += 175.0 0208: [email protected] = random_float_in_ranges 0.0 360.0 Object.Create([email protected], 3151, [email protected], [email protected], [email protected]) Object.Angle([email protected]) = [email protected] Object.Create([email protected], 3151, 0.0, 0.0, 0.0) Object.Angle([email protected]) = [email protected] [email protected] = Audiostream.Load3D("CLEO\SOUND\BLIMP.MP3") Audiostream.LinkToObject([email protected],[email protected]) Audiostream.Loop([email protected],1) Audiostream.PerformAction([email protected], PLAY) 0392: make_object [email protected] moveable 1 0382: set_object [email protected] collision_detection 1 0827: assign_object [email protected] to_lod_object [email protected] 069A: attach_object [email protected] to_object [email protected] with_offset 0.0 0.0 0.0 rotation 0.0 0.0 0.0 Model.Destroy(3151) jump @Variable :Variable wait 0 0004: [email protected] = 0 0208: [email protected] = random_float_in_ranges -0.1 0.1 if or -0.05 > [email protected] [email protected] > 0.05 jf @Variable jump @If :Fly wait 0 0400: store_coords_to [email protected] [email protected] [email protected] from_object [email protected] with_offset 0.0 0.1 0.0 // !!! [email protected] is TIMERA on PC 034E: move_object [email protected] to [email protected] [email protected] [email protected] speed 0.5 0.5 0.5 collision_check 0 [email protected] = Object.Angle([email protected]) 005B: [email protected] += [email protected] Object.Angle([email protected]) = [email protected] jump @Lights :Lights 00BF: [email protected] = current_time_hours, [email protected] = current_time_minutes if or 0019: [email protected] > 19 001B: 6 > [email protected] then if not [email protected] > 9 then 024F: create_corona_with_radius 20.0 type 1 lensflares 0 with_color 255 255 0 at [email protected] [email protected] [email protected] 024F: create_corona_with_radius 20.0 type 1 lensflares 0 with_color 255 255 255 at [email protected] [email protected] [email protected] 024F: create_corona_with_radius 15.0 type 1 lensflares 0 with_color 255 0 0 at [email protected] [email protected] [email protected] 024F: create_corona_with_radius 20.0 type 1 lensflares 0 with_color 255 255 255 at [email protected] [email protected] [email protected] 0008: [email protected] += 1 else Object.StorePos([email protected], [email protected], [email protected], [email protected]) // !!! [email protected] is TIMERA on PC 0400: store_coords_to [email protected] [email protected] [email protected] from_object [email protected] with_offset 0.0 0.0 7.0 0400: store_coords_to [email protected] [email protected] [email protected] from_object [email protected] with_offset 0.0 -40.0 20.0 0400: store_coords_to [email protected] [email protected] [email protected] from_object [email protected] with_offset 0.0 40.0 15.0 0004: [email protected] = 0 end end jump @If :If if 0154: actor $PLAYER_ACTOR in_zone 'LA' jf @If2 [email protected] = 1 077E: get_active_interior_to $ACTIVE_INTERIOR if or $ONMISSION == 1 not $ACTIVE_INTERIOR == 0 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere 877.9877 -28.3817 63.1953 radius 60.0 60.0 60.0 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere 2025.451 997.5287 10.8203 radius 60.0 60.0 60.0 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere -694.6745 956.7463 12.2547 radius 60.0 60.0 60.0 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere -2025.7168 157.9236 29.0391 radius 60.0 60.0 60.0 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere -2037.8574 -2525.165 30.625 radius 60.0 60.0 60.0 jf @Fly2 jump @End :Fly2 if 8154: not actor $PLAYER_ACTOR in_zone 'LA' jf @Fly5 jump @End :If2 if 0154: actor $PLAYER_ACTOR in_zone 'SF' jf @If3 [email protected] = 1 077E: get_active_interior_to $ACTIVE_INTERIOR if or $ONMISSION == 1 not $ACTIVE_INTERIOR == 0 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere 877.9877 -28.3817 63.1953 radius 60.0 60.0 60.0 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere 2025.451 997.5287 10.8203 radius 60.0 60.0 60.0 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere -694.6745 956.7463 12.2547 radius 60.0 60.0 60.0 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere -2025.7168 157.9236 29.0391 radius 60.0 60.0 60.0 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere -2037.8574 -2525.165 30.625 radius 60.0 60.0 60.0 jf @Fly3 jump @End :Fly3 if 8154: not actor $PLAYER_ACTOR in_zone 'SF' jf @Fly5 jump @End :If3 if 0154: actor $PLAYER_ACTOR in_zone 'VE' jf @End [email protected] = 1 077E: get_active_interior_to $ACTIVE_INTERIOR if or $ONMISSION == 1 not $ACTIVE_INTERIOR == 0 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere 877.9877 -28.3817 63.1953 radius 60.0 60.0 60.0 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere 2025.451 997.5287 10.8203 radius 60.0 60.0 60.0 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere -694.6745 956.7463 12.2547 radius 60.0 60.0 60.0 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere -2025.7168 157.9236 29.0391 radius 60.0 60.0 60.0 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere -2037.8574 -2525.165 30.625 radius 60.0 60.0 60.0 jf @Fly4 jump @End :Fly4 if 8154: not actor $PLAYER_ACTOR in_zone 'VE' jf @Fly5 jump @End :Fly5 if [email protected] == 1 jf @Fly6 if 8154: not actor $PLAYER_ACTOR in_zone 'LA' jf @Fly6 [email protected] = 0 jump @End :Fly6 if [email protected] == 1 jf @Fly7 if 8154: not actor $PLAYER_ACTOR in_zone 'SF' jf @Fly7 [email protected] = 0 jump @End :Fly7 if [email protected] == 1 jf @Fly if 8154: not actor $PLAYER_ACTOR in_zone 'VE' jf @Fly [email protected] = 0 jump @End :End Audiostream.Release([email protected]) if 03CA: object [email protected] exists jf @End2 Object.Destroy([email protected]) :End2 if 03CA: object [email protected] exists jf @Begin Object.Destroy([email protected]) jump @Begin Edited July 28, 2020 by OrionSR Irsis 1 Link to comment Share on other sites More sharing options...
Irsis Posted July 28, 2020 Author Share Posted July 28, 2020 Tried to remove 0827: , the game is not crashing when i load my game. So i guess 0827: works in main.scm only? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now