Forum Mod Bakery Docs

My Hit and Collect Mission is crashing, i'm sure all my functions are entered correctly

Posted in Support
Please login to contribute to the conversation.


Before the second stage i had spawned the vehicle etc and did all the necessary stuff, i've loaded all the p3d's needed and still im crashing upon entering this stage, please forgive me for always posting for help as my scripting skills are non-existant and i can only make a few basic missions and follow and destroy missions.

But yeah, if you could let me know what's wrong that would be awesome.
Are you loading h_soda, inhaler, lwnchair, bonebox, and coolr's p3d files?
Yes i've got them loaded in my Load file aswell as m5.p3d for the waypoints. Is there a way i can make a custom waypoints in my missions p3d file?
This is my load file 

LoadDisposableCar("art\cars\cLimo.p3d", "cLimo", "AI");
LoadP3DFile("art\missions\level01\m5.p3d");
LoadP3DFile("art\missions\level01\m7.p3d");
LoadP3DFile("art\frontend\dynaload\images\msnicons\location\mansion.p3d");
LoadP3DFile("art\frontend\dynaload\images\msnicons\char\barne.p3d");
LoadP3DFile("art\frontend\dynaload\images\msnicons\char\homer.p3d");
LoadP3DFile("art\frontend\dynaload\images\msnicons\vehicle\blimo_v.p3d");
LoadP3DFile("art\missions\level01\h_soda.p3d");
LoadP3DFile("art\missions\level01\coolr.p3d");
LoadP3DFile("art\missions\level01\bonebox.p3d");
LoadP3DFile("art\missions\level01\inhaler.p3d");
LoadP3DFile("art\missions\level01\lwnchair.p3d");
All the correct p3d's are loaded i loaded m5.p3d for Limo Waypoints and m7.p3d for npc spawn's. Can i only use upto 1 Mission P3D or can i use a few, and if so is it possible to create my own custom P3D file with my own waypoints/npc spawns etc?
I'm noticing that you have the Collectible Effect set to "bonestorm_explosion", but that's not loaded.

Not only this, but SetStageTime should NOT be inside the "timeout" condition. Radical never does that, and that's probably not a good thing to do.

Also, try putting ActivateVehicle and the stage waypoints at the start of the stage. That might be causing issues since it might be reading that the vehicle that needs to be targeted is cLimo first, but it isn't active at that point when it reads it, so it's causing some cashing. 
Okay Kenny i refined the stage a little as you said does this look reasonable?

AddStage();     
    ActivateVehicle("cLimo", "NULL", "target");
   AddStageWaypoint( "m5_van_path2" );
   AddStageWaypoint( "m5_van_path3" );    
   SetStageMessageIndex(157);
   SetHUDIcon( "blimo_v" );
   AddObjective("dump");
        SetObjTargetVehicle("cLimo");
        AddCollectible("m5_van_path1","h_soda");  
        AddCollectible("m5_van_path2","inhaler");
        AddCollectible("m5_van_path3","lwnchair");
        AddCollectible("m5_van_path4","bonebox");
        AddCollectible("m5_van_path5","coolr"); 
    CloseObjective();
    SetStageTime(120);
    AddCondition("timeout");
    CloseCondition();
    ShowStageComplete();
CloseStage();
EDIT: I tested it and it crashes still :|
That looks excellent! Give it a try and let me know what happens,

Also, to answer your other question, you can indeed create entirely new waypoints for the AI to follow. Just look for pre-existing AI paths in P3D files (such as the m5_van_pathx waypoints you're using here), copy them, and then paste them into a new P3D file or the same P3D.

Once you've done this, you can rename the copied waypoint to whatever you like (such as m5_car_wp1).

To change the locator, all you have to do is have the P3D open while SHAR is running, and then use the "From Game" button while standing in a certain position (either on foot or in your car), and then open up the locator so you see the trigger and do the same thing to it. There you go!
This post has been removed.
9 yrs ago (Statistics)
The Script still doesn't work, also my game can't be deteced by P3D Editor.
Interesting. According to Lucas, this can happen if your game is set to run as admin, but the P3D editor isn't. Try running the P3D Editor as admin and try again.

Also, looking at the script some more, I'm seeing a couple of issues with the script.

While this shouldn't be causing any crashing since both of them use the same locator type, you're using what the game normally uses as car waypoints as item locators, which probably isn't the best thing to do. Go open Level 1's m6.p3d, and copy the item locators (m6_videogamesX) into one of the P3Ds you have, and rename it to whatever you want (like item_X). Alternatively, you can load the m6.p3d into the script and use he m6_videogame locators instead for AddCollectible, but it's much more convenient to have everything in one P3D file. 

You're also using the wrong skeleton name for the bonebox. While bonebox.p3d is what you want to load, the skeleton is named differently (not really your fault. Just Radical's odd inconsistency). 

In short, just change this:

AddCollectible("m5_van_path4","bonebox");
to:
AddCollectible("m5_van_path4","bonestorm");
That should fix the crashing issue. I would highly recommend you copy the m6_videogames from Level 1's Mission 6 P3D file though and use that for AddCollectible instead of  the "m5_van_pathX" locators.
Okay done that!, gonna test it out now :)

EDIT: Thank you yet again! it works now :)