wed plugin problem.

Posted By: _cash_

wed plugin problem. - 12/15/10 19:54

im write a wed plugin.
i cant change String1 or String2 if entity's String1 or String2 are empty.

plugin crash.

if i manualy set entitys StringX property
and run the plugin,
plugin correctly change StringX value.

how can i solve this.

(sory for bad english)
Posted By: Lukas

Re: wed plugin problem. - 12/15/10 21:31

if(!entity.string1) entity.string1 = str_create("Hello!");
Posted By: WretchedSid

Re: wed plugin problem. - 12/15/10 21:34

Its a WED Plugin wink
And the string1 and string2 are readonly inside the engine.
Posted By: Quad

Re: wed plugin problem. - 12/15/10 21:39

in wed they are not "in engine" yet(i know you are talking to Lukas about lite-c part), and you can actually change the string1 and string2 from plugin if they are NOT empty. If they are empty, you get an empty pointer and if try to change that you get a crash. If you alloc space for string1 and string2, then your code does not crash but string1 and string2 does not change either.
Posted By: Lukas

Re: wed plugin problem. - 12/15/10 21:40

"Its a WED Plugin"
Oops, sorry I didn't read carefully, I thought he was talking about an engine plugin.
Posted By: _cash_

Re: wed plugin problem. - 12/16/10 12:50

did anyone change entity's StringX property in WED plugin?
Posted By: _cash_

Re: wed plugin problem. - 12/22/10 14:23

how i change entitys skill9 property? (in wed plugin)

please help.
Posted By: jcl

Re: wed plugin problem. - 12/22/10 16:27

I am not this familiar with the SDK, but I'll forward this question to the developer. He'll also look into the string1 and string2 issue. I think you'll have a solution after the holidays.
Posted By: Wlad

Re: wed plugin problem. - 12/23/10 10:21

How do you set the String1 and String2? Do you use the function "bool CObjEditInterface::obje_GetInfo ( OBJECTINFO * pObjInfo)" ?
Posted By: _cash_

Re: wed plugin problem. - 12/23/10 11:09

when i understand i cant change StringX parameters correcly.
i think maybe i can split data and write to skills property.
but in this case, i can change only skill1-skill8 area.
i cant change skill9-skill20 area.

example:
oei->obje_SetObjData(OBJD_SKILL,n,(void *)&fskill,sizeof(float));

if n greater then 8, skills dont change.

managers stop our project becuse of this problems. frown

(sory for bad english)
Posted By: _cash_

Re: wed plugin problem. - 12/23/10 11:26

master Wlad,
check this:
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=350181
Posted By: Wlad

Re: wed plugin problem. - 12/23/10 17:26

>>set String1 or String2

your code:

//////////////////
CObjEditInterface *oei=gp_WedInterface->object_GetEditInterface();

oei->obje_SelectObjID(oi->Id,true);
MODELINFO mi;
oei->obje_GetInfo (&mi);
strncpy(mi.String1,komutlar[id].komut_data,30);
strcpy(mi.String2,"ddd"); //this line crash
////////////////////////

You can use the "obje_GetInfo" only to get object data, but not for change. The String1 and String2 are defined as "constant char *".



>> ... i cant change skill9-skill20 area. ...

At the moment you kann set all 20 skills only if the entity has EXTENDED typ. Otherwise, you can set only 8 skills.
The entity is EXTENDED wenn String1 or String2 or Material or Path are defined, or Albedo is not equal 50.




Unfortunately, with current WED Plugin SDK you cann create new entity with defined String1/2 and other features, but you can not change
some parameters als String1 or String2 by existing entities.


I have the functions "obje_SetObjData" and "obje_GetObjData" completed, so that it is now possible.

A example for setting new values for String1 and String2:

///////////////////////////////////////////////
CObjEditInterface *oei=gp_WedInterface->object_GetEditInterfaceID(oi->Id);

oei->obje_SetObjData ( OBJD_STRING, 0, "string for string 1", 19);
oei->obje_SetObjData ( OBJD_STRING, 1, "string for string 2", 19);
//////////////////////////////////////////////


I have added to OBJDATA enum other members:

OBJD_AMBIENT, //idx 0, data typ float ptr, datasize = sizeof(float)
OBJD_ALBEDO, //index 0, data typ float ptr, datasize = sizeof(float)
OBJD_PATH, //index 0, data typ string, datasize = string length or buffer size
OBJD_ATTACHED, //index 0, data typ string, datasize = string length or buffer size
OBJD_MATERIAL, //index 0, data typ string, datasize = string length or buffer size
OBJD_STRING, //index 0-1, data typ string, datasize = string length or buffer size


and it is now possible set (or get with "obje_GetObjData") this values:

float amb = 3.33f;
oei->obje_SetObjData ( OBJD_AMBIENT, 0, &amb, sizeof(amb));

float alb=55.55f;
oei->obje_SetObjData ( OBJD_ALBEDO, 0, &alb, sizeof(alb));

oei->obje_SetObjData ( OBJD_PATH, 0, "path_123", 8);
oei->obje_SetObjData ( OBJD_ATTACHED, 0, "attached_123", 12);
oei->obje_SetObjData ( OBJD_MATERIAL, 0, "mtrl_678", 8);



From WED version 6.957, you can use this possibility.


Posted By: _cash_

Re: wed plugin problem. - 12/23/10 19:49

thank you for all of this.
i grateful for explanations.

we wait new wed sdk.

we finaly finish our ingame system to wed connection.

you seem to engine programer.
and its mean we have lots of question for you laugh
Posted By: Quad

Re: wed plugin problem. - 12/23/10 20:46

@cash, if i am not mistaken, he is the WED and wed sdk developer, JCL is the engine developer.
Posted By: jcl

Re: wed plugin problem. - 12/27/10 09:56

The new WED, together with the new wed_i.h header file and examples, can be downloaded here:

http://server.conitec.net/down/wedsdk_patch.zip

The new WED will also be included in the next Gamestudio update 8.11. Then you can modify skill9-20 and string1/2 even on models that were created without them.
© 2024 lite-C Forums