As I’ve started editing the main.scm and adding CLEO scripts to GTA 3, I’ve noticed that when I tell car to drive to certain coordinates, it will always find the nearest road and use that to get there. Typically this is good behavior; however, sometimes I need the car to drive directly to point I have specified and ignore all predefined paths in the map. So far I’ve been able to achieve this by creating a series of many points that are close together (or by using code to calculate and create all these points between two endpoints), but this is very tedious and makes my code messier than I’d prefer. I’ve been using two opcodes to make vehicles drive to specified points, which are 00A7 and 02C2. I’ve noticed no difference in their behavior, so I’m kind of wondering what the difference is there. I also suspect that the opcode 00AF might be the key to making a car ignore existing paths, but I’m not sure. I can’t find any information about that opcode online, so I have no idea what effects the number you enter into that opcode has. If anyone has any incite on how to make cars ignore existing paths or the functions of 00AF (or any similar opcodes), that’d be great.
Make vehicles ignore paths when driving to a specified point
Posted 13 August 2014 - 03:35 PM
Posted 13 August 2014 - 07:21 PM
That's a shame. I was able to find details about the 00AF opcode here, but none of them seemed to have the desired effect. I tried mission 14 (MISSION_GOTOCOORDS_ASTHECROWSWIMS), but it just made the car's front wheels turn around backwards and the car wouldn't move; presumably that vehicle mission is for boats and not cars. The most effective missions are 9 and 13 (MISSION_GOTOCOORDS_STRAIGHT and MISSION_GOTO_COORDS_STRAIGHT_ACCURATE) which seem to enlarge the area around the destination point where the car will ignore predefined paths and drive straight to the destination point (though it's still not a very big area). Based on the description the webpage I found gave of missions 8 and 12 (MISSION_GOTOCOORDS and MISSION_GOTOCOORDS_ACCURATE), I thought they would do what I want since the webpage says the car will drive to the destination point "from a far position", but they didn't seem to have much of an effect (if any) on the car behavior.
The reason I want to make cars ignore predefined paths is because I've converted the football stadium into a dirt bowl where I'm going to create Bloodring-esque side missions. The only problem is that all cars I create in the stadium immediately drive to the edge in an attempt to get back on the nearest road. Since paths are tied to the road models themselves, I'm thinking I might just edit the map layout and place pieces of road just beneath the stadium so that cars will follow the paths tied to these hidden road segments while inside the stadium. I know that this will also make cars spawn on these hidden pieces of road, but I think I should just be able to create a forbidden cars cube encasing the stadium to prevent that from happening. I think police cars can still spawn in forbidden car cubes when you have a wanted level, but this shouldn't matter because I will make your wanted level always be zero while you're participating in the Bloodring-esque missions.
I'm still curious what the difference between the 00A7 and 02C2 opcodes are if anyone knows.
Posted 13 August 2014 - 07:31 PM Edited by AdusPL, 13 August 2014 - 07:37 PM.
Posted 13 August 2014 - 07:54 PM
Hmm, what happens if you exceed that limit? Does the game crash or will cars simply not follow the paths on the new pieces of road? I had just planned on adding the road bits to "comNtop.ipl". Will that not work? I did add a single road piece to one of the Shoreside Vale ipls and it seemed to work fine (though I didn't poke around to see if other paths had then been disabled). That was also only a single road segment rather than the many that I'd add beneath the stadium, so maybe I just hadn't exceeded the limit yet? What happens if I create the road segments as objects when starting the Bloodring-esque side mission? Would the paths even be created with the road model in that case?
Posted 13 August 2014 - 08:31 PM
Posted 14 August 2014 - 04:24 AM Edited by (insert name here), 14 August 2014 - 04:25 AM.
Shucks, is there a way I can edit the stadium model so that it has vehicle paths attached to it? Then I'd only be adding one more model that has paths, so I'd still be within the limits.
Posted 14 August 2014 - 08:37 AM
Posted 15 August 2014 - 04:25 PM
That's not as many as I'd like, but it's certainly better than nothing. Since I can add two models with paths without the game crashing, that means I should be able to add ten paths within the stadium by breaking the stadium model into two models. How exactly do I attach new paths to a model? Does each path allow two-way traffic flow, or does each path only allow cars to drive in a single direction (because I'm pretty sure even when set to ignore all traffic laws, cars will still always drive the correct way on a street)? Can a single path curve, or does it have to be a straight line between two points?
Posted 15 August 2014 - 08:30 PM
I tried some time ago to add new paths and it didn't work. I'm not sure but I think they're similar to VC ones.
They can't curve, every line has it's own straight line, there's 12 lines limit for each object but you can add only 5, because of another limit (ARGHH).
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users