Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, Quad, 1 invisible), 721 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
[WED] Actions in additional C-files #156115
09/21/07 18:52
09/21/07 18:52
Joined: Sep 2007
Posts: 42
Germany - Braunschweig
deleRium Offline OP
Newbie
deleRium  Offline OP
Newbie

Joined: Sep 2007
Posts: 42
Germany - Braunschweig
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

Re: [WED] Actions in additional C-files [Re: deleRium] #156116
09/22/07 11:07
09/22/07 11:07
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
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 ();



Re: [WED] Actions in additional C-files [Re: HeelX] #156117
09/22/07 21:59
09/22/07 21:59
Joined: Sep 2007
Posts: 42
Germany - Braunschweig
deleRium Offline OP
Newbie
deleRium  Offline OP
Newbie

Joined: Sep 2007
Posts: 42
Germany - Braunschweig
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.

Re: [WED] Actions in additional C-files [Re: deleRium] #156118
09/23/07 00:56
09/23/07 00:56
Joined: May 2003
Posts: 567
Spain, Canary Islands
Felixsg Offline
User
Felixsg  Offline
User

Joined: May 2003
Posts: 567
Spain, Canary Islands
Why you include "envoirement.wdl" if are supposed "envoirement.c"?

Re: [WED] Actions in additional C-files [Re: Felixsg] #156119
09/23/07 10:55
09/23/07 10:55
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
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?

Re: [WED] Actions in additional C-files [Re: HeelX] #156120
09/23/07 14:00
09/23/07 14:00
Joined: Sep 2007
Posts: 42
Germany - Braunschweig
deleRium Offline OP
Newbie
deleRium  Offline OP
Newbie

Joined: Sep 2007
Posts: 42
Germany - Braunschweig
@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.

Re: [WED] Actions in additional C-files [Re: deleRium] #156121
09/25/07 04:27
09/25/07 04:27
Joined: Nov 2005
Posts: 94
Texas
3
3Dski Offline
Junior Member
3Dski  Offline
Junior Member
3

Joined: Nov 2005
Posts: 94
Texas
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 : )

Last edited by 3Dski; 09/25/07 04:43.
Re: [WED] Actions in additional C-files [Re: 3Dski] #156122
09/25/07 08:04
09/25/07 08:04
Joined: Sep 2007
Posts: 42
Germany - Braunschweig
deleRium Offline OP
Newbie
deleRium  Offline OP
Newbie

Joined: Sep 2007
Posts: 42
Germany - Braunschweig
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

Re: [WED] Actions in additional C-files [Re: deleRium] #156123
09/27/07 12:10
09/27/07 12:10
Joined: Sep 2007
Posts: 42
Germany - Braunschweig
deleRium Offline OP
Newbie
deleRium  Offline OP
Newbie

Joined: Sep 2007
Posts: 42
Germany - Braunschweig


Moderated by  HeelX, rvL_eXile 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1