Skip to content
View in the app

A better way to browse. Learn more.

Learn more

LaFirestation.script help

Featured Replies

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 help

p.s. i attached the full script to this post

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.

oh i feel dumb now thanks :) i diden't realize that those were Ls thanks for the help!

No problem. :) Glad to help.

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...

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. :)

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.

Guest
Reply to this topic...

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.