Jump to content

Trucka - AI Coast Transport


Donnovan

Recommended Posts

TRUCKA: AI COAST TRANSPORT

V3S_Open_TK_CIV_EP1_zpscbc23563.jpg

This is based in axeman bus routes!

RESUME:

- A truck that goes from Kamemka to Berezino and then from Berezino to Kamenka.

- Junk removed from the coast road.

- Truck driver humam behavior.

- Horn comunication.

- Smart Driver, no abuse from players.

- The truck is show on map as a red arrow, for everyone.

Example of driver humam behavior:

Inside the truck, if you ask too much to the driver stop the truck or ask for stop and don't leave the truck, the driver will ignore next asks from you.

If the truck stoped to get a player, and you ask, right after that, for the truck to stop, the driver will not stop.

If you take long to embark, the truck will leave you at the street.

If there is shot activity on the area, the truck will not stop for players on the street or for players in the truck that ask for stop.

HOW TO USE:

If you is on the street, go in the direction of the truck and it will know you want to go in, the driver will sign the horn tree times.

If you is on the truck, press space bar to ask for the driver to stop, the driver will sign the horn two times.

BADIES: infiSTAR remove vehicles custom binds even if you set Remove Custom Binds to false, some work arround is needed.

INSTALLATION:

1) Unpack this file inside your mission folder: http://s000.tinyupload.com/index.php?file_id=37025560196997886183

2) Add those lines at the end of your init.sqf:

if (isServer) then {
	[true] execVM "trucka\init_bus.sqf";
};
if (!isDedicated) then {
	[] execVM "trucka\player_axeBus.sqf";
};
3) You also need one custom sound, the horn:

Add this code to your description.ext file. If you already have a class CfgSounds, add just the class donnBus_horn to your class CfgSounds:

class CfgSounds {
    class donnBus_horn {
        name="donnBus_horn";
        sound[]={trucka\horn.ogg,1,1};
        titles[] = {};
    };
};
4) Remove junk on the coast street:

Some code need to be changed on the server file server_functions.sqf:

Find that:

_position = RoadList call BIS_fnc_selectRandom;
		
_position = _position modelToWorld [0,0,0];
		
waitUntil{!isNil "BIS_fnc_findSafePos"};
_position = [_position,0,10,5,0,2000,0] call BIS_fnc_findSafePos;
And change it to that:

//DONN - AX BUS
while {true} do {
	_position = RoadList call BIS_fnc_selectRandom;

	_position = _position modelToWorld [0,0,0];

	waitUntil{!isNil "BIS_fnc_findSafePos"};
	_position = [_position,0,10,5,0,2000,0] call BIS_fnc_findSafePos;

	if ((ATLToASL [_position select 0, _position select 1, 0]) select 2 > 10) exitWith {};
	diag_log format ["[DONN JUNK] Position %1 not OK!", ATLToASL [_position select 0, _position select 1, 0]];
};
//DONN - AX BUS
This will avoid spawn of junk (if you have then set to > 0) on the coast.
Link to comment
Share on other sites

Is it possible to edit the route to make it compactible with other maps?

I would bet you could change the route coords here in init_bus.sqf

not sure but thats why it would be a bet...

//Load Bus Route
_axWPZ=0;
_axeBusWPIndex = 2;
_axeBusFirstWayPoint = [13101.4,10339.1,_axWPZ];
_axeBusWP = _axeBusGroup addWaypoint [_axeBusFirstWayPoint, _axeBusWPradius,_axeBusWPIndex];
_axeBusWP setWaypointType "MOVE";
_axeBusRouteWaypoints = [[12984,8362.67,_axWPZ],[13279.1,6991.32,_axWPZ],[13464.2,6255.24,_axWPZ],[13386.8,5405.25,_axWPZ],[12025.6,3481.76,_axWPZ],[10504.4,2324.99,_axWPZ],[10321.8,2149.75,_axWPZ],[10028,2071.8,_axWPZ],[9503.53,2028.21,_axWPZ],[6587.65,2884.59,_axWPZ],[6354.47,2452.24,_axWPZ],[4565.79,2432.13,_axWPZ],[1907.21,2240.25,_axWPZ],[1689.06,2209.53,_axWPZ],[1845.55,2219.14,_axWPZ],[1940.8,2255.24,_axWPZ],[3559.56,2448.9,_axWPZ],[4541.37,2443.16,_axWPZ],[5816.09,2167.39,_axWPZ],[6408.19,2685.99,_axWPZ],[6570.5,2877.59,_axWPZ],[9945.28,2049.85,_axWPZ],[10283.4,2146.71,_axWPZ],[10389.4,2221.85,_axWPZ],[10498.9,2320.29,_axWPZ],[10888.2,2772.58,_axWPZ],[12025.9,3485.04,_axWPZ],[13005.9,3816.02,_axWPZ],[13451.5,6211.28,_axWPZ],[13419.9,6557.19,_axWPZ],[13287.7,6961.19,_axWPZ],[12930.4,10133,_axWPZ]];
Link to comment
Share on other sites

What could this be ?

Sometimes is shows and sometimes it dont

2014/11/20,  4:03:46 Error in expression <s;
while {true} do {
waitUntil {(count (donnBus_mark12 - donnBus_mark12Ignore) >>
2014/11/20,  4:03:46   Error position: <donnBus_mark12 - donnBus_mark12Ignore) >>
2014/11/20,  4:03:46   Error count: Undefined variable in expression: donnbus_mark12
2014/11/20,  4:03:46 File mpmissions\__cur_mp.chernarus\addons\trucka\init_bus.sqf, line 232
Link to comment
Share on other sites

Rythron,

on init_bus.sqf find this code:

	donnBus_mark12 = [];
	donnBus_mark12Ignore = [];
And move it above:

//BUS AI Embark Disembark
At the end, you will have that:

		};
	};
}];
donnBus_mark12 = []; //MOVED
donnBus_mark12Ignore = []; //MOVED
//BUS AI Embark Disembark
[_axeBus] spawn {
	donnBus_veh = _this select 0;
	donnBus_mark100 = [];
	donnBus_mark100New = [];
	while {true} do {
		sleep 3;
		{
Link to comment
Share on other sites

Rythron,

on init_bus.sqf findo this code:

	donnBus_mark12 = [];
	donnBus_mark12Ignore = [];
And move it above:

//BUS AI Embark Disembark
At the end, you will have that:

		};
	};
}];
donnBus_mark12 = []; //MOVED
donnBus_mark12Ignore = []; //MOVED
//BUS AI Embark Disembark
[_axeBus] spawn {
	donnBus_veh = _this select 0;
	donnBus_mark100 = [];
	donnBus_mark100New = [];
	while {true} do {
		sleep 3;
		{

Thx it worked !!  :)

Link to comment
Share on other sites

  • 1 month later...

se7en,

 

When the truck pass near you it will stop. So just make it pass on your side.

 

Passengers goes in the back, so you need to go to the back of the truck and enter it. Don't take too long or the truck will go away.

To leave the truck you need to press space bar.

Link to comment
Share on other sites

se7en,

 

When the truck pass near you it will stop. So just make it pass on your side.

 

Passengers goes in the back, so you need to go to the back of the truck and enter it. Don't take too long or the truck will go away.

To leave the truck you need to press space bar.

 

When im close to it, truck stops.

It horns 3 times.

I go on the back of truck but CANT ENTER IT.

i dont have option to enter.

Link to comment
Share on other sites

se7en,

 

When the truck pass near you it will stop. So just make it pass on your side.

 

Passengers goes in the back, so you need to go to the back of the truck and enter it. Don't take too long or the truck will go away.

To leave the truck you need to press space bar.

I just added this to my non epoch overwatch server...

the V3S_Open_TK_CIV_EP1 spawns in but no driver....

I believe its the skin

where can I change the AI driver skin ???

 

I believe I found it

 

"BAF_Soldier_L_DDPM" createUnit [_unitpos, _axeBusGroup, "_axeBusUnit = this;", 0.6, "Private"];

 

I change this line to gsc_eco_stalker_mask_fred

 

 

"gsc_eco_stalker_mask_fred" createUnit [_unitpos, _axeBusGroup, "_axeBusUnit = this;", 0.6, "Private"];

 

edit.....

nope still no AI driver

Link to comment
Share on other sites

  • 4 weeks later...

se7en,

 

When the truck pass near you it will stop. So just make it pass on your side.

 

Passengers goes in the back, so you need to go to the back of the truck and enter it. Don't take too long or the truck will go away.

To leave the truck you need to press space bar.

I am getting 8000 lines of this in server .RPT

 

any ideas ??

 

20:25:48 "[DONN BUS] Atiraram perto, carilho!"
20:25:48 "[DONN BUS] Atiraram perto, carilho!"
20:25:48 "[DONN BUS] Atiraram perto, carilho!"
20:25:48 "[DONN BUS] Atiraram perto, carilho!"
20:25:48 "[DONN BUS] Atiraram perto, carilho!"
20:25:49 "[DONN BUS] Atiraram perto, carilho!"
20:25:49 "[DONN BUS] Atiraram perto, carilho!"
20:25:49 "[DONN BUS] Atiraram perto, carilho!"
20:25:49 "[DONN BUS] Atiraram perto, carilho!"
20:25:49 "[DONN BUS] Atiraram perto, carilho!"
20:25:49 "[DONN BUS] Atiraram perto, carilho!"
20:25:49 "[DONN BUS] Atiraram perto, carilho!"
20:25:49 "[DONN BUS] Atiraram perto, carilho!"
20:25:49 "[DONN BUS] Atiraram perto, carilho!"
20:25:49 "[DONN BUS] Atiraram perto, carilho!"
20:25:49 "[DONN BUS] Atiraram perto, carilho!"
20:25:49 "[DONN BUS] Atiraram perto, carilho!"
20:25:49 "[DONN BUS] Atiraram perto, carilho!"
20:25:49 "[DONN BUS] Atiraram perto, carilho!"
20:25:49 "[DONN BUS] Atiraram perto, carilho!"
20:25:50 "[DONN BUS] Atiraram perto, carilho!"
20:25:50 "[DONN BUS] Atiraram perto, carilho!"
20:25:50 "[DONN BUS] Atiraram perto, carilho!"
20:25:50 "[DONN BUS] Atiraram perto, carilho!"
20:25:50 "[DONN BUS] Atiraram perto, carilho!"
Link to comment
Share on other sites

same thing for me! is it possible it go in conflict with WPD's menu?

I had this problem with the coast bus from axeman.

thats because you have the AI mission or roaming Ai system which makes the truck driver look you as an enemy, so you cant enter their vehicles.

I couldnt open the file for this Ai truck, so I cant find the exactly code, but what I did to fix the bus one is :

Frist, you need to go to trucka\init_bus.sqf

and in it look for "set side"

and you need to change whatever side the Ai is right now to Civilian because civilian is set friendly to players.

//Set Sides
	_firstRun = _this select 0;
	if(_firstRun)then{
	createCenter CIVILIAN;
	CIVILIAN setFriend [WEST,1];
	};


Sorry, I couldn't see the file, but I know what the problem is, hopefully this would help :D

Link to comment
Share on other sites

Some players would try to hijack the bus/truck by changing to driver's seat, sometimes they can glitch to the drivers seat without getting kicked out the vehicles.

So, to fix the problem i added in a little something, which kick the player when they switch to driver's seat. 

Edit the player_join_bus.sqf

private["_gotIn","_axeBus"];
_axeBus = _this select 0;
_gotIn = _this select 2;
if(_gotIn==player)then{
cutText ["Welcome to the Chernarus Bus Route. Please DO NOT get on driver's seat.You have been warned !", "PLAIN DOWN",6];

	while {true}do{
		while{player==driver _axeBus}do{
		cutText ["**WARNING** You are trying to hijack the bus !", "PLAIN DOWN",2];
			while{player==driver _axeBus}do{
			sleep 1.2;
			cutText ["**YOU WERE WARNED** Get off my Bus !", "PLAIN DOWN",2];
			sleep 1.2;
			player action ["eject", vehicle player];
						startLoadingScreen ["You are being disconnected", "DayZ_loadingScreen"];
						progressLoadingScreen 0.2;sleep 2;["All_Haha"] spawn DS_really_loud_sounds;
						progressLoadingScreen 0.4;sleep 2.25;
						progressLoadingScreen 0.6;sleep 2;["All_Haha"] spawn DS_really_loud_sounds;
						progressLoadingScreen 0.8;sleep 2.25;
						progressLoadingScreen 1.0;sleep 2;["All_Haha"] spawn DS_really_loud_sounds;
						endLoadingScreen;sleep 0.5;
						disableUserInput false;
						endMission "LOSER";
			};
		};
	};
	
};

Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Discord

×
×
  • Create New...