Raised This Month: $51 Target: $400
 12% 

[TF2] Freak Fortress 2


Post New Thread Closed Thread   
 
Thread Tools Display Modes
Eggman
Senior Member
Join Date: Jan 2010
Old 04-12-2012 , 07:06   Re: [TF2] Freak Fortress 2
#171

Quote:
Originally Posted by FlaminSarge View Post
Do you *want* me to look at FF2 and fix things? Or do you want to fix it yourself?
I can fix little bugs (like uncorrected FF2_StopMusic native), and save yout time for making v.1.1.


Quote:
Originally Posted by hkkelvin1995 View Post
Need some help~~~~
My friend and I created a character "Creeper" in Minecraft.
Everything goes well, including the sounds and abilities.
But the model doesn't.
We found a model but it is a prop.
We discover that the model cannot rotate so we thought to use the following code to fix it
PHP Code:
if (Boss[index]==15)
{
SetEntProp(Boss[index], Prop_Send"m_bCustomModelRotates",1);
SetEntProp(Boss[index], Prop_Send"m_bUseClassAnimations",0);

But the plugin doesn't run it automatically.
How to make it runs well?
Quote:
Originally Posted by hkkelvin1995 View Post
if (Boss[index]==15)
{
SetEntProp(Boss[index], Prop_Send, "m_bCustomModelRotates",1);
SetEntProp(Boss[index], Prop_Send, "m_bUseClassAnimations",0);
}
WTF is this condition?

Last edited by Eggman; 04-12-2012 at 07:36.
Eggman is offline
wasder
Senior Member
Join Date: Oct 2009
Location: That country
Old 04-12-2012 , 07:15   Re: [TF2] Freak Fortress 2
#172

Updated the 4th post.
wasder is offline
Send a message via Skype™ to wasder
Eggman
Senior Member
Join Date: Jan 2010
Old 04-12-2012 , 07:36   Re: [TF2] Freak Fortress 2
#173

Both rage sub-plugins updated:
Code:
// rage_overlay:		arg0 - slot (def.0)
//						arg1 - path to overlay ("root" is \tf\materials\)
//						arg2 - duration

#pragma semicolon 1

#include <sourcemod>
#include <tf2items>
#include <tf2_stocks>
#include <freak_fortress_2>
#include <freak_fortress_2_subplugin>

new BossTeam=_:TFTeam_Blue;

public Plugin:myinfo = {
	name = "Freak Fortress 2: rage_overlay",
	author = "Jery0987, RainBolt Dash",
};

public OnPluginStart2()
{
	HookEvent("teamplay_round_start", event_round_start);
}

public Action:event_round_start(Handle:event, const String:name[], bool:dontBroadcast)
{
	CreateTimer(0.3,Timer_GetBossTeam);
	return Plugin_Continue;
}

public Action:Timer_GetBossTeam(Handle:hTimer)
{
	BossTeam=FF2_GetBossTeam();
	return Plugin_Continue;
}

public Action:FF2_OnAbility2(index,const String:plugin_name[],const String:ability_name[],action)
{
	if (!strcmp(ability_name,"rage_overlay"))
		Rage_Overlay(index,ability_name);
	return Plugin_Continue;
}

Rage_Overlay(index,const String:ability_name[])
{
	decl String:overlay[PLATFORM_MAX_PATH];
	FF2_GetAbilityArgumentString(index,this_plugin_name,ability_name,1,overlay,PLATFORM_MAX_PATH);
		//this_plugin_name is from freak_fortress_2_subplugin
	Format(overlay,PLATFORM_MAX_PATH,"r_screenoverlay \"%s\"",overlay);
	SetCommandFlags("r_screenoverlay", GetCommandFlags("r_screenoverlay") & (~FCVAR_CHEAT));
	for (new i = 1; i <= MaxClients; i++)
		if (IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i)!=BossTeam)
			//This is good place for GetClientTeam(i)!=BossTeam - we don't want attack blue teammates with overlays
		{
			ClientCommand(i, overlay);
		}
	CreateTimer(FF2_GetAbilityArgumentFloat(index,this_plugin_name,ability_name,2,6.0),Clean_Screen);	//Make one timer for all players, not for each.
	SetCommandFlags("r_screenoverlay", GetCommandFlags("r_screenoverlay") & FCVAR_CHEAT);
	//return do not needed
}

public Action:Clean_Screen(Handle:hTimer)
{
	SetCommandFlags("r_screenoverlay", GetCommandFlags("r_screenoverlay") & (~FCVAR_CHEAT));
	for (new i = 1; i <= MaxClients; i++)
		if (IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i)!=BossTeam)
		{
			ClientCommand(i, "r_screenoverlay \"\"");
		}
	SetCommandFlags("r_screenoverlay", GetCommandFlags("r_screenoverlay") & FCVAR_CHEAT);
	return Plugin_Continue;
}
Code:
// rage_noanims:		arg0 - slot (def.0)
//						arg1 - 1 = Custom Model Rotates (def.0)
//
// rage_new_weapon:		arg0 - slot (def.0)
//						arg1 - weapon's classname
//						arg2 - weapon's index
//						arg3 - weapon's attributes
//						arg4 - weapon's slot
//						arg5 - weapon's ammo
//						arg6 - force switch to this weapon


#pragma semicolon 1

#include <sourcemod>
#include <tf2items>
#include <tf2_stocks>
#include <freak_fortress_2>
#include <freak_fortress_2_subplugin>

public Plugin:myinfo = {
	name = "Freak Fortress 2: special_noanims",
	author = "RainBolt Dash",
};

public OnPluginStart2()
{
	HookEvent("teamplay_round_start", event_round_start);
}

public Action:FF2_OnAbility2(index,const String:plugin_name[],const String:ability_name[],action)
{
	if (!strcmp(ability_name,"rage_new_weapon"))
		Rage_NewWeapon(index,ability_name);
	return Plugin_Continue;
}

public Action:event_round_start(Handle:event, const String:name[], bool:dontBroadcast)
{
	CreateTimer(0.41,Timer_Disable_Anims);
	CreateTimer(9.31,Timer_Disable_Anims);
	return Plugin_Continue;
}


public Action:Timer_Disable_Anims(Handle:hTimer)
{
	decl Boss;
	for (new index = 0; (Boss=GetClientOfUserId(FF2_GetBossUserId(index)))>0; index++)
	{
		if (FF2_HasAbility(index,this_plugin_name,"special_noanims"))
		{
			SetEntProp(Boss, Prop_Send, "m_bUseClassAnimations",0);
			SetEntProp(Boss, Prop_Send, "m_bCustomModelRotates",FF2_GetAbilityArgument(index,this_plugin_name,"special_noanims",1,0));
		}
	}
	return Plugin_Continue;
}

Rage_NewWeapon(index,const String:ability_name[])
{
	new Boss=GetClientOfUserId(FF2_GetBossUserId(index));
	decl String:classname[64];
	decl String:attributes[64];
	FF2_GetAbilityArgumentString(index,this_plugin_name,ability_name, 1, classname, 64);
	FF2_GetAbilityArgumentString(index,this_plugin_name,ability_name, 3, attributes, 64);
	new slot=FF2_GetAbilityArgument(index,this_plugin_name,ability_name, 4);
	TF2_RemoveWeaponSlot(Boss, slot);
	new weapon=SpawnWeapon(Boss, classname, FF2_GetAbilityArgument(index,this_plugin_name,ability_name,2,56), 100, 5, attributes);
	if (FF2_GetAbilityArgument(index,this_plugin_name,ability_name, 6))
		SetEntPropEnt(Boss, Prop_Send, "m_hActiveWeapon", weapon);
	new ammo=FF2_GetAbilityArgument(index,this_plugin_name,ability_name, 5);
	if (ammo>0)
		SetAmmo(Boss, slot,ammo);
}

stock SetAmmo(client, slot, ammo)
{
	new weapon = GetPlayerWeaponSlot(client, slot);
	if (IsValidEntity(weapon))
	{
		new iOffset = GetEntProp(weapon, Prop_Send, "m_iPrimaryAmmoType", 1)*4;
		new iAmmoTable = FindSendPropInfo("CTFPlayer", "m_iAmmo");
		SetEntData(client, iAmmoTable+iOffset, ammo, 4, true);
	}
}

stock SpawnWeapon(client,String:name[],index,level,qual,String:att[])
{
	new Handle:hWeapon = TF2Items_CreateItem(OVERRIDE_ALL|FORCE_GENERATION);
	TF2Items_SetClassname(hWeapon, name);
	TF2Items_SetItemIndex(hWeapon, index);
	TF2Items_SetLevel(hWeapon, level);
	TF2Items_SetQuality(hWeapon, qual);
	new String:atts[32][32];
	new count = ExplodeString(att, " ; ", atts, 32, 32);
	if (count > 0)
	{
		TF2Items_SetNumAttributes(hWeapon, count/2);
		new i2 = 0;
		for (new i = 0; i < count; i+=2)
		{
			TF2Items_SetAttribute(hWeapon, i2, StringToInt(atts[i]), StringToFloat(atts[i+1]));
			i2++;
		}
	}
	else
		TF2Items_SetNumAttributes(hWeapon, 0);
	if (hWeapon==INVALID_HANDLE)
		return -1;
	new entity = TF2Items_GiveNamedItem(client, hWeapon);
	CloseHandle(hWeapon);
	EquipPlayerWeapon(client, entity);
	return entity;
}
Attached Files
File Type: zip special_noanims.zip (6.1 KB, 143 views)
File Type: zip rage_overlay.zip (4.2 KB, 139 views)
File Type: sp Get Plugin or Get Source (special_noanims.sp - 135 views - 3.4 KB)
File Type: sp Get Plugin or Get Source (rage_overlay.sp - 139 views - 2.3 KB)

Last edited by Eggman; 04-12-2012 at 07:37.
Eggman is offline
hkkelvin1995
Senior Member
Join Date: Jun 2009
Location: Hong Kong
Old 04-12-2012 , 08:44   Re: [TF2] Freak Fortress 2
#174

umm...
It's a little hard to explain......
OK My friend and I created a new character, Creeper from Minecraft.
It's number 15 in characters.cfg.
We chose a Creeper model for it, but it's a prop.
The model cannot rotate(Although the player is looking at different places, other players see that the model is fixed, cannot rotate, Spys are difficult to stab its back)
It keeps looking to an angle.
This problem was in VS Saxton Hale, but we have successfully made it rotatable.
It is because in VSH, we could instruct the plugin to run some script while the specified character spawned.
But It doesn't work now in FF2.
Now the question is simple.
How to instruct the plugins to automatically run the following script when Character 15(We set Creeper as No.15 in characters.cfg) appear?
PHP Code:
SetEntProp(Boss[index], Prop_Send"m_bCustomModelRotates",1); 
Sorry about spending your time to read my long question and my bad English
hkkelvin1995 is offline
S_W_A_T
Senior Member
Join Date: Dec 2007
Old 04-12-2012 , 09:46   Re: [TF2] Freak Fortress 2
#175

I'd really hope someone revamp the Ninja-Spy slow-mo rage to a non-svcheats version.
S_W_A_T is offline
PMAvers
Member
Join Date: Sep 2009
Old 04-12-2012 , 12:34   Re: [TF2] Freak Fortress 2
#176

More random thoughts:

Any chance for a option that always forces it to choose from all available characters instead of having that "vote for a pack" vote to happen?

Also I'm assuming that vote probably shouldn't need to happen if there's only one category, since if "Random" and "FF2" are the only choices, there isn't really a choice.

In this version's maps.cfg, it's enabled by default for koth and cp maps. Should they really be on by default if you need to use a separate mod to make them work?
PMAvers is offline
MaloModo
Veteran Member
Join Date: Aug 2008
Old 04-12-2012 , 13:16   Re: [TF2] Freak Fortress 2
#177

In my travels I have noticed the mod_downloads doesn't check for custom .phy file. Do this have some significance?

Also update to new DR map...just tested it again...cycle through camera views when on it to see changes....this is link to mediafire...the creator said banana was giving him some problems.

vsh_dr_office_beta3b
http://www.mediafire.com/?j52voqr6civbw35

Last edited by MaloModo; 04-12-2012 at 14:04.
MaloModo is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 04-12-2012 , 13:44   Re: [TF2] Freak Fortress 2
#178

Quote:
Originally Posted by PMAvers View Post
In this version's maps.cfg, it's enabled by default for koth and cp maps. Should they really be on by default if you need to use a separate mod to make them work?
It's enabled for arena, vsh, and koth in the config, but not cp.

I just assumed that it had logic to detect the koth point entity in addition to the arena point entity, but I didn't actually check the code for it.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 04-12-2012 at 13:45.
Powerlord is offline
napalm00
Veteran Member
Join Date: Jun 2011
Location: Italy, sadly
Old 04-12-2012 , 14:30   Re: [TF2] Freak Fortress 2
#179

Office seems to contain a giant penis and a box with a naked woman, just a warn for those who don't allow such stuff
__________________
napalm00 is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 04-12-2012 , 14:54   Re: [TF2] Freak Fortress 2
#180

Quote:
Originally Posted by napalm00 View Post
Office seems to contain a giant penis and a box with a naked woman, just a warn for those who don't allow such stuff
Good thing to mention. I don't think my current gaming group cares, but my old one would have.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:04.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode