Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » C++ Problem.
C++ Problem. [message #339748] Tue, 08 July 2008 12:46 Go to next message
HeavyX101- Left is currently offline  HeavyX101- Left
Messages: 633
Registered: April 2008
Location: WindowsJail=ZipFolder
Karma: 0
Colonel
Hey guys, i'm having a problem here.
There is something wrong with this line here:
			 	   const char *preset = Get_Preset_Name(Text[1].c_str());


The error that shows up is :
Quote:

Error 1 error C3861: 'Get_Preset_ID': identifier not found c:\Westwood\RenegadeFDS\Server\gmmain.cpp 2479




What is the problem. I cant seem to figure it out.
Note: I just installed VS C++ 2009 because VS2005 is not working. But VS2009 compiled SSGM when i first opened it.


This account is no longer being active.
Re: C++ Problem. [message #339750 is a reply to message #339748] Tue, 08 July 2008 12:51 Go to previous messageGo to next message
mrãçķz is currently offline  mrãçķz
Messages: 3069
Registered: August 2007
Karma: 0
General (3 Stars)
Permabanned for trying and failing DDoS
add Commands->
Re: C++ Problem. [message #339751 is a reply to message #339748] Tue, 08 July 2008 12:54 Go to previous messageGo to next message
cnc95fan is currently offline  cnc95fan
Messages: 1260
Registered: July 2007
Karma: 0
General (1 Star)
You can make cheats and yet not figure that out! Sarcasm

Cabal8616 wrote on Sun, 27 April 2008 15:50

I say a personal fanning of the genitals would be awesome.


RA3 AUTOMATICLY SUCKS
www.battlefordune.co.uk
Re: C++ Problem. [message #339753 is a reply to message #339750] Tue, 08 July 2008 12:56 Go to previous messageGo to next message
HeavyX101- Left is currently offline  HeavyX101- Left
Messages: 633
Registered: April 2008
Location: WindowsJail=ZipFolder
Karma: 0
Colonel
I got this error now Sad


Error	1	error C2664: 'const char *(GameObject *)' : cannot convert parameter 1 from 'const char *' to 'GameObject *'	c:\Westwood\RenegadeFDS\Server\gmmain.cpp	2479


This account is no longer being active.
Re: C++ Problem. [message #339787 is a reply to message #339748] Tue, 08 July 2008 15:27 Go to previous messageGo to next message
bmruze is currently offline  bmruze
Messages: 62
Registered: March 2006
Location: South Carolina
Karma: 1
Recruit

Can you show what else you are trying to use it with?

https://content.screencast.com/users/bmruze/folders/Jing/media/b3acb17d-6b52-4e10-8183-eae956a12446/2017-09-02_0843.png
Re: C++ Problem. [message #339809 is a reply to message #339787] Tue, 08 July 2008 17:39 Go to previous messageGo to next message
HeavyX101- Left is currently offline  HeavyX101- Left
Messages: 633
Registered: April 2008
Location: WindowsJail=ZipFolder
Karma: 0
Colonel
Why, the error is only on that line.
And i dont like putting my codes here because this is what happened once.
I was making a jail code and i had errors. I posted a code here so i could get help. After a day or 2 people strted to use that code and didnt give me any credit but gave the credit for the person that fixed the error. I just couldnt explain to cpjok that it was my code, but he kept saying that roshambo made it.


This account is no longer being active.
Re: C++ Problem. [message #339824 is a reply to message #339748] Tue, 08 July 2008 18:54 Go to previous messageGo to next message
Veyrdite is currently offline  Veyrdite
Messages: 1471
Registered: August 2006
Location: Australia, Sydney
Karma: 0
General (1 Star)
Commonly with C++ the line that is reporting errors on isn't actually the line with errors - instead lines before it have stuffed up the syntax. Go through your code from the beginning to that point or comment lines out until you have found the culprit.

WOL: Veyrdite Previously: Dthdealer ( a long time ago )

[Updated on: Tue, 08 July 2008 18:55]

Report message to a moderator

Re: C++ Problem. [message #339827 is a reply to message #339824] Tue, 08 July 2008 19:00 Go to previous messageGo to next message
HeavyX101- Left is currently offline  HeavyX101- Left
Messages: 633
Registered: April 2008
Location: WindowsJail=ZipFolder
Karma: 0
Colonel

// SCRIPT MADE BY HEAVYX101, REMEMBeR THAT!
class presetbuildChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &Text,int ChatType) {
		GameObject *obj = Get_GameObj(ID);
				GameObject *Own = Get_GameObj(ID);
			 	   const char *preset = Commands->Get_Preset_Name(Text[1].c_str());
Vector3 position;
position = Commands->Get_Position(obj);
position.Z += 0;
position.X += (float)(5*cos(Commands->Get_Facing(Get_GameObj(ID))*(3.14 / 180)));
position.Y += (float)(5*sin(Commands->Get_Facing(Get_GameObj(ID))*(3.14 / 180)));
 {


	GameObject *object = Commands->Create_Object("%d",preset));
Console_Input(StrFormat("msg WORKS!").c_str());
	Commands->Set_Facing(obj, Commands->Get_Facing(obj)-180);
	}
	}
};
ChatCommandRegistrant<presetbuildChatCommand> presetbuildChatCommandReg("!pbuild",CHATTYPE_ALL,1,GAMEMODE_AOW);

That is the whole command i'm working on. Rocked Over


This account is no longer being active.

[Updated on: Tue, 08 July 2008 19:10]

Report message to a moderator

Re: C++ Problem. [message #339836 is a reply to message #339748] Tue, 08 July 2008 19:24 Go to previous messageGo to next message
Veyrdite is currently offline  Veyrdite
Messages: 1471
Registered: August 2006
Location: Australia, Sydney
Karma: 0
General (1 Star)
The last two lines are a bit questionable. A semi-colon after a closing bracket?
Note that I've never been near Renegade C++ rather other versions for other games.


WOL: Veyrdite Previously: Dthdealer ( a long time ago )
Re: C++ Problem. [message #339841 is a reply to message #339836] Tue, 08 July 2008 19:47 Go to previous messageGo to next message
HeavyX101- Left is currently offline  HeavyX101- Left
Messages: 633
Registered: April 2008
Location: WindowsJail=ZipFolder
Karma: 0
Colonel
I havent work with coding for like 3 weeks now, i think i forgot some stuff Sad

This account is no longer being active.
Re: C++ Problem. [message #339849 is a reply to message #339841] Tue, 08 July 2008 21:00 Go to previous message
Veyrdite is currently offline  Veyrdite
Messages: 1471
Registered: August 2006
Location: Australia, Sydney
Karma: 0
General (1 Star)
HeavyX101 wrote on Wed, 09 July 2008 12:47

I havent work with coding for like 3 weeks now, i think i forgot some stuff Sad

Try having a reference page open next to the script window.


WOL: Veyrdite Previously: Dthdealer ( a long time ago )
Previous Topic: Need some more file names.
Next Topic: Character Polys?
Goto Forum:
  


Current Time: Wed Nov 13 16:39:57 MST 2024

Total time taken to generate the page: 0.01594 seconds