The topic says it all..

What I'm trying to do, is create a new model and set some default values for it. Although everything else is set (string1, string2, material, position, scale..), the action string always remains "ndef".

Here's some code...


 Code:
DWORD AddWaypoint_Open ( const void  * execute_arg, void * data, DWORD * execute_flags, UINT execute_handle)
{
	char Name[128] = "Waypoint";
	char File[128] = "ix_waypoint.mdl";
	char Action[128] = "HERE IS THE PROBLEM";
	float Skills[20] = {0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0 };
	int nSkills = 0;
	DWORD Flags = 0;
	float Ambient = 0;
	float Albedo = 0;
	char Path[128]="";
	char Attached[128]="";
	char Material[128]="THIS STUFF IS SET JUST FINE";
	char String1[1024]="SO IS THIS";
	char String2[1024]="";


	CObjTrans trans;

	gp_WedInterface->GetCameraPosition(0,trans.Pos,0);
	trans.scl().x= trans.scl().y = trans.scl().z = 1;
	trans.dwFlags = (OBJTR_POS|OBJTR_ROT|OBJTR_SCL);


	CNodeInfo	Node;
	gp_WedInterface->object_GetCurrentNode ( & Node);
	gp_WedInterface->object_SelectObjectID ( Node.Id);


	wedpi_CreateModel ( *gp_WedInterface,
						Node.Id,trans, Name,File,
						Action,Skills,nSkills,Flags,Ambient,Albedo,
						Path,Attached,Material,String1,String2);

	gp_WedInterface->DrawLevel();

	return TRUE;
}



I've also tried to change the action string After the model is created, using both obje_SetObjData(OBJD_ACTION,...) and DoCommand(piHandle, WCMD_MD_SETACTIONNAME,...) but nothing works. I don't get any errors or anything, they just seem to have no effect, although obje_GetObjData(OBJD_ACTION,...) and DoCommand(piHandle, WCMD_GETACTIONINFO,...) work great for Retrieving the action name..

I'm using the latest wed sdk and A7.08.2b


INTENSE AI: Use the Best AI around for your games!
Join our Forums now! | Get Intense Pathfinding 3 Free!