Author Topic: DAYZ MOD VEHICLE  (Read 10022 times)

0 Members and 2 Guests are viewing this topic.

LongDong

  • Online Villain
  • ***
  • Posts: 109
    • View Profile
Re: DAYZ MOD VEHICLE
« Reply #15 on: May 25, 2012, 02:32:58 am »
Can someone explain me what i'm doing wrong with that script. Pretty new to all this.

Code: [Select]
_dir = getDir vehicle player;
_pos = getPos vehicle player;
_pos = [(_pos select 0)-5*sin(_dir),(_pos select 1)-5*cos(_dir),0];
_veh = createVehicle ["Lada1",[_pos select 0,_pos select 1,1], [], 0, 'NONE'];
_veh = setVariable ["Lada1", 123456, true];
Player moveInDriver _veh;
_veh setDir _dir;

Issue : Spawn 2 ladas ( not only one ) and when i enter them i get killed. I guess the second thing is a protection from rocket, and according to someone putting an ID to my lada should fix this. I must failed something.


LongDong

  • Online Villain
  • ***
  • Posts: 109
    • View Profile
Re: DAYZ MOD VEHICLE
« Reply #16 on: May 25, 2012, 03:47:41 am »
Yup, still didn't manage to spawn a vehicle without get killed when getting inside.

Can someone give me a hand on this ?

Thanks.

Buster

  • Klass Klown
  • ***
  • Posts: 295
  • Kool Kat
    • View Profile
Re: DAYZ MOD VEHICLE
« Reply #17 on: May 25, 2012, 03:52:04 am »
Not sure cos I don't play this mod much, but is the vehicle allowed in the mod ?? Try DePbo the mission to see what vehics are !!  :icon_thumbsup

Marci

  • Poptart
  • *
  • Posts: 7
    • View Profile
Re: DAYZ MOD VEHICLE
« Reply #18 on: May 25, 2012, 03:54:42 am »
It is easy to bypass.

...

You have to add vehicle ID, like in local_createObj.sqf (local_createObj function)
Code: [Select]
diag_log ("PUBLISH: Result " + str(_result));
if (count _result > 1) then {
_id = _result select 1;
[b]_object setVariable ["[color=red]ObjectID[/color]", _id, true];[/b]
diag_log ("PUBLISH: Created " + (_class) + " with ID " + str(_id));
};

So just add the ID to your vehicle via _vehicle setVariable ["ObjectID", 123456, true];

_object setVariable ["ObjectID", _id, true];

Tbh before you try to script you should learn to read! (Hint its red marked)

LongDong

  • Online Villain
  • ***
  • Posts: 109
    • View Profile
Re: DAYZ MOD VEHICLE
« Reply #19 on: May 25, 2012, 03:55:01 am »
Quote
Not sure cos I don't play this mod much, but is the vehicle allowed in the mod ?? Try DePbo the mission to see what vehics are !!  

Yup vehicles are allowed  :icon_thumbsup .

Some guys spawned F35, stuff like that. Fun times.

Personally i just want to try out some lada, but the bitch is always ending killing me.

Quote
Tbh before you try to script you should learn to read! (Hint its red marked)

Like i said i'm pretty crap to scripting. I know how to read, but i don't know how to exactly " apply " what i'm reading. That's how we learn i guess, by trying and failing.

So what is the ObjectID if it isn't " Lada1 " ?

Buster

  • Klass Klown
  • ***
  • Posts: 295
  • Kool Kat
    • View Profile
Re: DAYZ MOD VEHICLE
« Reply #20 on: May 25, 2012, 03:58:14 am »
Well Marci gave a good explanation.... thnx Marci  :icon_thumbsup
I've got my confussed head on at the mo.   :icon_teehee

Marci

  • Poptart
  • *
  • Posts: 7
    • View Profile
Re: DAYZ MOD VEHICLE
« Reply #21 on: May 25, 2012, 04:01:09 am »
as the "" say its only a string with the value "ObjectID".

BOOOAH MAGIC  :icon_magician

Buster

  • Klass Klown
  • ***
  • Posts: 295
  • Kool Kat
    • View Profile
Re: DAYZ MOD VEHICLE
« Reply #22 on: May 25, 2012, 04:13:17 am »
 :icon_laugh :icon_laugh :icon_laugh :icon_cool2
Yep,good stuff  :icon_magician

LongDong

  • Online Villain
  • ***
  • Posts: 109
    • View Profile
Re: DAYZ MOD VEHICLE
« Reply #23 on: May 25, 2012, 04:15:41 am »
Code: [Select]
_lada = "Lada1" createVehicle (position player);
_vehicle setVariable ["ObjectID", 123456, true];

Still killing me for some reason.

Coronel_Niel

  • Insane Joker
  • ****
  • Posts: 846
  • Why can't I pick my own profile picture...
    • View Profile
Re: DAYZ MOD VEHICLE
« Reply #24 on: May 25, 2012, 04:17:41 am »
_lada = "Lada1" createVehicle (position player);
_vehicle setVariable ["ObjectID", 123456, true];

Still killing me for some reason.
Quote
_veh = createVehicle ["Lada1",[_pos select 0,_pos select 1,1], [], 0, 'NONE'];
_veh = setVariable ["Lada1", 123456, true];
"Now we are going to watch my boys do it" - Joopig

joopig

  • Insane Joker
  • ****
  • Posts: 602
    • View Profile
    • A Place Of Dreams
Re: DAYZ MOD VEHICLE
« Reply #25 on: May 25, 2012, 04:17:46 am »
Edit Neil beat me. :icon_cry2
« Last Edit: May 25, 2012, 04:23:04 am by joopig »

LongDong

  • Online Villain
  • ***
  • Posts: 109
    • View Profile
Re: DAYZ MOD VEHICLE
« Reply #26 on: May 25, 2012, 04:21:07 am »
Thanks all of you.

It works.

I will kill myself now.

Hope it will help another beginner like me though  :smile .

Buster

  • Klass Klown
  • ***
  • Posts: 295
  • Kool Kat
    • View Profile
Re: DAYZ MOD VEHICLE
« Reply #27 on: May 25, 2012, 04:24:52 am »
If that worked for you then you should especially thank JooPig  :icon_thumbsup

LongDong

  • Online Villain
  • ***
  • Posts: 109
    • View Profile
Re: DAYZ MOD VEHICLE
« Reply #28 on: May 25, 2012, 04:33:12 am »
Thanks joopig then  :icon_thumbsup .

Otherwise, it works like a charm but spawn two vehicles. Any idea why ?

joopig

  • Insane Joker
  • ****
  • Posts: 602
    • View Profile
    • A Place Of Dreams
Re: DAYZ MOD VEHICLE
« Reply #29 on: May 25, 2012, 05:27:39 am »
If you send me the exact code you are using to spawn the vehicle i can take a look, either PM, here or TS its up to you :icon_thumbsup