[WED] Actions in additional C-files

Posted By: deleRium

[WED] Actions in additional C-files - 09/21/07 18:52

Hi

I just put some actions in an additional "envoirement.c"-file. This file shall include all actions for envoirement behaviour.

The file is included in my main script.

Now the problem:

In the "Ressource"-tab of WED, I can see the included "envoirement.c" file but i can't the actions defined in it (e.g. pBarrel).

Also if i change the entity actions of a model, there's no pBarrel action to select.

Is this a bug?

Thanks in advance for your help
Posted By: HeelX

Re: [WED] Actions in additional C-files - 09/22/07 11:07

Uhm this should be no problem, I use this method, too.

E.g. if you have an action rotateDummy:

Code:
action rotateDummy
{
while (1) {
my.pan + = 5 * time_step;
wait(1);
}
}



Then you can write it like this into your dummy .c file for WED:

Code:
action rotateDummy {wait(1);}



or like this:

Code:
action rotateDummy ();


Posted By: deleRium

Re: [WED] Actions in additional C-files - 09/22/07 21:59

I uploaded the executable regarding the panel visibility with alpha transparency (http://www.coniserver.net/ubbthreads/showflat.php/Cat/0/Number/787868/an/0/page/0#Post787868)

There u can see how my scripts are written.

bullet_physics.c
Code:
...

//////////////////////////////
// Project-specific includes
//////////////////////////////
#include "help.wdl"
#include "variables.wdl"
#include "envoirement.wdl"

...



envoirement.c
Code:
...

// text: Used for barrels
// image: barrel.pcx
// section: Physics
// Flag1: Physics 1
// help: Enables the physics-engine for this object
// Skill1: Weight 5
// help: Sets a weight for the object (f.e. filled and unfilled barrels)
action pFass()
{
if is(my,FLAG1)
{
phent_settype (me, PH_RIGID, PH_BOX);
phent_setmass (me, my.skill1, PH_BOX);
phent_setfriction (me, 100);
phent_setdamping (me, 40, 40);
phent_setelasticity (me, 0, 0);
}

my.emask = ENABLE_SHOOT;
my.event = shoot_event;
}

...



WED doesn't show the pFass action when trying to assign a action to an entity.
Posted By: Felixsg

Re: [WED] Actions in additional C-files - 09/23/07 00:56

Why you include "envoirement.wdl" if are supposed "envoirement.c"?
Posted By: HeelX

Re: [WED] Actions in additional C-files - 09/23/07 10:55

Try to write action pFass {...} instead of action pFass() {...}. This is the way actions are defined (no parameter list). That the example in my post with () works, is not intended

Did you selected the environment.wdl in WED as script?
Posted By: deleRium

Re: [WED] Actions in additional C-files - 09/23/07 14:00

@Felixsg:
just a typo The original file is called envoirement.wdl

@HeelX:
THX for the info about the action definition, but also without brakets it doesn't work.


The file is displayed in ressources, but it isn't the level script.
Posted By: 3Dski

Re: [WED] Actions in additional C-files - 09/25/07 04:27

I'm having the same problem, only worse. I'm not even seeing the my test include. If I move my simple rotate action into the main script, WED still can't find it, even if I reselect it via map properties. However, if I go ahead and manually assign my simple rotate action to an entity, it builds in and runs in my test.

I'm hoping one doesn't have to add custom entries into template_6.xml to have them show up in the behaviors list!

EDITTED: Alright! Once I closed WED and reopened it, then I was able to see the include and the action as expected within the behavior selection list. I would have thought it would hae recognized it by simple by reaelecting the updated main script in the map properties dialog : )
Posted By: deleRium

Re: [WED] Actions in additional C-files - 09/25/07 08:04

WED can auto-reload your scripts. Everytime you update a script, and then change to WED again, it can auto reload it.

[WED] ==> File ==> Preferences ==> ADVANCED ==> "Reload of externally modified files:"

Auto reloads it automaticaly every time, you do some changes, save your script and then switch back to WED.
Prompt asks you if a script was changed and you switch back to WED.
Disable ... nothing
Posted By: deleRium

Re: [WED] Actions in additional C-files - 09/27/07 12:10

Posted in bug forum
http://www.coniserver.net/ubbthreads/fav...amp;postmarker=
© 2024 lite-C Forums