Jump to content

VC coding problems


Recommended Posts

Hi I wanned to start this topic to get some help. So, I have a question. There is a guy in a mission who enters a car. You have to drive it somewhere. I do not tie actor to a player, becouse I want actor to stay in car. The thing is when I re-enter car ( leave - nothing, but when enter again) the guy leaves it. As he is not tied to player he does not enter the car anymore. Maybe I could get some advices and explanation, please? Thank you.

Link to comment
https://gtaforums.com/topic/269993-vc-coding-problems/
Share on other sites

Thats right. But maybe you know the opcode I need, couse I cant find it. There is one which keeps trapped PLAYER, but not ACTOR. I cnat find anything like locking. So, please, help me.

Link to comment
https://gtaforums.com/topic/269993-vc-coding-problems/#findComment-4104444
Share on other sites

Piece of the code:

 

02A3: toggle_widescreen 1 (on)

01B4: set_player $PLAYER_CHAR frozen_state 1 (unfrozen)

015F: set_camera_position -1197.415 -414.84 11.965 0.0 0.0 0.0

00A5: $6DD = create_car #CUBAN at -1193.019 -415.049 9.223

0175: set_car $6DD z_angle_to 90.0

0055: put_player $PLAYER_CHAR at -1191.6 -421.746 9.953

0157: camera_on_player $PLAYER_CHAR 15 2

009A: $6DE = create_actor 4 #CBA at -1192.6 -421.746 9.953

020F: actor $6DE look_at_player $PLAYER_CHAR

020E: actor $PLAYER_ACTOR look_at_actor $6DE

0001: wait 1000 ms

0372: set_actor $6DE anim 31 wait_state_time 3000 ms

00BC: text_highpriority "COK4_21" 5000 ms 1 \\

0001: wait 5000 ms

0372: set_actor $PLAYER_ACTOR anim 31 wait_state_time 3000 ms

00BC: text_highpriority "COK4_22" 4000 ms 1 \\

0001: wait 4000 ms

0372: set_actor $6DE anim 31 wait_state_time 3000 ms

00BC: text_highpriority "COK4_23" 5000 ms 1 \\

0001: wait 5000 ms

00BC: text_highpriority "COK4_29" 5000 ms 1 \\

0211: actor $PLAYER_ACTOR walk_to -1193.019 -415.049

01D4: actor $6DE go_to_car $6DD and_enter_it_as_a_passenger

 

:Label03CF50

0001: wait 0 ms

00D6: if 0

00F6: player $PLAYER_CHAR 0 ()near_point_on_foot -1193.019 -416.049 9.223 radius 1.0 1.0 5.5

004D: jump_if_false £Label03CF50

015F: set_camera_position -1197.415 -414.84 25.965 0.0 0.0 0.0

0460: set_camera_pointing_time 0.0 5000

0160: point_camera -827.505 -512.363 15.773 1

016A: fade 0 () 7500 ms

01D5: actor $PLAYER_ACTOR go_to_and_drive_car $6DD

 

:Label03CFD0

0001: wait 0 ms

00D6: if 1

00DB: actor $PLAYER_ACTOR in_car $6DD

00DB: actor $6DE in_car $6DD

004D: jump_if_false £Label03CFD0

009B: destroy_actor_instantly $6DE

01C8: $6DE = create_actor 10 #CBA in_car $6DD passenger_seat 0

016A: fade 1 (back) 1500 ms

02EB: restore_camera_with_jumpcut

02A3: toggle_widescreen 0 (off)

01B4: set_player $PLAYER_CHAR frozen_state 1 (unfrozen)

018A: $6DF = create_checkpoint_at -991.525 -30.822 9.695

03BC: $6E0 = create_sphere -991.525 -30.822 9.695 2.0

00BC: text_highpriority "COK4_6" 5000 ms 1 \\

03F1: pedtype 8 add_threat 1

 

The same problem... Why it happens. I even tried not scared flag...

Link to comment
https://gtaforums.com/topic/269993-vc-coding-problems/#findComment-4106047
Share on other sites

well ia am still working on VC copy. tomorrow i will have it. but i can see that in your code we are talking about 2 actors:

the one who is entering the vehicle and the one who didn't make it in the time and you spawn him inside. now which one steps out 1 or 2 or 1&2. and why actor2 has a pedtype 10 and actor1 has pedtype 4?

Link to comment
https://gtaforums.com/topic/269993-vc-coding-problems/#findComment-4108183
Share on other sites

Ok at first there was only one actor which manages to enter the car, but when i noticed the problem (so the 1st does it) I decided to make another actor in car. But the second one does the same thing. Thats why there are 2 actors. Speaking about the pedtypes, well I dont know what it does and it does not do any bad things so I leave it. There was no readme about pedtypes in MB.

Link to comment
https://gtaforums.com/topic/269993-vc-coding-problems/#findComment-4109338
Share on other sites

Hi, I'd like to ask about creating garages. I tried to a new garage type 18 for saving cars. The thing is that it does not save my cars. The garage does not have doors. I'd like to know is this the problem or doors do not have any influence?

Link to comment
https://gtaforums.com/topic/269993-vc-coding-problems/#findComment-4120531
Share on other sites

Hi, I wanted to create working electric gates:

 

:Label00A455

0001: wait 0 ms

00D6: if 0

0256: player $PLAYER_CHAR defined

004D: jump_if_false ££Label00A455

00D6: if 0

0057: player $PLAYER_CHAR 0 ()in_cube -768.799 1250.057 .09 -748.799 1230.057 20.09

004D: jump_if_false ££Label00A455

018D: $C = create_sound 2 at -768.799 1250.057 .09

 

:Label00A4AF

00D6: if 0

834E: NOT unknown_move_object $2B to -745.799 1239.657 10.29 unknown_angle .1 .1 0.0 0

004D: jump_if_false ££Label00A4EA

0001: wait 0 ms

0002: jump ££Label00A4AF

 

:Label00A4EA

018E: stop_sound $C

 

:Label00A4EF

0001: wait 0 ms

00D6: if 0

0256: player $PLAYER_CHAR defined

004D: jump_if_false ££Label00A4EF

00D6: if 0

8057: NOT player $PLAYER_CHAR 0 ()in_cube -768.799 1250.057 .09 -748.799 1230.057 20.09

004D: jump_if_false ££Label00A4EF

018D: $C = create_sound 2 at -768.799 1250.057 .09

 

:Label00A549

00D6: if 0

834E: NOT unknown_move_object $2B to -751.583 1239.66 10.239 unknown_angle .1 .1 0.0 0

004D: jump_if_false ££Label00A584

0001: wait 0 ms

0002: jump ££Label00A549

 

:Label00A584

018E: stop_sound $C

0002: jump ££Label00A455

 

The gates are created at -751.583 1239.66 10.239

 

The thing is that the gates open buut do not close and I dont know why. Maybe someone could explain?

Link to comment
https://gtaforums.com/topic/269993-vc-coding-problems/#findComment-4144763
Share on other sites

Heey! I found it out. I have to use opcode 0526 and the actor doesnt leave the car anymore. (yes, I tried pedtypes and it didnt work, but hey I know what I had to do). By the way, I am using BW vice builder v1.1, so 0526 is written unknown_actor $abc 1

Link to comment
https://gtaforums.com/topic/269993-vc-coding-problems/#findComment-4161322
Share on other sites

  • 2 weeks later...

Hey, I have a strange problem. In my mission you have to go to the point (Little havana), but for some reason the sphere, checkpoint appear there (and the mission starts working) if I am in other zone(not little havana). But there are no conditionals related with zonesor smth like that. I have no idea whats wrong...

Link to comment
https://gtaforums.com/topic/269993-vc-coding-problems/#findComment-4188772
Share on other sites

 

Heey! I found it out. I have to use opcode 0526 and the actor doesnt leave the car anymore. (yes, I tried pedtypes and it didnt work, but hey I know what I had to do). By the way, I am using BW vice builder v1.1, so 0526 is written unknown_actor $abc 1

Great job! Tell me though, as I've been trying to work around this for over a year, where do you put that code? After the actor is in the car? This is about the only alternative I haven't tried yet. And does it override 03E2 (make actor leave any vehicle)

 

Thanks!

Edited by ceedj
Link to comment
https://gtaforums.com/topic/269993-vc-coding-problems/#findComment-4188871
Share on other sites

I've tested it a bit and here's what I've learned:

1. There is no difference when 0526 is used. U can use it when U create the actor (even not in a car). When he enters it he won't leave it.

2. If U use 03E2 and 0526 is used the actor WILL LEAVE the car.

But I forgot to test it when actor is tied to player...

And still it would be great if someone advised me with that area problem....

Link to comment
https://gtaforums.com/topic/269993-vc-coding-problems/#findComment-4190890
Share on other sites

spaceeinstein

If you kept up with the LC mod, the problem you had was the exact problem the LC team had in Marty's missions. I managed to fix it with this:

039E: (unknown) $THE_CROOK_BANK_MANAGER 1 (this is known, ignore the unknown)

0526: unknown_actor $THE_CROOK_BANK_MANAGER 1

You can check the source code at LabelLC02B065 to see how it worked. I copied it off LabelLC02F3F9. You can also see that to see how it worked.

Edited by spaceeinstein
Link to comment
https://gtaforums.com/topic/269993-vc-coding-problems/#findComment-4191480
Share on other sites

Hi, I have a problem:

 

 

 

0084: $816 = $C2  \\ integer values and handles021B: set_garage $1F to_accept_car $8160360: open_garage $1F:LOOP10001: wait  0 ms00D6: if  0810F:   NOT   player $PLAYER_CHAR wanted_level >  0004D: jump_if_false £FAILED00D6: if  08119:   NOT   car $C2 wrecked004D: jump_if_false £FAILED00D6: if  000DC:   player $PLAYER_CHAR driving $C2004D: jump_if_false £NOT_DRIVING00D6: if  000B0:   car $C2  0 ()in_rectangle  449.137  340.002  465.43  326.187004D: jump_if_false £LOOP1:LOOP20001: wait  0 ms00D6: if  0810F:   NOT   player $PLAYER_CHAR wanted_level >  0004D: jump_if_false £FAILED00D6: if  08119:   NOT   car $C2 wrecked004D: jump_if_false £FAILED00D6: if  000B0:   car $C2  0 ()in_rectangle  449.137  340.002  465.43  326.187004D: jump_if_false £AGAIN100D6: if  18056:   NOT   player $PLAYER_CHAR  0 ()in_rectangle  449.137  340.002  465.43  326.187021C:   car_inside_garage $1F004D: jump_if_false £LOOP20361: close_garage $1F0002: jump £PASSED:AGAIN10186: $814 = create_marker_above_car $C20164: disable_marker $815:DRIVING0001: wait  0 ms00D6: if  0810F:   NOT   player $PLAYER_CHAR wanted_level >  0004D: jump_if_false £FAILED00D6: if  08119:   NOT   car $C2 wrecked004D: jump_if_false £FAILED00D6: if  000DC:   player $PLAYER_CHAR driving $C2004D: jump_if_false £DRIVING0164: disable_marker $8140002: jump £LOOP1

 

 

 

I have to bring a car, but when i leave it in the garage the door closes but I do not pass the mission. I dont know why. The garage type is 23 (like in Sir,yes sir) and the rectangle is a garage area. It would be great if someone helped me.

Edited by BEGINit
Link to comment
https://gtaforums.com/topic/269993-vc-coding-problems/#findComment-4202812
Share on other sites

Well, I tried this:

 

 

 

:LOOP20001: wait  0 ms00D6: if  0810F:   NOT   player $PLAYER_CHAR wanted_level >  0004D: jump_if_false £FAILED00D6: if  08119:   NOT   car $C2 wrecked004D: jump_if_false £FAILED00D6: if  000B0:   car $C2  0 ()in_rectangle  449.137  340.002  465.43  326.187004D: jump_if_false £AGAIN100D6: if  18056:   NOT   player $PLAYER_CHAR  0 ()in_rectangle  449.137  340.002  465.43  326.187021C:   car_inside_garage $1F004D: jump_if_false £LOOP20361: close_garage $1F:CLOSED0001: wait  0 ms 00D6: if  0 03B1:   garage $1F door closed  004D: jump if false £CLOSED0002: jump £PASSED

 

 

And it still doesnt work... sad.gif

Link to comment
https://gtaforums.com/topic/269993-vc-coding-problems/#findComment-4204650
Share on other sites

I'm sorry but I just dont understand what you say. Could you explain more? I tried to remove opcode close_garage, remove opcode and closed_door check, use check without opcode and still nothing. Heres the code again:

 

 

:START018A: $815 = create_checkpoint_at  457.82  336.061  10.8530084: $816 = $C2  \\ integer values and handles021B: set_garage $1F to_accept_car $8160360: open_garage $1F:LOOP10001: wait  0 ms00D6: if  0810F:   NOT   player $PLAYER_CHAR wanted_level >  0004D: jump_if_false £M_FAILED00D6: if  08119:   NOT   car $C2 wrecked004D: jump_if_false £M_FAILED00D6: if  000DC:   player $PLAYER_CHAR driving $C2004D: jump_if_false £NOT_DRIVING00D6: if  000B0:   car $C2  0 ()in_rectangle  449.137  340.002  465.43  326.187004D: jump_if_false £LOOP10164: disable_marker $815:LOOP20001: wait  0 ms00D6: if  0810F:   NOT   player $PLAYER_CHAR wanted_level >  0004D: jump_if_false £M_FAILED00D6: if  08119:   NOT   car $C2 wrecked004D: jump_if_false £M_FAILED00D6: if  000B0:   car $C2  0 ()in_rectangle  449.137  340.002  465.43  326.187004D: jump_if_false £NOT_DRIVING00D6: if  18056:   NOT   player $PLAYER_CHAR  0 ()in_rectangle  449.137  340.002  465.43  326.187021C:   car_inside_garage $1F004D: jump_if_false £LOOP20361: close_garage $1F:CLOSED0001: wait  0 ms 00D6: if  0 03B1:   garage $1F door closed  004D: jump if false £CLOSED0002: jump £M_PASSED:NOT_DRIVING0186: $814 = create_marker_above_car $C20164: disable_marker $815:DRIVING0001: wait  0 ms00D6: if  0810F:   NOT   player $PLAYER_CHAR wanted_level >  0004D: jump_if_false £M_FAILED00D6: if  08119:   NOT   car $C2 wrecked004D: jump_if_false £M_FAILED00D6: if  000DC:   player $PLAYER_CHAR driving $C2004D: jump_if_false £DRIVING0164: disable_marker $814018A: $815 = create_checkpoint_at  457.82  336.061  10.8530002: jump £LOOP1:M_PASSED01E3: text_1number_styled "M_PASS"  800  5000 ms  1 \\ MISSION PASSED! $~1~0109: player $PLAYER_CHAR money +=  8000110: clear_player $PLAYER_CHAR wanted_level0394: play_music  10051: return:M_FAILED00BA: text_styled "M_FAIL"  5000 ms  1 \\ MISSION FAILED!0051: return

 

Link to comment
https://gtaforums.com/topic/269993-vc-coding-problems/#findComment-4204838
Share on other sites

i misunderstood too. i was thinking it passes because you wrote that garage closed but it seems to be it closed automatically not by the opcode.

now it should pass the mission if you semicolon the lines:

 

00D6: if  18056:   NOT   player $PLAYER_CHAR  0 ()in_rectangle  449.137  340.002  465.43  326.187021C:   car_inside_garage $1F004D: jump_if_false £LOOP2

 

in other case semicolon previous car in rectangle checks. i strongly believe that one of checks does not work as expected (like onfoot/driving/stopped stuff).

 

you could put some tracer inside code like onscreen display of a global variable that gets different values in different places of the code- you will be able to monitor what is happening.

Edited by PLPynton
Link to comment
https://gtaforums.com/topic/269993-vc-coding-problems/#findComment-4205110
Share on other sites

  • 2 weeks later...
  • 1 month later...

Hello, guys.. Its been a while since I wrote here but here I have a problem. Im creating a mission where a lot of mafiosos attack prawn island's mansions... ok during the begining there is this:

 

car1:

 

 

00A5: $s1 = create_car #SENTINEL at  278.407  955.719  22.9820175: set_car $s1 z_angle_to  90.00129: $m1 = create_actor  4 #PGA in_car $s1 driverseat01B2: give_actor $m1 weapon  25 ammo  9999  \\ Load the weapon model before using this01C8: $m2 = create_actor  10 #PGB in_car $s1 passenger_seat  001B2: give_actor $m2 weapon  25 ammo  9999  \\ Load the weapon model before using this01C8: $m3 = create_actor  10 #PGA in_car $s1 passenger_seat  101B2: give_actor $m3 weapon  25 ammo  9999  \\ Load the weapon model before using this01C8: $m4 = create_actor  10 #PGB in_car $s31passenger_seat  201B2: give_actor $m4 weapon  25 ammo  9999  \\ Load the weapon model before using this00AD: set_car $s1 max_speed_to  40.004BA: set_car $s1 speed_instantly  30.000AE: unknown_set_car $s1 to_ignore_traffic_lights  202C2: car $s1 drive_to_point  15.621  1032.973  9.868

 

car2:

 

 

00A5: $s2 = create_car #SENTINEL at -176.176  1076.99  14.4310175: set_car $s2 z_angle_to  270.00129: $m5 = create_actor  4 #PGA in_car $s2 driverseat01B2: give_actor $m5 weapon  25 ammo  9999  \\ Load the weapon model before using this01C8: $m6 = create_actor  10 #PGB in_car $s2 passenger_seat  001B2: give_actor $m6 weapon  25 ammo  9999  \\ Load the weapon model before using this01C8: $m7 = create_actor  10 #PGA in_car $s2 passenger_seat  101B2: give_actor $m7 weapon  25 ammo  9999  \\ Load the weapon model before using this01C8: $m8 = create_actor  10 #PGB in_car $s2 passenger_seat  201B2: give_actor $m8 weapon  25 ammo  9999  \\ Load the weapon model before using this00AD: set_car $s2 max_speed_to  40.004BA: set_car $s2 speed_instantly  30.000AE: unknown_set_car $s2 to_ignore_traffic_lights  202C2: car $s2 drive_to_point -6.241  1045.109  9.871

 

 

and there are:

 

 

0050: gosub £killplayer0050: gosub £car1here0050: gosub £car2here

 

and of course:

 

 

:killplayer00D6: if  00038:   $8DD ==  1  \\ integer values004D: jump_if_false £Label04D3D800D6: if  00118:   actor $8C8 dead004D: jump_if_false £Label04D3A801CC: actor $8m5 kill_player $PLAYER_CHAR:Label04D3A800D6: if  00118:   actor $8C9 dead004D: jump_if_false £Label04D3C001CC: actor $m6 kill_player $PLAYER_CHAR:Label04D3C000D6: if  00118:   actor $8CA dead004D: jump_if_false £Label04D3D801CC: actor $m7 kill_player $PLAYER_CHAR:Label04D3D80051: return

 

 

 

:car1here00D6: if  08038:   NOT   $8D8 ==  1  \\ integer values004D: jump_if_false £Label04D55000D6: if  08119:   NOT   car $s1 wrecked004D: jump_if_false £Label04D55000D6: if  001AF:   car $s1  0 ()near_point  15.621  1032.973  9.868 radius  1.5  1.5  3.0004D: jump_if_false £Label04D55001CA: actor $m1 kill_player $PLAYER_CHAR01CA: actor $m2 kill_player $PLAYER_CHAR01CA: actor $m3 kill_player $PLAYER_CHAR01CA: actor $m4 kill_player $PLAYER_CHAR0187: $8D9 = create_marker_above_actor $m10187: $8DA = create_marker_above_actor $m20187: $8DB = create_marker_above_actor $m30187: $8DC = create_marker_above_actor $m40004: $8D8 =  1  \\ integer values:Label04D5500051: return

 

 

:car2here00D6: if  08038:   NOT   $8DD ==  1  \\ integer values004D: jump_if_false £Label04D5EB00D6: if  08119:   NOT   car $s2 wrecked004D: jump_if_false £Label04D5EB00D6: if  001AF:   car $s2  0 ()near_point -6.241  1045.109  9.871 radius  1.5  1.5  3.0004D: jump_if_false £Label04D5EB01C9: actor $m5 kill_actor $8C8 (these are other gangs members)01C9: actor $m6 kill_actor $8C901C9: actor $m7 kill_actor $8CA01CA: actor $m8 kill_player $PLAYER_CHAR0187: $8DE = create_marker_above_actor $m50187: $8DF = create_marker_above_actor $m60187: $8E0 = create_marker_above_actor $m70187: $8E1 = create_marker_above_actor $m80004: $8DD =  1  \\ integer values:Label04D5EB0051: return

 

 

ok, so problems are with this code and I dont really know what to do. Here's the problem with the first car. Sometimes (not always) it stops not reached the point. the mafiosos dont do anything, no markers etc. The car just stops... In this case if the player destroys the car while the mafiosos inside the game crashes...

now the problem with another car... well it reaches the place everytime, markers appear but when they kill the other mafiosos they should kill me, but they dont. Instead, they return to the car and wait(like another ones do). But this time they try to kill me if i get closer (another ones dont). Again the game crashes if i try to destroy the car while they are inside.

So, please, could someone help me and explain whats wrong? Thank you very much.

Link to comment
https://gtaforums.com/topic/269993-vc-coding-problems/#findComment-4326892
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 0 User Currently Viewing
    0 members, 0 Anonymous, 0 Guests

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.