Adding action in WED

Posted By: dracula

Adding action in WED - 12/02/09 10:38

I can attach an action to an entity in WED.
It appears in the behavior list and all looks good.
When I run the level, however, the screen is black. I have no error messages, just a black screen.
I have tried many different ways of achieving this simple task but it never works.

The puzzling thing is this, I have done this many times correctly but with a version of 3DGS from about 1 year ago.

I would be greatful of any help please
Posted By: dracula

Re: Adding action in WED - 12/03/09 12:20

Nobody can help ??
Posted By: Quad

Re: Adding action in WED - 12/03/09 12:26

make sure your script is loading your level, when you run a map that has a script file attached to it from WED, it runs the script.
Posted By: dracula

Re: Adding action in WED - 12/03/09 20:21

Hi Quad,

I am not loading my level, I didn't think you had to ?

When I press the traffic lights in WED I get the black screen
When I 'preview' the map I see the level but the action isn't working.


Here's my work flow:

1. Open WED save new level to a folder.
2. In SED, create a file called test.c and place an action inside it
3. Select Map Properties in WED, select test.c
4. Load entity, attach behavior
5. Build/Run = blank screen.

Where do I load the level ?, I assumed this happens automatically when I run the compiled level (.WMB)

Thanks
Posted By: Quad

Re: Adding action in WED - 12/03/09 21:23

add this to your test.c

void main(){
level_load("level_name.wmb");
}

so why do you need to that?

Because when you dont attact a script to your map(step 3 in your post), engine works as wmb viewer and shows your level.(just as you double click .wmb file from windows explorer)

but when you have a script attached, wed runs that script, if your script doesnt load your level you won't see it. As in same way, if your script has player spawning or other panels on the screen, they will also show up when you run from wed.

pay attention to these screens:

this is the options you get if you did not selected a script. That runs engine with your level in level viewer mode.


this is the options you get whewn you have a script attached. This runs your script, just like if you started it from SED.
Posted By: dracula

Re: Adding action in WED - 12/04/09 13:20

Hi Quad

thank you very much for clarifing this for me

You are a very kind and helpful person

Cheers
Posted By: MikeS

Re: Adding action in WED - 12/05/09 21:55

Hmm, i have nearly the same problem, i attached an action in WED to an entity, defined the action in SED, updated entities in WED, and test run the script.

Now i get the error message, <new action> not found.

So what did i wrong?

The second entity had an action in WED attached, and defined in SED too, and this works really good.

Greetings
Mike
Posted By: Nowherebrain

Re: Adding action in WED - 12/05/09 23:49

are your scripts being updated? If you update your scripts, then return to wed it will give you a warning(unless it auto loads via options panel)that files have changed....make sure they are reloaded, then rebuild. This could be something else entirely though.
Posted By: MikeS

Re: Adding action in WED - 12/06/09 15:46

hmm,maybe thats the reason.but how do i update the script? I just only save it...

Greetings Mike
Posted By: Ottawa

Re: Adding action in WED - 12/06/09 16:24

Hi!

Is this what your looking for?

In WED
preferences
common options
reload of externally modified files
Posted By: MikeS

Re: Adding action in WED - 12/06/09 17:19

Hmm, nope, did not help :-(

Greetings Mike
Posted By: dracula

Re: Adding action in WED - 12/06/09 17:32

I just wanted to confirm that Quad's solution solved my problem.
I don't know what yours is Mike, I thought Ottawa's suggestion would have solved it as this is 'off' by default.
Posted By: MikeS

Re: Adding action in WED - 12/06/09 19:22

My prob is, i wrote an action in SED, Attached it in WED to an level entity, updated entities in WED, closed it, started sed again,run a test run, and get the error message : action not found.

Greetings

Mike
Posted By: dracula

Re: Adding action in WED - 12/06/09 19:52

I have the action in the same folder as the level etc.
The action is my_action.c (note the extension)
The action is listed in the behaviors panel

apart from the above ... I know nothing else frown
Posted By: MikeS

Re: Adding action in WED - 12/11/09 18:30

k,solved myproblem,
the name of the actionwas too long, i cutted it to 19 chars, and now the action works fine without error message.

Thanks to all

Greetings Mike
© 2024 lite-C Forums