Paul

Bambi God Mode

15 posts in this topic

Hi Guys

Is it possible to make Bambi's have god mode? We run a PVE server and quite often have AI killing people as they're parachuting in, so I was thinking that giving people god mode whilst on their parachute would be a good compromise between me wanting them parachute in, and them moaning about being killed when parachuting.

I tried amending:
ExileClient_object_player_bambiStateBegin.sqf to have allowDamage false;
and
ExileClient_object_player_bambiStateEnd.sqf to have allowDamage true;

But that didn't work and just caused memory errors repeatedly (did it the normal way over overwriting the files in config.cpp etc), which I presume is caused by the fact that we're overwriting client files and pointing them to the server for them instead?

If anyone can help, or make suggestions, please let me know :)

Paul

Share this post


Link to post
Share on other sites

Posted (edited)

You can increase the time that bambi status exists in your server config.cpp

protectionDuration = 5;

 

Edited by StonedReality

Share this post


Link to post
Share on other sites
Advertisement

But that doesn't give you god mode as far as I'm aware, and AI still kill you.

Isn't that just how long you're in Bambi mode to put other players off killing you (for loss of rep purposes)?

Share this post


Link to post
Share on other sites

Posted (edited)

@Paul

Overwriting those files should be fine, show us the code? And how you 'changed' them, ie did you overwrite them the correct way?

Edited by John

Share this post


Link to post
Share on other sites

Here the bambiStateBegin file, the end one is almost the same.

Yes, overwrote them in the config.cpp using the correct section (I have a few other things in there already)

/**
 * ExileClient_object_player_bambiStateBegin
 *
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
private["_duration"];
disableSerialization;
if !(ExileClientPlayerIsBambi) then 
{
	if (alive player) then
		{
			["InfoTitleAndText", ["You are in Bambi state","You are invincible for a short time!"]] call ExileClient_gui_toaster_addTemplateToast;
		};
	_duration = _this;
	ExileClientPlayerIsBambi = true;
	ExileClientPlayerBambiStateExpiresAt = time + _duration; 
	true call ExileClient_gui_hud_toggleBambiIcon;
	allowDamage = false;
	ExileClientEndBambiStateThread = [_duration, ExileClient_object_player_bambiStateEnd, [], true] call ExileClient_system_thread_addTask;
};
true

Config file:

class CfgExileCustomCode 
{
	/*
		You can overwrite every single file of our code without touching it.
		To do that, add the function name you want to overwrite plus the 
		path to your custom file here. If you wonder how this works, have a
		look at our bootstrap/fn_preInit.sqf function.

		Simply add the following scheme here:

		<Function Name of Exile> = "<New File Name>";

		Example:

		ExileClient_util_fusRoDah = "myaddon\myfunction.sqf";
	*/

	//Remove Weapons from vehicles
	ExileServer_object_vehicle_createPersistentVehicle = "addons\ExileServer_object_vehicle_createPersistentVehicle.sqf";
	//Vehicle invincibility
	ExileServer_object_vehicle_database_update = "addons\ExileServer_object_vehicle_database_update.sqf";
	ExileServer_object_vehicle_database_load = "addons\ExileServer_object_vehicle_database_load.sqf";
	// Make Bambis Invincible
	ExileClient_object_player_bambiStateBegin = "addons\ExileClient_object_player_bambiStateBegin.sqf";
	ExileClient_object_player_bambiStateEnd = "addons\ExileClient_object_player_bambiStateEnd.sqf";

};

 

Share this post


Link to post
Share on other sites

Where you have allowdamage = false. Needs to be - player  allowDamage false ..do that and u will be right

Share this post


Link to post
Share on other sites
10 hours ago, John said:

Where you have allowdamage = false. Needs to be - player  allowDamage false ..do that and u will be right

Hi John

i tried that first. The server worked ok and I could log in, but I still died, and didn't have the bambi logo. There were errors in the logs referring to a ; missing, even though there was one at the end of the line.

I'll try it again later and get the logs for it

Share this post


Link to post
Share on other sites

Posted (edited)

This should work for you:

https://dl.dropboxusercontent.com/u/21910758/Exile/BambiState/ExileClient_object_player_bambiStateBegin.sqf

https://dl.dropboxusercontent.com/u/21910758/Exile/BambiState/ExileClient_object_player_bambiStateEnd.sqf

ExileClient_object_player_bambiStateBegin:

Spoiler

/**
 * ExileClient_object_player_bambiStateBegin
 *
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
private["_duration"];
disableSerialization;
if !(ExileClientPlayerIsBambi) then 
{
	if (alive player) then
	{
		["InfoTitleAndText", ["Bambi State", "You are invincible whilst a Bambi!"]] call ExileClient_gui_toaster_addTemplateToast;
	};
	
	_duration = _this;
	ExileClientPlayerIsBambi = true;
	ExileClientPlayerBambiStateExpiresAt = time + _duration; 
	true call ExileClient_gui_hud_toggleBambiIcon;
	ExileClientEndBambiStateThread = [_duration, ExileClient_object_player_bambiStateEnd, [], true] call ExileClient_system_thread_addTask;
	player allowDamage = false;
};
true

 

ExileClient_object_player_bambiStateEnd:

Spoiler

/**
 * ExileClient_object_player_bambiStateEnd
 *
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
disableSerialization;
if (ExileClientPlayerIsBambi) then 
{
	if (alive player) then
	{
		["InfoTitleAndText", ["Bambi State", "Your Bambi state expired! You are no longer invincible!"]] call ExileClient_gui_toaster_addTemplateToast;
		["endBambiStateRequest"] call ExileClient_system_network_send;	
	};
	[ExileClientEndBambiStateThread] call ExileClient_system_thread_removeTask;
	ExileClientPlayerIsBambi = false;
	false call ExileClient_gui_hud_toggleBambiIcon;
	player allowDamage = true;
};
true

 

 

Edited by kuplion

Share this post


Link to post
Share on other sites

That makes sense, as I didn't state what should be invincible (didn't have the player on the front).

i didn't try anything last night, but will later or tomorrow

Share this post


Link to post
Share on other sites
9 minutes ago, Paul said:

That makes sense, as I didn't state what should be invincible (didn't have the player on the front).

i didn't try anything last night, but will later or tomorrow

Let us know how you get on. :)

Share this post


Link to post
Share on other sites
Advertisement

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

  • Recently Browsing   0 members

    No registered users viewing this page.