Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Tiberian Technologies / Blackhand Studios » Tiberian Technologies Forum » Weapon Grant + Removal Bug
Weapon Grant + Removal Bug [message #454842] Fri, 16 September 2011 17:53 Go to next message
halo2pac is currently offline  halo2pac
Messages: 659
Registered: December 2006
Location: Near Cleveland, Ohio
Karma: 0
Colonel
This is part of the first set of many bugs I have found I would like to report.

Take code such as:
Commands->Give_PowerUp(Killer, "POW_Pistol_Player", false);
Commands->Give_PowerUp(Killer, "CnC_POW_Ammo_ClipMax", false);
Commands->Select_Weapon(Killer, "Weapon_Pistol_Player");


then later on do this:
Commands->Give_PowerUp(Killer, "POW_AutoRifle_Player", false);
Commands->Give_PowerUp(Killer, "CnC_POW_Ammo_ClipMax", false);
Commands->Select_Weapon(Killer, "Weapon_AutoRifle_Player");
Create_2D_WAV_Sound_Player(Killer, "m00pwar_aqob0004i1evag_snd.wav");


The icon for the gun in the bottom right, stays a pistol.. and then you CANNOT access any weapon, or c4 via the 1234567890 keys.
(you normally can even with 1 weapon.)


http://img339.imageshack.us/img339/1991/nefobbygenyunoreleasere.jpg
Rene-Buddy | Renegade X
Join the fight against Obsessive-Compulsive Posting Disorder. Cancel is ur friend.
*Renegade X Dev Team Member*
Re: Weapon Grant + Removal Bug [message #455411 is a reply to message #454842] Tue, 20 September 2011 19:31 Go to previous messageGo to next message
jonwil is currently offline  jonwil
Messages: 3557
Registered: February 2003
Karma: 0
General (3 Stars)

Can I get some more information on this please?


Jonathan Wilson aka Jonwil
Creator and Lead Coder of the Custom scripts.dll
Renegade Engine Guru
Creator and Lead Coder of TT.DLL
Official member of Tiberian Technologies
Re: Weapon Grant + Removal Bug [message #455577 is a reply to message #455411] Wed, 21 September 2011 19:18 Go to previous messageGo to next message
halo2pac is currently offline  halo2pac
Messages: 659
Registered: December 2006
Location: Near Cleveland, Ohio
Karma: 0
Colonel
Ok lets say I attach a script to a player. The script hooks the on kill event.

I place this code in the on join event:
Commands->Clear_Weapons(PLayerOBject);
Commands->Give_PowerUp(PLayerOBject, "POW_Pistol_Player", false);
Commands->Give_PowerUp(PLayerOBject, "CnC_POW_Ammo_ClipMax", false);
Commands->Select_Weapon(PLayerOBject, "Weapon_Pistol_Player");


and on the on kill event:
this code (or simular)
Commands->Clear_Weapons(Killer);
Commands->Give_PowerUp(Killer, "POW_AutoRifle_Player", false);
Commands->Give_PowerUp(Killer, "CnC_POW_Ammo_ClipMax", false);
Commands->Select_Weapon(Killer, "Weapon_AutoRifle_Player");
Create_2D_WAV_Sound_Player(Killer, "m00pwar_aqob0004i1evag_snd.wav");


The Pistol and the C4 Do not clear.
Half the time you cannot select ANY weapon from your inventory.
!00% of the time the Icon.. the one that tells you what gun you have selected (via bottom right of your screen) Stays the last weapon you had before that code above.


http://img339.imageshack.us/img339/1991/nefobbygenyunoreleasere.jpg
Rene-Buddy | Renegade X
Join the fight against Obsessive-Compulsive Posting Disorder. Cancel is ur friend.
*Renegade X Dev Team Member*

[Updated on: Wed, 21 September 2011 19:18]

Report message to a moderator

Re: Weapon Grant + Removal Bug [message #455582 is a reply to message #454842] Wed, 21 September 2011 20:15 Go to previous messageGo to next message
jonwil is currently offline  jonwil
Messages: 3557
Registered: February 2003
Karma: 0
General (3 Stars)

Which scripts version are the clients in this situation running?
Some of the logic behind Clear_Weapons, Select_Weapon and stuff will only function correctly if the client has a recent enough scripts build (4.0 will work, 3.4.4 may work, not sure about anything < 3.4.4)


Jonathan Wilson aka Jonwil
Creator and Lead Coder of the Custom scripts.dll
Renegade Engine Guru
Creator and Lead Coder of TT.DLL
Official member of Tiberian Technologies
Re: Weapon Grant + Removal Bug [message #455679 is a reply to message #455582] Thu, 22 September 2011 17:11 Go to previous messageGo to next message
halo2pac is currently offline  halo2pac
Messages: 659
Registered: December 2006
Location: Near Cleveland, Ohio
Karma: 0
Colonel
The client is I, and I am running 4.0 ( I play with 2 instances of the game open) or sometimes with a 4.0 friend.

http://img339.imageshack.us/img339/1991/nefobbygenyunoreleasere.jpg
Rene-Buddy | Renegade X
Join the fight against Obsessive-Compulsive Posting Disorder. Cancel is ur friend.
*Renegade X Dev Team Member*

[Updated on: Thu, 22 September 2011 17:12]

Report message to a moderator

Re: Weapon Grant + Removal Bug [message #455687 is a reply to message #454842] Thu, 22 September 2011 20:13 Go to previous messageGo to next message
jonwil is currently offline  jonwil
Messages: 3557
Registered: February 2003
Karma: 0
General (3 Stars)

Can you paste the complete code for this script and not just the fragments you have pasted so far?


Jonathan Wilson aka Jonwil
Creator and Lead Coder of the Custom scripts.dll
Renegade Engine Guru
Creator and Lead Coder of TT.DLL
Official member of Tiberian Technologies
Re: Weapon Grant + Removal Bug [message #456008 is a reply to message #454842] Sun, 25 September 2011 16:01 Go to previous messageGo to next message
Gen_Blacky is currently offline  Gen_Blacky
Messages: 3250
Registered: September 2006
Karma: 1
General (3 Stars)
Do you still want more detail info about this bug.

http://s18.postimage.org/jc6qbn4k9/bricks3.png
Re: Weapon Grant + Removal Bug [message #456012 is a reply to message #456008] Sun, 25 September 2011 16:27 Go to previous messageGo to next message
halo2pac is currently offline  halo2pac
Messages: 659
Registered: December 2006
Location: Near Cleveland, Ohio
Karma: 0
Colonel
I sent John the code privately. He is looking it over.

http://img339.imageshack.us/img339/1991/nefobbygenyunoreleasere.jpg
Rene-Buddy | Renegade X
Join the fight against Obsessive-Compulsive Posting Disorder. Cancel is ur friend.
*Renegade X Dev Team Member*
Re: Weapon Grant + Removal Bug [message #456027 is a reply to message #454842] Sun, 25 September 2011 17:46 Go to previous messageGo to next message
Gen_Blacky is currently offline  Gen_Blacky
Messages: 3250
Registered: September 2006
Karma: 1
General (3 Stars)
Thought I would go ahead and post anyways.

Same thing happens with B_Clear_Weapons as Commands->Clear_Weapons.

In the screen shot the player had their weapons removed and was given a auto rifle and pistol. I was never given the pistol and I can't see anything in the weapon list after it disappears like halo2pac said.



void Soldier::Created(GameObject *obj)
{

	if (Commands->Is_A_Star(obj))
	{
		B_Clear_Weapons(obj);
		Commands->Give_PowerUp(obj, "POW_Pistol_Player", false);
		Commands->Select_Weapon(obj, "Weapon_Pistol_Player");
	}
}

void Soldier::Killed(GameObject *obj,GameObject *killer)
{
	if (Commands->Is_A_Star(killer))
	{

		if ( temp == 0 )
		{
			B_Clear_Weapons(killer);
			Commands->Give_PowerUp(killer, "POW_AutoRifle_Player", false);
			Commands->Give_PowerUp(obj, "POW_Pistol_Player", false);
			Commands->Give_PowerUp(killer, "CnC_POW_Ammo_ClipMax", false);
			Commands->Select_Weapon(killer, "POW_Pistol_Player");
			temp = 1;
		}
		else
		{
			B_Clear_Weapons(killer);
			Commands->Give_PowerUp(killer, "POW_AutoRifle_Player", false);
			Commands->Select_Weapon(killer, "POW_AutoRifle_Player");
			temp = 0;
		}
	}
}

void B_Clear_Weapons(GameObject *obj) // Weapon Removal Test
{
	if (!obj || !Commands->Get_ID(obj))
	{
		return;
	}
	PhysicalGameObj *o2 = ((ScriptableGameObj *)obj)->As_PhysicalGameObj();
	if (!o2)
	{
		return;
	}
	ArmedGameObj *o3 = o2->As_ArmedGameObj();
	if (!o3)
	{
		return;
	}
	WeaponBagClass *w = o3->Get_Weapon_Bag();
	int x = w->Get_Count();
	for (int i = 0;i < x;i++)
	{
		if (w->Peek_Weapon(i))
		{	
			//w->Remove_Weapon(i);
			Remove_Weapon( obj, w->Peek_Weapon(i)->Get_Name() );
		}
	}
}



Edit:

Commands->Give_PowerUp doesn't work after the players weapons have been cleared and granted one power up. The player has to be destroyed first.
  • Attachment: test2.jpg
    (Size: 386.40KB, Downloaded 111 times)


http://s18.postimage.org/jc6qbn4k9/bricks3.png

[Updated on: Sun, 25 September 2011 18:16]

Report message to a moderator

Re: Weapon Grant + Removal Bug [message #456112 is a reply to message #456027] Mon, 26 September 2011 20:22 Go to previous messageGo to next message
halo2pac is currently offline  halo2pac
Messages: 659
Registered: December 2006
Location: Near Cleveland, Ohio
Karma: 0
Colonel
see in that picture in the bottom right.. it stays a pistol no matter what i change weapons too :S

http://img339.imageshack.us/img339/1991/nefobbygenyunoreleasere.jpg
Rene-Buddy | Renegade X
Join the fight against Obsessive-Compulsive Posting Disorder. Cancel is ur friend.
*Renegade X Dev Team Member*
Re: Weapon Grant + Removal Bug [message #456113 is a reply to message #454842] Mon, 26 September 2011 20:49 Go to previous messageGo to next message
jonwil is currently offline  jonwil
Messages: 3557
Registered: February 2003
Karma: 0
General (3 Stars)

For the problem where removing a weapon (or all weapons) and then adding weapons causes failures on the client, try having a timer with a very small tick between the "remove weapon" and "add weapon" commands. This will cause the netcode to sync up to the "remove weapon" commands and then to the "add weapon" commands properly.


Jonathan Wilson aka Jonwil
Creator and Lead Coder of the Custom scripts.dll
Renegade Engine Guru
Creator and Lead Coder of TT.DLL
Official member of Tiberian Technologies
Re: Weapon Grant + Removal Bug [message #456195 is a reply to message #454842] Tue, 27 September 2011 17:55 Go to previous message
halo2pac is currently offline  halo2pac
Messages: 659
Registered: December 2006
Location: Near Cleveland, Ohio
Karma: 0
Colonel
Kinda a hack, but worth a shot at least.

http://img339.imageshack.us/img339/1991/nefobbygenyunoreleasere.jpg
Rene-Buddy | Renegade X
Join the fight against Obsessive-Compulsive Posting Disorder. Cancel is ur friend.
*Renegade X Dev Team Member*
Previous Topic: TTFS folder?
Next Topic: Missing Textures ingame, which are present in LE
Goto Forum:
  


Current Time: Fri Dec 20 17:16:13 MST 2024

Total time taken to generate the page: 0.01399 seconds