Jump to content
Sign in to follow this  
53rd_Stevie

CreateVehicle - Can't get in.

Recommended Posts

Hi Guys, i'm using the following to create a vehicle thru scripting. However i can't get in (no actions for it). Can somebody explain what i'm missing?

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_Loc = markerPos "hmmv";

_HMMWV1 = "HMMWV" createVehicle(_loc)

; Below doesn't seem to do anything at all..

_HMMWV1 setVehicleLock "UNLOCKED";

Tnx,

Stevie

Share this post


Link to post
Share on other sites

Just use this, its simpler.

VehicleName = "HMMWV" createVehicle getmarkerpos "hmmv"

Share this post


Link to post
Share on other sites
Hi Guys, i'm using the following to create a vehicle thru scripting. However i can't get in (no actions for it). Can somebody explain what i'm missing?

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_Loc = markerPos "hmmv";

_HMMWV1 = "HMMWV" createVehicle(_loc)

; Below doesn't seem to do anything at all..

_HMMWV1 setVehicleLock "UNLOCKED";

Tnx,

Stevie

make sure you are leader of the group.

Share this post


Link to post
Share on other sites

hey guys,

thanks for the replies, however it still doesn't solve my problem.

If i use

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">VehicleName = "HMMWV" createVehicle getmarkerpos "hmmv"

it still won't allow the player to hop in.

Quote[/b] ]make sure you are leader of the group.

It's for a multiplayer map which doesn't involve leaders.

Anymore ideas? Placing an empty vehicle using the editor works, but i want them to spawn after a certain trigger criteria has been met.

regards,

stevie

Share this post


Link to post
Share on other sites

You have some other issue going on. I use

VehicleName = "HMMWV" createVehicle getmarkerpos "hmmv"

this string all the time and I have had no issues at all. I get in anything I have created.

Share this post


Link to post
Share on other sites

53rd_Stevie, you wouldn't by any chance happen to be using setFriend on the civilian side in your mission would you? Or, maybe you made the players renegade with a negative rating (actually that shouldn't have any effect on the way the players percieve sides)? That could possibly make the vehicle an enemy to the player thus not allowing them to enter it.

Share this post


Link to post
Share on other sites
Quote[/b] ]you wouldn't by any chance happen to be using setFriend on the civilian side in your mission would you?

Well, i am really smile_o.gif

I have this for my enemy NPC spawning:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

...

_Center = createCenter east;

_Center setFriend[west,0];

...

_Group = createGroup _Center;

_Loc = markerPos _sSpawnMarkerName;

_Unit = _Group createUnit [_sNPCName, _Loc, [], -1, "NONE"];

...

i'm new to scripting for ARMA so i could be using the wrong methods.

I use it because if i don't use the setFriend EAST won't attack me. Or is this wrong.. seemed to work ! smile_o.gif

regards,

stevie

Share this post


Link to post
Share on other sites
Quote[/b] ]you wouldn't by any chance happen to be using setFriend on the civilian side in your mission would you?

Well, i am really smile_o.gif

I have this for my enemy NPC spawning:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

...

_Center = createCenter east;

_Center setFriend[west,0];

...

_Group = createGroup _Center;

_Loc = markerPos _sSpawnMarkerName;

_Unit = _Group createUnit [_sNPCName, _Loc, [], -1, "NONE"];

...

i'm new to scripting for ARMA so i could be using the wrong methods.

I use it because if i don't use the setFriend EAST won't attack me. Or is this wrong.. seemed to work ! smile_o.gif

regards,

stevie

Well what you have to realize is that (any) empty vehicles belong to the civilian side, and since the game won't let you enter vehicles that are percieved as enemy, if the civilian side is an enemy to your player then they won't be able to enter any empty vehicles. Is that what you're doing, making civilians enemies to your player's side?

Share this post


Link to post
Share on other sites

Can you get in after a while?

The "AI in your head" does not realise the vehicle is there instantaneously, and you can't board a vehicle you don't know about. You may need to reveal it.

Share this post


Link to post
Share on other sites

I have done nothing with civilians. Removing the setFriend doesn't seem to fix it.

I'm not putting any units on the map editor besides friendlies. Maybe this is the issue?

Any empty vehicle placed in the editor allows my player to hop in.

strange..

Share this post


Link to post
Share on other sites

Try using this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Loc = markerPos "hmmv";

_HMMWV1 = "HMMWV" createVehicle(_loc)

; Below doesn't seem to do anything at all..

_HMMWV1 setVehicleLock "UNLOCKED";

Player Reveal _HMMWV1;

As fasad said. A newly built vehicle takes time to register as firendly. The reveal command speeds up the process

Share this post


Link to post
Share on other sites

You have to unlock it!!!

_HMMWV1 lock false

is the right way!!!

Regards,

Mr-Murray

Share this post


Link to post
Share on other sites
Quote[/b] ]You have to unlock it!!!

Vehicles created with script commands are not locked. Empty vehicles created in the editor are not locked. shouting won't make it true.

It's always wise to test these things yourself, before posting.

Share this post


Link to post
Share on other sites

Thats not exacly right. I createt a vehicle and it was closed.

After I ulocked it, it was useable wink_o.gif

Eventually it has been fixed in the current versions after 1.0.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×