Jump to content
Benny.

[SP/MP] BeCTI

Recommended Posts

I'd like to create a couple maps with completely different links / objectives for variety.

What could be donee is placing as much town into the the map as possible and then make a script to only select some depending on a parameter.

That could be donne for example by changing the way the links are computed and by declaring a root node to be the center of the map to generate the links .

@Sari

thank you for the updated files, it saves me some time :)

Share this post


Link to post
Share on other sites
What could be donee is placing as much town into the the map as possible and then make a script to only select some depending on a parameter.

That could be donne for example by changing the way the links are computed and by declaring a root node to be the center of the map to generate the links .

@Sari

thank you for the updated files, it saves me some time :)

Sounds way to complicated for me. ;)

Share this post


Link to post
Share on other sites

Is it possible to change the class of the units at the start/spawn, which are linked to Game Logic CTI_WEST?

Changing B_Soldier_F to B_mass_usr_Soldier_F_v doesn't work, although all class-names have been replaced in all files & directories.

Buying from barracks works correctly.

Any idea's?

Share this post


Link to post
Share on other sites

People could somebody help me in adding a game (progress) saving/loading script to BECTI for dedicated servers ? (unless Benny is not gonna create one :) )

A BECTI Altis game is just too long to complete it in one piece and a dedicated server can't just save / load the game progress by itself to stop and resume the game later at a saved game state.

Share this post


Link to post
Share on other sites

Still no words from Benny ? Actually went back to play A2 BE warfare.. :/ It was fun tough and I realised how much I missed Taki and Cherna warfare :)

Share this post


Link to post
Share on other sites

OK, question for you code geniuses. I want to include the Mohawk to both factions but spawn a different colored Mohawk dependent on which side purchases it. Blufor = tan mohawk and Opfor = black mohawk.

I've got this in the Common_createvehicle.sqf and it's changing the color when purchased:

if((_vehicle isKindOf "I_Heli_Transport_02_F")) then

{

_vehicle setObjectTextureGlobal [0,"#(argb,8,8,3)color(0.5,0.1,0.1,0.2)"];

_vehicle setObjectTextureGlobal [1,"#(argb,8,8,3)color(0,0,0,1)"];

_vehicle setObjectTextureGlobal [2,"#(argb,8,8,3)color(0.1,0.1,0.1,0.9)"];

};

However, I don't know how to split this up into 2 different colors dependent on which faction/player purchases it...anyone know what I need to include to accomplish this? Thanks in advance.

Share this post


Link to post
Share on other sites
OK, question for you code geniuses. I want to include the Mohawk to both factions but spawn a different colored Mohawk dependent on which side purchases it. Blufor = tan mohawk and Opfor = black mohawk.

I've got this in the Common_createvehicle.sqf and it's changing the color when purchased:

if((_vehicle isKindOf "I_Heli_Transport_02_F")) then

{

_vehicle setObjectTextureGlobal [0,"#(argb,8,8,3)color(0.5,0.1,0.1,0.2)"];

_vehicle setObjectTextureGlobal [1,"#(argb,8,8,3)color(0,0,0,1)"];

_vehicle setObjectTextureGlobal [2,"#(argb,8,8,3)color(0.1,0.1,0.1,0.9)"];

};

However, I don't know how to split this up into 2 different colors dependent on which faction/player purchases it...anyone know what I need to include to accomplish this? Thanks in advance.

im not positive but I have this,

if (!alive driver _x) then {deleteVehicle _x} else

{

_side = side (driver _x);

switch (_side) do

{

case West:

{

_x setObjectTexture [0,'#(argb,8,8,3)color(0,0,1,1)'];

_x setObjectTexture [1,'#(argb,8,8,3)color(0,0,1,1)'];

};

case East:

{

_x setObjectTexture [0,'#(argb,8,8,3)color(1,0,0,1)'];

_x setObjectTexture [1,'#(argb,8,8,3)color(1,0,0,1)'];

};

case Resistance:

{

_x setObjectTexture [0,'#(argb,8,8,3)color(0,1,0,1)'];

_x setObjectTexture [1,'#(argb,8,8,3)color(0,1,0,1)'];

};

};

};

} forEach vehicles;

I know this isn't the code you need but may help with how. these are red,green,blue,yellow, but im more thinking the

case West:

{

_x setObjectTexture [0,'#(argb,8,8,3)color(0.5,0.1,0.1,0.2)'];

_x setObjectTexture [1,'#(argb,8,8,3)color(0.5,0.1,0.1,0.2)'];

this is in a settexture.sqf I have.

Edited by Dr Death JM

Share this post


Link to post
Share on other sites

Another fix to get rid of the error when disbanding AI inside vehicles (literally took a grand total one word/variable to fix!). Drop into client > events:

http://www.sendspace.com/file/dgnrkg

Warning: If you disband vehicle commander using this file, the vehicle will self destruct (I'm presmuming that was Bennys intended effect)

@Spanishsurfer

In common > functions > common_initializenetvehicle.sqf (this is the script that does all the funky stuff to vehicles like airlift/taxi reverse etc. I'd leave common_createvehicle alone to do the vehicle creating) add somewhere:

if (typeOf _vehicle in (CTI_VEHICLES_RETEXTURE)) then {
switch (_side) do {
	case west: {
		_vehicle setObjectTextureGlobal [0,"Whatever colour tan is"];
	    _vehicle setObjectTextureGlobal [1,"Whatever colour tan is"];
		_vehicle setObjectTextureGlobal [2,"Whatever colour tan is"];
	};
	case east: {
		_vehicle setObjectTextureGlobal [0,"Whatever colour black is"];
		_vehicle setObjectTextureGlobal [1,"Whatever colour black is"];
		_vehicle setObjectTextureGlobal [2,"Whatever colour black is"];
	};
};
};

and in common > init > init_commonconstants in the vehicles > vehicles: misc section (line 454) add:

CTI_VEHICLES_RETEXTURE = ["I_Heli_Transport_02_F"]; //--- Vehicles to retexture in side colours

*if you dont want to mess with lots of files then this can be put in initializenetvehicle instead, I'm just a bit of a purist/Benny fanboy...

The advantage of this is that you should be able to add any vehicle (hellcat?) to the retexture array and it gets repainted in the appropriate colours without any extra scripting. Disadvantage is that is you only get one set of textures per side to play with this way.

Also, really neat idea, do you mind if I nab it? :P

Share this post


Link to post
Share on other sites

I like your style Sari, thank you. Go ahead and borrow away the idea! :)

If you're going to play with the colors here's a guide on it:

you just have to change those four values

this setObjectTexture [0,'#(rgb,8,8,3)color([color="#FF0000"][b]0.635[/b][/color],[color="#008000"][b]0.576[/b][/color],[color="#0000FF"][b]0.447[/b][/color],[b]0.5[/b])'];

red, green, blue, alpha, thoses are between 0 and 1 so black should look like that :

this setObjectTexture [0,'#(rgb,8,8,3)color([color="#FF0000"][b]0[/b][/color],[color="#008000"][b]0[/b][/color],[color="#0000FF"][b]0[/b][/color],[b]1[/b])'];

if you have a custom color with values between 0-255 you just have to divide each value by 255: red 128 / 255 = 0.5, green 64 / 255 = 0.25...

I've also noticed that colors may appear lighter than the reference color.

Use this http://www.rapidtables.com/web/color/RGB_Color.htm to pick the RGB values for color changes.

Edited by SpanishSurfer

Share this post


Link to post
Share on other sites

Sari, thanks for that script. Since we have a few BECTI experts, here's another question for you guys.

I have this spawning via Ammo Factory: O_supplyCrate_F but I want players to be able to add equipment/ammo to it via gear menu (loaded when barracks is up). Zerty has pointed me to /Client/functions/ui/Functions_gearmenu

between lines 1250 and 1253 but I can't do anything with this code. How do I get the below script to also "see" a supply crate from blufor and opfor? Right now it just does vehicles and other AI units within the barracks range.

CTI_UI_Gear_LoadAvailableUnits = {
_structures = (CTI_P_SideJoined) call CTI_CO_FNC_GetSideStructures;
_list = [];
_fobs = CTI_P_SideLogic getVariable ["cti_fobs", []];
_vh=[];
{
	_v=_x;
	if ( ({_x== (vehicle _v)} count _vh) <1  && ! ((vehicle _v) == _v)) then {_vh =_vh+[vehicle _v];};
} forEach ((group player) call CTI_CO_FNC_GetLiveUnits);
_u=((group player) call CTI_CO_FNC_GetLiveUnits)+_vh;
{
	_nearest = [CTI_BARRACKS, _x, _structures, CTI_BASE_GEAR_RANGE] call CTI_CO_FNC_GetClosestStructure;
	_ammo_trucks = [_x, CTI_SPECIAL_AMMOTRUCK, CTI_BASE_GEAR_RANGE/4] call CTI_CO_FNC_GetNearestSpecialVehicles;
	_fob_in_range = false;
	if (count _fobs > 0) then {
		_fob = [_x, _fobs] call CTI_CO_FNC_GetClosestEntity;
		if (_fob distance _x <= (CTI_BASE_GEAR_FOB_RANGE*2)) then {_fob_in_range = true};
	};
	if (!isNull _nearest || _x == player || count _ammo_trucks > 0 || _fob_in_range) then {//todo add fob
		[_list, _x] call CTI_CO_FNC_ArrayPush;
		if (_x isKindOf "Man") then {
			((uiNamespace getVariable "cti_dialog_ui_gear") displayCtrl 70201) lbAdd Format["[%1] %2", _x call CTI_CL_FNC_GetAIDigit, getText(configFile >> "CfgVehicles" >> typeOf _x >> "displayName")];
		} else {
			((uiNamespace getVariable "cti_dialog_ui_gear") displayCtrl 70201) lbAdd Format["%1", getText(configFile >> "CfgVehicles" >> typeOf _x >> "displayName")];
		};
	};
} forEach _u;
//} forEach ((group player) call CTI_CO_FNC_GetLiveUnits);

uiNamespace setVariable ["cti_dialog_ui_gear_units", _list];

((uiNamespace getVariable "cti_dialog_ui_gear") displayCtrl 70201) lbSetCurSel 0;
};

Thanks for your help!

Share this post


Link to post
Share on other sites

As far as I'm concerned, most of that UI stuff is voodoo magic. Took me about two weeks to figure out how to do unit purchase from towns within the purchase menu. So far that upgrade menu bug (where if certain upgrades are disabled it doesnt display the values correctly) has taken me about a month and counting. Think im getting somewhere with it though!

Now watch Benny or someone else come in and fix it in 5 minutes...

Share this post


Link to post
Share on other sites

So you're not sure on how I can get the gear menu to recognize the crate as an object that can be filled up via menu...Damn, that's too bad. Thanks anyway.

Share this post


Link to post
Share on other sites

How do I change the point where bought vehicles spawn? I added the C17 to the Air-Factory, guess what happened :)

Share this post


Link to post
Share on other sites
How do I change the point where bought vehicles spawn? I added the C17 to the Air-Factory, guess what happened :)

kaboom

Share this post


Link to post
Share on other sites
How do I change the point where bought vehicles spawn? I added the C17 to the Air-Factory, guess what happened :)

Common > config > base > base_east/west, find the placement line of the air factory (line 88), increase the 2nd value. I think...

Edited by Sari

Share this post


Link to post
Share on other sites

Sari, I've got another problem I'd like your help with.

When I fill up ammo crates with gear (via gear menu or manually), fly it for 3-4 min across map and air drop it (we use IGILOAD), the contents in the ammo crate are gone. I put in this in Common_initiliazeNetVehicles.sqf:

//--- Clear out the cargo of the vehicle
if !(_classname isKindof "Man") then {
clearItemCargoGlobal _vehicle;
clearMagazineCargoGlobal _vehicle;
clearWeaponCargoGlobal _vehicle;
};

Could that be what's deleting all of the gear? I didn't think it would since it seemed as if this only runs when the vehicle is created.

If you think it is the problem, I was thinking an IF statement to check if the vehicle is an APC (the reason for clearing out the apc cargo on respawn is to prevent players from spawning in APCs and selling the gear in it to get better gear). Or maybe a case statement?

What do you think? And if you think that snippet of code is the problem what would an if/case statement look like so that the clearitem/magazine/weaponcargo only effects the vehicles I want it to (apcs).

Thanks Sari!

Edited by SpanishSurfer

Share this post


Link to post
Share on other sites
Common > config > base > base_east/west, find the placement line of the air factory (line 88), increase the 2nd value. I think...

Thank you very much, it worked. I have another question: After a while some AI groups refuse to buy new units although they have enough money. They also stop moving, so they are just sitting in the base doing nothing. Any ideas?

Share this post


Link to post
Share on other sites

@Spanish,

initializenetvehicle only runs when the vehicle is created so that shouldn't be your problem (do crates even get classed as vehicles? I dunno...). My guess is that its something on the igiload side. Might have a pokey on your server one day :)

@gabber,

Not sure on this one. We dont use AI teams becuase they wreck server performance. Have you tried giving them different orders (ie take towns > search and destroy) or changing their buy types (ie infantry > mechanised) to see if that wakes them up?

Share this post


Link to post
Share on other sites
@gabber,

Not sure on this one. We dont use AI teams becuase they wreck server performance. Have you tried giving them different orders (ie take towns > search and destroy) or changing their buy types (ie infantry > mechanised) to see if that wakes them up?

Yeah AI does kill server performance in the long run, but I decreased the AI slots per team to six, so it takes a while longer to melt the server. I disbanded them, gave them new orders, changed their buy type to MRAP', Tanks etc, but nothing helped. They are just standing still at the base.

Share this post


Link to post
Share on other sites
Yeah AI does kill server performance in the long run, but I decreased the AI slots per team to six, so it takes a while longer to melt the server. I disbanded them, gave them new orders, changed their buy type to MRAP', Tanks etc, but nothing helped. They are just standing still at the base.

Next time you see them doing that could you kill the leader as a test and see if when he respawns he then moves out ?

Share this post


Link to post
Share on other sites
Next time you see them doing that could you kill the leader as a test and see if when he respawns he then moves out ?

Killed every single one of them, but nothing happened. They are just standing still and do nothing. :j:

Share this post


Link to post
Share on other sites
What version of BECTI is that ?

It is Jammy's Warfare, it contains many cool features but left all AI groups untouched since BECTI 0.97, so no problem there.

Imo it is a worthy successor to BECTI, until Benny returns next year :p

Share this post


Link to post
Share on other sites
It is Jammy's Warfare, it contains many cool features but left all AI groups untouched since BECTI 0.97, so no problem there.

Imo it is a worthy successor to BECTI, until Benny returns next year :p

Does it use any territorial scripts for which towns can be taken and do the AI know about the towns which can and cant be taken ?

Is the range of the takeable towns outside the range AI will search for a first town ?

Just some sugestions

Ahh its Zertys version He will know the answer !

Im sure he will let you know once he reads the post :)

Edited by BL1P

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

×