Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » gameobject list
gameobject list [message #464925] Mon, 26 March 2012 05:04 Go to next message
robbyke is currently offline  robbyke
Messages: 348
Registered: September 2010
Location: Belgium
Karma: 0
Recruit
int KB_Find_Amount_Scripts_Per_Team(const char *script,int Team)
{
	int Amount = 0;
	SLNode<GameObject> *x = GameObjManager::GameObjList.Head();
	while (x)
	{
		GameObject *o = x->Data();
		int team = Get_Team(Get_Player_ID(o));
		if (Team == team)
		{
			if(Is_Script_Attached(o,script))
			{
				Amount = Amount + 1;
			}
		}
		x = x->Next();
	}
	return Amount;
};


Error 1 error C2440: 'initializing' : cannot convert from 'SLNode<T> *' to 'SLNode<T> *' C:\Users\roby\Desktop\source test\Kambot\KB_Functions.cpp 90

2 IntelliSense: a value of type "SLNode<BaseGameObj> *" cannot be used to initialize an entity of type "SLNode<GameObject> *" c:\users\roby\desktop\source test\kambot\kb_functions.cpp 90


i know there are other lists but the objects i search arent in there since i made them with scripts


Owner of kambot TT server

kambot.freeforums.org

[Updated on: Mon, 26 March 2012 05:08]

Report message to a moderator

Re: gameobject list [message #464926 is a reply to message #464925] Mon, 26 March 2012 05:55 Go to previous messageGo to next message
jonwil is currently offline  jonwil
Messages: 3557
Registered: February 2003
Karma: 0
General (3 Stars)

Try this:
#include "scriptablegameobj.h"
int KB_Find_Amount_Scripts_Per_Team(const char *script,int Team)
{
	int Amount = 0;
	SLNode<BaseGameObj> *x = GameObjManager::GameObjList.Head();
	while (x)
	{
		ScriptableGameObj *o = x->Data()->As_ScriptableGameObj();
		if (o)
		{
			int team = Get_Team(Get_Player_ID(o));
			if (Team == team)
			{
				if(Is_Script_Attached(o,script))
				{
						Amount = Amount + 1;
				}
			}
		}
		x = x->Next();
	}
	return Amount;
};



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: gameobject list [message #464933 is a reply to message #464925] Mon, 26 March 2012 09:54 Go to previous message
robbyke is currently offline  robbyke
Messages: 348
Registered: September 2010
Location: Belgium
Karma: 0
Recruit
isnt basegameobj something that has to do with the base? :s or is it just the basic

but it does work now


Owner of kambot TT server

kambot.freeforums.org

[Updated on: Mon, 26 March 2012 09:54]

Report message to a moderator

Previous Topic: Waterfalls
Next Topic: 3dsmax8 Flying Buildings
Goto Forum:
  


Current Time: Wed Dec 18 00:55:26 MST 2024

Total time taken to generate the page: 0.00600 seconds