May 27, 201016 yr comment_159839 Hi,I'm using the shane green's submod, i want to add a few more vehicles to the police station.I have basic knowledge of scripting, but i am a bit confused why i keep getting an error (sorry if its something silly).I added a new VO in the editor and changed the constants at the top of the script to correspond correctly as i am added a slick top unit. ActorList 148 = Game::GetActors(VO_LAPDSLICK); for(int i=0; i < 148.GetNumActors(); i++) { Vector Lapdslick = 148.GetActor(0)->GetPosition(); Vehicle m = Game::CreateVehicle(OBJ_LAPDSLICK, UNNAMED); m.EnableBlueLights(false); m.SetPosition(Lapdslick); m.UpdatePlacement(); m.SetMaxPassengers(2); m.SetMaxTransports(2); m.SetSpeed(12.0f); m.PushActionWait(ACTION_NEWLIST, 2.0f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 11, false); m.PushActionWait(ACTION_APPEND, 0.5f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 11, false); }I added this after the last vehicle to be spawned which was 147. When i start it with the game it says that the 148 is an illegal operation. What does the 148 reference to and why is it giving me an error?Thanks in advanced for any helpp.s. i attached the full script to this post Report
May 27, 201016 yr comment_159840 A variable cannot be named as a number. If you look closely, the variables used as ActorLists here are "l##", which is a small L. Replace 148 with l48 and you'll be fine. You must change three lines, the first ones, not including the brace. Report
May 27, 201016 yr comment_159842 oh i feel dumb now thanks i diden't realize that those were Ls thanks for the help! Report
May 28, 201016 yr comment_159962 One more thing, how do i make a command that i created via script show up in the editor? I tried the assign command button but there's no where to choose what script it goes to... Report
May 28, 201016 yr comment_159964 Once you create a command script, it will appear in the commands list for units. Make sure you don't use the same command script names though. Report
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.