Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » 4.0 doesn't support some stuff that 3.4 did??
4.0 doesn't support some stuff that 3.4 did?? [message #468141] Tue, 29 May 2012 01:51 Go to next message
Distrbd21 is currently offline  Distrbd21
Messages: 743
Registered: September 2008
Karma: 0
Colonel

ChatCommandClass
ChatCommandRegistrant
TokenClass


It doesn't let me use them.

Here's the code I did.

class picChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &Text,int ChatType) {

	    GameObject *obj = Get_GameObj(ID);
		int cost = 1200;
		const char *item = "Pic";
		const char *powerup = "POW_PersonalIonCannon_Player";
//		const char *wepname = "Weapon_PersonalIonCannon_Player";


		if (Commands->Get_Money(Get_GameObj(ID)) < cost)
		{
			Console_Input(StrFormat("sndp %d m00evag_dsgn0028i1evag_snd.wav",ID).c_str());
			Console_Input(StrFormat("ppage %d you need %d to buy a %s",ID, cost, item).c_str());
		}
		else
		{
            Commands->Give_PowerUp(obj, powerup, 1);
//            Set_Clip_Bullets(obj,wepname,Get_Max_Clip_Bullets(obj,wepname));
            Commands->Give_Money(obj, static_cast<float>(-cost), false);
            Console_Input(StrFormat("msg %s just bought a %s ",Get_Player_Name(obj), item, cost).c_str());
			
		}
	}
};

ChatCommandRegistrant<picChatCommand> picChatCommandReg("!personal_ion_cannon;!pic",CHATTYPE_ALL,0,GAMEMODE_ALL);


Live Your Life Not Some one Else's.| Sharing Is Caring

http://dsgaming.us/distrbd21/Distrbd21%20siggy.png

Cookie Jar

Suicide

[Updated on: Tue, 29 May 2012 01:55]

Report message to a moderator

Re: 4.0 doesn't support some stuff that 3.4 did?? [message #468147 is a reply to message #468141] Tue, 29 May 2012 05:27 Go to previous messageGo to next message
robbyke is currently offline  robbyke
Messages: 348
Registered: September 2010
Location: Belgium
Karma: 0
Recruit
old token class is from ssgm and TT remove it
I also liked that way more and i therefor ported it to 4.0

the Code isnt clean i was to lazy to clean it up but it works


Topic with ported tokenclass


Owner of kambot TT server

kambot.freeforums.org
Re: 4.0 doesn't support some stuff that 3.4 did?? [message #468165 is a reply to message #468141] Tue, 29 May 2012 14:38 Go to previous messageGo to next message
Whitedragon is currently offline  Whitedragon
Messages: 832
Registered: February 2003
Location: California
Karma: 1
Colonel
.

Black-Cell.net
Network Administrator (2003 - )

DragonServ, Renegade's first IRC interface bot
Creator and lead coder (2002 - )

Dragonade, Renegade's first server side modification
Lead coder (2005 - )

[Updated on: Mon, 23 July 2012 00:39]

Report message to a moderator

Re: 4.0 doesn't support some stuff that 3.4 did?? [message #468178 is a reply to message #468141] Tue, 29 May 2012 20:30 Go to previous messageGo to next message
Distrbd21 is currently offline  Distrbd21
Messages: 743
Registered: September 2008
Karma: 0
Colonel

I would love to yes

Live Your Life Not Some one Else's.| Sharing Is Caring

http://dsgaming.us/distrbd21/Distrbd21%20siggy.png

Cookie Jar

Suicide
Re: 4.0 doesn't support some stuff that 3.4 did?? [message #468190 is a reply to message #468141] Wed, 30 May 2012 03:22 Go to previous messageGo to next message
robbyke is currently offline  robbyke
Messages: 348
Registered: September 2010
Location: Belgium
Karma: 0
Recruit
Current tokenclass? is it int the scripts already or is it comming?

Owner of kambot TT server

kambot.freeforums.org

[Updated on: Wed, 30 May 2012 03:23]

Report message to a moderator

Re: 4.0 doesn't support some stuff that 3.4 did?? [message #468210 is a reply to message #468190] Wed, 30 May 2012 13:54 Go to previous messageGo to next message
Distrbd21 is currently offline  Distrbd21
Messages: 743
Registered: September 2008
Karma: 0
Colonel

robbyke wrote on Wed, 30 May 2012 05:22

Current tokenclass? is it int the scripts already or is it comming?

apparently it's coming ;p


Live Your Life Not Some one Else's.| Sharing Is Caring

http://dsgaming.us/distrbd21/Distrbd21%20siggy.png

Cookie Jar

Suicide
Re: 4.0 doesn't support some stuff that 3.4 did?? [message #468213 is a reply to message #468141] Wed, 30 May 2012 14:32 Go to previous messageGo to next message
Distrbd21 is currently offline  Distrbd21
Messages: 743
Registered: September 2008
Karma: 0
Colonel

It only give's me one error now.

Says something about !railgun;!rail

no instance of constructor "ChatCommandRegistrant<T>::ChatCommandRegistrant [with T=railgun1ChatCommand]" matches the argument list c:\users\distrbd21\documents\visual studio 2010\projects\source\weapons\weapons.cpp 41


class railgun1ChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &Text,int ChatType) {
		GameObject *obj = Get_GameObj(ID);
		int cost = 1200;
		const char *powerup = "POW_Railgun_Player";


		if (Commands->Get_Money(Get_GameObj(ID)) < cost)
		{
            Commands->Give_PowerUp(obj, powerup, 1);
            Commands->Give_Money(obj, static_cast<float>(-cost), false);
			
		}
	}
};

ChatCommandRegistrant<railgun1ChatCommand> railgun1ChatCommandReg("!railgun;!rail",0);


Live Your Life Not Some one Else's.| Sharing Is Caring

http://dsgaming.us/distrbd21/Distrbd21%20siggy.png

Cookie Jar

Suicide
Re: 4.0 doesn't support some stuff that 3.4 did?? [message #468221 is a reply to message #468141] Wed, 30 May 2012 16:42 Go to previous messageGo to next message
robbyke is currently offline  robbyke
Messages: 348
Registered: September 2010
Location: Belgium
Karma: 0
Recruit
fix the registrant :


template <class T> class ChatCommandRegistrant : public ChatCommandList {
public:
	ChatCommandRegistrant(const char *Command,int NumParams) {
		char *Comm = newstr(Command);
		char *p = strtok(Comm,";");
		while (p) {
			ChatCommandClass *Temp = new T;
			Add_Chat_Command(Temp,p,NumParams);
			p = strtok(0,";");
		}
		delete[] Comm;
	}

};



could be this fixes your problem, could be it doesnt i dont know where things go wrong in your code if i dont see it


Also your plugin will compile but wont work as you placed your commandclass in ssgm instead of your plugin

You have to place them inside your own plugin otherwise it wont work


Owner of kambot TT server

kambot.freeforums.org

[Updated on: Wed, 30 May 2012 16:45]

Report message to a moderator

Re: 4.0 doesn't support some stuff that 3.4 did?? [message #468223 is a reply to message #468221] Wed, 30 May 2012 17:31 Go to previous messageGo to next message
Distrbd21 is currently offline  Distrbd21
Messages: 743
Registered: September 2008
Karma: 0
Colonel

robbyke wrote on Wed, 30 May 2012 18:42

fix the registrant :


template <class T> class ChatCommandRegistrant : public ChatCommandList {
public:
	ChatCommandRegistrant(const char *Command,int NumParams) {
		char *Comm = newstr(Command);
		char *p = strtok(Comm,";");
		while (p) {
			ChatCommandClass *Temp = new T;
			Add_Chat_Command(Temp,p,NumParams);
			p = strtok(0,";");
		}
		delete[] Comm;
	}

};



could be this fixes your problem, could be it doesnt i dont know where things go wrong in your code if i dont see it


Also your plugin will compile but wont work as you placed your commandclass in ssgm instead of your plugin

You have to place them inside your own plugin otherwise it wont work


I did place it in my own plugin after talking to you, I get no other error's but that one.

and I get this error now.
c:\users\distrbd21\documents\visual studio 2010\projects\source\weapons\WeapChatClass.h(37): error C2504: 'ChatCommandList' : base class undefined
2>          Weapons.cpp(41) : see reference to class template instantiation 'ChatCommandRegistrant<T>' being compiled
2>          with
2>          [
2>              T=railgun1ChatCommand
2>          ]



Live Your Life Not Some one Else's.| Sharing Is Caring

http://dsgaming.us/distrbd21/Distrbd21%20siggy.png

Cookie Jar

Suicide

[Updated on: Wed, 30 May 2012 17:35]

Report message to a moderator

Re: 4.0 doesn't support some stuff that 3.4 did?? [message #468224 is a reply to message #468141] Wed, 30 May 2012 18:04 Go to previous messageGo to next message
robbyke is currently offline  robbyke
Messages: 348
Registered: September 2010
Location: Belgium
Karma: 0
Recruit
you sure everything is included everywhere?

also could you post the errors in the error window not the output window?


Owner of kambot TT server

kambot.freeforums.org
Re: 4.0 doesn't support some stuff that 3.4 did?? [message #468232 is a reply to message #468224] Thu, 31 May 2012 01:31 Go to previous message
Distrbd21 is currently offline  Distrbd21
Messages: 743
Registered: September 2008
Karma: 0
Colonel

robbyke wrote on Wed, 30 May 2012 20:04

you sure everything is included everywhere?

also could you post the errors in the error window not the output window?

Error 3 error C2504: 'ChatCommandList' : base class undefined c:\users\distrbd21\documents\visual studio 2010\projects\source\weapons\WeapChatClass.h 37


Live Your Life Not Some one Else's.| Sharing Is Caring

http://dsgaming.us/distrbd21/Distrbd21%20siggy.png

Cookie Jar

Suicide
Previous Topic: Need help please
Next Topic: page poke system
Goto Forum:
  


Current Time: Thu Nov 21 10:47:09 MST 2024

Total time taken to generate the page: 0.00847 seconds