Jump to content
TACRfan

Controlling multiple objects

Recommended Posts

Is there a way I can command multiple objects to redirect via one command on another object?

 

so I have two signs which are technically vehicles that I want at either end of the road and then I want an object next to the fire station with the redirect command which will make these signs start redirecting vehicles.

 

i could do it so the signs redirect individually and then link it as a group but I would much rather if it's possible linking them to one object and one command.

 

thanks

Link to comment
Share on other sites

What I mean is you have an object (let's say the warning lights for a railway crossing, but it is actually classed as a vehicle) that object has a redirect command, there is also one of these at each end of a road, if you activate that command it redirects all vehicles in front of it, you have to press it individually or as you say hold CTRL and press both of them and activate it so both start re directing.

 

what I want to know is if there is a way to have both of the objects at the end of the road as before but then have a control panel outside the station with the redirect command which activates both signs instead of them individually.

 

3 objects

2 to redirect vehicles at either end of the road

1 to control both of the objects that redirect 

 

Link to comment
Share on other sites

Hm Dyson made Brooklyn or manhattan fire fighters go out and stop traffic maybe somewhere along those lines? It's definitely possible tho biebersfield had a traffic light next to station to stop traffic which you could press using the engine 

Link to comment
Share on other sites

Short answer, yes it is possible. 

I dont have my computer on me, but what you basicly want is to name the two vehicle the same thing and then use a for loop to call both of them at the same time. 

The only major problem I can see with your idea is that it isn't possible for vehicles to redirect, it is only possible for persons. So it would be much easier if you changed your signs to be persons instead

Link to comment
Share on other sites

3 hours ago, bma said:

Short answer, yes it is possible. 

I dont have my computer on me, but what you basicly want is to name the two vehicle the same thing and then use a for loop to call both of them at the same time. 

The only major problem I can see with your idea is that it isn't possible for vehicles to redirect, it is only possible for persons. So it would be much easier if you changed your signs to be persons instead

I mean using the VCmddirectional lights command 

Link to comment
Share on other sites

2 minutes ago, TACRfan said:

I mean using the VCmddirectional lights command 

Seems like a little weired workaround if you ask me. But sure it is possible. You just need to call it with a for loop

GameObjectList gol = Game::GetGameObjects("NameOfTheVehicle");
    GameObject *go;
    for (int i = 0; i < gol.GetNumObjects(); i++)
    {
        go = *gol.GetObject(i);
        go->PushActionExecuteCommand(ACTION_APPEND, "VcmdDirectionalLightsOn", go, 0, false);
    }

Something like that

Link to comment
Share on other sites

23 minutes ago, bma said:

Seems like a little weired workaround if you ask me. But sure it is possible. You just need to call it with a for loop


GameObjectList gol = Game::GetGameObjects("NameOfTheVehicle");
    GameObject *go;
    for (int i = 0; i < gol.GetNumObjects(); i++)
    {
        go = *gol.GetObject(i);
        go->PushActionExecuteCommand(ACTION_APPEND, "VcmdDirectionalLightsOn", go, 0, false);
    }

Something like that

Ok thanks

Link to comment
Share on other sites

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

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...