Author Topic: a wild vehicle spawn thread appears  (Read 8385 times)

0 Members and 1 Guest are viewing this topic.

Temo

  • Relentless Teamkiller
  • **
  • Posts: 93
    • View Profile
a wild vehicle spawn thread appears
« on: June 12, 2012, 02:14:59 am »
So after reading throught the past 8 sites of this forum + studying some code of dayz i now got a clue, where vehs are spawnend and checked.

local_publishobject.sqf:

Code: [Select]
private["_type","_location","_dir","_character","_tent","_class","_id"];
//[dayz_characterID,_tent,[_dir,_location],"TentStorage"]
_charID = _this select 0;
_object = _this select 1;
_worldspace = _this select 2;
_class = _this select 3;
_id = 0;

diag_log ("PUBLISH: Attempt " + str(_object));
_dir = _worldspace select 0;
_location = _worldspace select 1;

_object = createVehicle [_class, _location, [], 0, "CAN_COLLIDE"];
_object setdir _dir;
_object setpos _location;
_object setVariable ["OwnerID", _charID, true];

//add to database
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object];

//get UID
_uid = _object call dayz_objectUID;

//Send request
_key = format["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance, _class, 0 , _charID, _worldspace, [], [], 0,_uid];
diag_log ("HIVE: WRITE: "+ str(_key));
_key call server_hiveWrite;

_object setVariable ["ObjectUID", _uid, true];

diag_log ("PUBLISH: Created " + (_class) + " with ID " + _uid);

I also have read, that you should use this code to spawn your vehs. My question now is, what does worldspace, charID or OwnerID means?

Im still a total nub in scripting but i have lots of free time and free brain at the moment so i would really like to get into it!

Lets wait for medics next sarcastic answer :icon_teehee

MrMedic

  • MasstKer
  • ********
  • Posts: 8900
  • programmer/dev/software engineer
    • View Profile
Re: a wild vehicle spawn thread appears
« Reply #1 on: June 12, 2012, 02:35:52 am »
So after reading throught the past 8 sites of this forum + studying some code of dayz i now got a clue, where vehs are spawnend and checked.

local_publishobject.sqf:

Code: [Select]
private["_type","_location","_dir","_character","_tent","_class","_id"];
//[dayz_characterID,_tent,[_dir,_location],"TentStorage"]
_charID = _this select 0;
_object = _this select 1;
_worldspace = _this select 2;
_class = _this select 3;
_id = 0;

diag_log ("PUBLISH: Attempt " + str(_object));
_dir = _worldspace select 0;
_location = _worldspace select 1;

_object = createVehicle [_class, _location, [], 0, "CAN_COLLIDE"];
_object setdir _dir;
_object setpos _location;
_object setVariable ["OwnerID", _charID, true];

//add to database
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object];

//get UID
_uid = _object call dayz_objectUID;

//Send request
_key = format["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance, _class, 0 , _charID, _worldspace, [], [], 0,_uid];
diag_log ("HIVE: WRITE: "+ str(_key));
_key call server_hiveWrite;

_object setVariable ["ObjectUID", _uid, true];

diag_log ("PUBLISH: Created " + (_class) + " with ID " + _uid);

I also have read, that you should use this code to spawn your vehs. My question now is, what does worldspace, charID or OwnerID means?

Im still a total nub in scripting but i have lots of free time and free brain at the moment so i would really like to get into it!

Lets wait for medics next sarcastic answer :icon_teehee

well you could press W and walk there instead of spending all day trying to get it working.

( that sarcastic enough ? )
EnCoded Message: i3iy9yl8kr2xf3g2Txs3pr6ye3ya7jg5ty2z

https://www.youtube.com/watch?v=62_7-AYfdkQ
you need a paypal account for the private versions.

Website:
http://bit.ly/medic101

Teamspeak 3: 85.236.101.5:10157

Temo

  • Relentless Teamkiller
  • **
  • Posts: 93
    • View Profile
Re: a wild vehicle spawn thread appears
« Reply #2 on: June 12, 2012, 02:54:46 am »
Maybe i just want to learn how to create my own mod app? But w/o any input i seem to not come far.
Search+wiki showed no results up for the variables (although wiki was a silly try)

darkrounge

  • Online Villain
  • ***
  • Posts: 166
    • View Profile
Re: a wild vehicle spawn thread appears
« Reply #3 on: June 12, 2012, 03:04:35 am »
Maybe i just want to learn how to create my own mod app? But w/o any input i seem to not come far.
Search+wiki showed no results up for the variables (although wiki was a silly try)

Could always download a current one and look at it's setup?

Temo

  • Relentless Teamkiller
  • **
  • Posts: 93
    • View Profile
Re: a wild vehicle spawn thread appears
« Reply #4 on: June 12, 2012, 03:19:42 am »
They always do it like that:
Code: [Select]
_lada = "M1030" createVehicle (position player);
_lada setVariable ["ObjectID", 123456, true];

But vehs explode if you get in (or you die)
and niel said
Quote
Using their code is the best way to go. Don't write anything you don't need to

and someone also hinted to the local_publishobject.sqf.

B2T:
does any1 has the answers?

edit:

this is how it looks atm...

Code: [Select]
"dayz_serverObjectMonitor" addPublicVariableEventHandler {dayz_serverObjectMonitor = dayz_safety};
_direction = getdir vehicle player;
_location = position vehicle player;
_location = [(_location select 0)+5,(_location select 1)];
_className = "Lada1";
_heli setVariable ["ObjectID", 654654, true];
_heli = createVehicle [_className, _location, [], 0, "CAN_COLLIDE"];
« Last Edit: June 12, 2012, 04:13:09 am by Temo »

johnbowa

  • Intentional Cheater
  • **
  • Posts: 29
    • View Profile
Re: a wild vehicle spawn thread appears
« Reply #5 on: June 12, 2012, 05:08:34 am »
Well, I don't know the answers, but if you are ONLY going to want to use their code, execute local_createObj.sqf  (to create your vehicle) and local_publishObj.sqf (the publish it on the server) on your vehicle.

SOMETHING like this:
Code: [Select]
veh = [10, 10, 10, "ATV_US_EP1"] execVM "\z\addons\dayz_code\compile\local_createObj.sqf";
sleep 0.5;
veh = execVM "\z\addons\dayz_code\compile\local_publishObj.sqf";

I doubt this code even works, but it DOES use the Dayz code. :D
Edit: Doesn't work, but it is something... Pie is also something. I'm hungry.
« Last Edit: June 12, 2012, 05:44:22 am by johnbowa »

MrMedic

  • MasstKer
  • ********
  • Posts: 8900
  • programmer/dev/software engineer
    • View Profile
Re: a wild vehicle spawn thread appears
« Reply #6 on: June 12, 2012, 01:17:56 pm »
They always do it like that:
Code: [Select]
_lada = "M1030" createVehicle (position player);
_lada setVariable ["ObjectID", 123456, true];

But vehs explode if you get in (or you die)
and niel said
Quote
Using their code is the best way to go. Don't write anything you don't need to

and someone also hinted to the local_publishobject.sqf.

B2T:
does any1 has the answers?

edit:

this is how it looks atm...

Code: [Select]
"dayz_serverObjectMonitor" addPublicVariableEventHandler {dayz_serverObjectMonitor = dayz_safety};
_direction = getdir vehicle player;
_location = position vehicle player;
_location = [(_location select 0)+5,(_location select 1)];
_className = "Lada1";
_heli setVariable ["ObjectID", 654654, true];
_heli = createVehicle [_className, _location, [], 0, "CAN_COLLIDE"];

Way off..
EnCoded Message: i3iy9yl8kr2xf3g2Txs3pr6ye3ya7jg5ty2z

https://www.youtube.com/watch?v=62_7-AYfdkQ
you need a paypal account for the private versions.

Website:
http://bit.ly/medic101

Teamspeak 3: 85.236.101.5:10157

Recon

  • Intentional Cheater
  • **
  • Posts: 30
    • View Profile
Re: a wild vehicle spawn thread appears
« Reply #7 on: June 12, 2012, 04:10:08 pm »
Way off..
Not sure if I'm going in the right direction at all - but would this be a line used to publish the vehicle - or anywhere close to it, as to avoid the explosions? I've just been looking around in the DayZ Code PBO.
Code: [Select]
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object];

ChocoKFCguy

  • Cheater Apprentice
  • *
  • Posts: 12
    • View Profile
Re: a wild vehicle spawn thread appears
« Reply #8 on: June 12, 2012, 04:11:46 pm »
I tried like 30 times to spawn a vehicle, changed script as many times as possible, and still nothing changed. Yeah, it was a helicockter. FUCKING HELL IT WAS A NIGHT TIME SO I FLIED LIKE 20 SECS AND MY COCK EXPLODED THE HELL OUT, and guess what, I've lighted all the map with my exploded helis. I GONNA EAT ALL MY KFC FOOD CAUSE I'M MAD.

scrx

  • Relentless Teamkiller
  • **
  • Posts: 59
    • View Profile
Re: a wild vehicle spawn thread appears
« Reply #9 on: June 12, 2012, 04:20:22 pm »
nvm

MrMedic

  • MasstKer
  • ********
  • Posts: 8900
  • programmer/dev/software engineer
    • View Profile
Re: a wild vehicle spawn thread appears
« Reply #10 on: June 12, 2012, 04:45:32 pm »
Way off..
Not sure if I'm going in the right direction at all - but would this be a line used to publish the vehicle - or anywhere close to it, as to avoid the explosions? I've just been looking around in the DayZ Code PBO.
Code: [Select]
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object];

Yes.
EnCoded Message: i3iy9yl8kr2xf3g2Txs3pr6ye3ya7jg5ty2z

https://www.youtube.com/watch?v=62_7-AYfdkQ
you need a paypal account for the private versions.

Website:
http://bit.ly/medic101

Teamspeak 3: 85.236.101.5:10157

ChocoKFCguy

  • Cheater Apprentice
  • *
  • Posts: 12
    • View Profile
Re: a wild vehicle spawn thread appears
« Reply #11 on: June 12, 2012, 05:34:36 pm »
Code: [Select]
hint "KFCLada";

_direction = getdir vehicle player;
_location = position vehicle player;
_location = [(_location select 0)+5,(_location select 1)];
_lada = "lada1" createVehicle _location;
_lada setVariable ["ObjectID", 123456, true];
dayzSetFuel = [_lada,1];
dayzSetFuel spawn local_sefFuel;
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_lada];

So, any hints please? I'll give ya some KFC chicken nuggets in return, srsly.

Temo

  • Relentless Teamkiller
  • **
  • Posts: 93
    • View Profile
Re: a wild vehicle spawn thread appears
« Reply #12 on: June 12, 2012, 05:36:52 pm »
im already handling with this line. In the post there was also a hint for the teleport script.

Code: [Select]
hint "BLEH";
sleep 1;
_direction = getdir vehicle player;
_location = position vehicle player;
_location = [(_location select 0)+5,(_location select 1)];
_className = "Lada1";
_object setVariable ["ObjectID", 654654, true];
_object = createvehicle[_className, _location, [], 0, "CAN_COLLIDE"];
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object];
not working ...

gonna try the script out of hgs thread with dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object]; implemented

Temo

  • Relentless Teamkiller
  • **
  • Posts: 93
    • View Profile
Re: a wild vehicle spawn thread appears
« Reply #13 on: June 12, 2012, 08:36:09 pm »
im calling for joopig, nail, ofp, z, gerk and medic - help us nubs to get a way around it! Please!

ChocoKFCguy

  • Cheater Apprentice
  • *
  • Posts: 12
    • View Profile
Re: a wild vehicle spawn thread appears
« Reply #14 on: June 12, 2012, 08:37:39 pm »
Bump?
Yeah, I know, you are all sick to give hints, to answer a shitload of stupid questions, but for a fucks sake, do it again.