|
7 registered members (3run, miwok, AndrewAMD, Quad, TipmyPip, fairtrader, 1 invisible),
637
guests, and 2
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
[WED SDK] Can't set or change an Entitiy's Action
#202106
04/13/08 12:13
04/13/08 12:13
|
Joined: Jul 2004
Posts: 1,205 Greece
LarryLaffer
OP
Serious User
|
OP
Serious User
Joined: Jul 2004
Posts: 1,205
Greece
|
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...
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
|
|
|
Re: [WED SDK] Can't set or change an Entitiy's Action
[Re: jcl]
#213886
07/01/08 11:54
07/01/08 11:54
|
Joined: Jul 2004
Posts: 1,205 Greece
LarryLaffer
OP
Serious User
|
OP
Serious User
Joined: Jul 2004
Posts: 1,205
Greece
|
Yes, the action name bug will be fixed in the public beta. That's great news. Thanks! There is no real function for assigning a script file - a level has no own script file, that's just a placeholder for the main game script used to test the level in WED.
That's exacly what I need to be able to change through the sdk. The name of the script is indeed saved in the .wmp and the only workaround I can see to change it is to modify the wmp file directly, which isn't exactly fun... Changing the main script used to test a level in wed is -very- important for a template solution, like your T7 or my product, because WED is the only mean for a user to test his game from. I want the users to be able to 'import' a level they've already created into their project, which will then get assigned with the main script's name automatically, so they'll be able to test-run their game from WED: My panel. Import level is grayed out cause I can't do that with the current version of wedsdk
|
|
|
Re: [WED SDK] Can't set or change an Entitiy's Action
[Re: LarryLaffer]
#214515
07/05/08 00:55
07/05/08 00:55
|
Joined: Jul 2004
Posts: 1,205 Greece
LarryLaffer
OP
Serious User
|
OP
Serious User
Joined: Jul 2004
Posts: 1,205
Greece
|
Just installed the public beta and was happy to see that the action name bug is indeed fixed. About that SetMainScriptName() function, will this still make it for the coming up public release, or did u mean the next public release in 2-3 months or so? If it's the latest, is there anyway I could convince you otherwise?(I've read somewhere on the site that you can pay for features, which I'd be happy to) Before asking I spent all day today trying to hack the .wmp to change the script name myself, but everytime I'd change the length of the main script's name I'd receive an "Unexpected end of file found" error from WED. This feature is pretty vital for my project and i'd hate if I had to postpone its release for 3 more months  Thanks for considering.. Aris PS: About my other wedsdk suggestions, I could live without them for a few more months/years....
|
|
|
|