The most sillyest question, but please answer.....

Posted By: Grand_Wizard

The most sillyest question, but please answer..... - 04/26/07 06:25

How the heck do I add scripts to my objects and resources?
Posted By: tompo

Re: The most sillyest question, but please answer. - 04/26/07 08:01

1. how to create wdl... just open empty one and save as... in your game directory
2. how to add this new wdl?
before main functin in level.wdl write:
include <name_of_new_wdl_file.wdl>;
3. if you want to include a new folder with your resources (models, sounds...etc)
at the top of main.wdl write:
path:"name_of_the_folder";

That's it
Posted By: Grand_Wizard

Re: The most sillyest question, but please answer. - 04/26/07 11:43

Well i am a total newbie, so i do not understand........

I have a script from sed in my game folder now start wed and add a model....now how do i add that script to this model?
Posted By: Scorpion

Re: The most sillyest question, but please answer. - 04/26/07 11:49

u rightclick on the model and choose properties..then u go behavior there u click on the folder symbol and u can choose the action for the entity :]

If u just have this script add to ur main folder, u have to write to the game-script include <the_name_of_your_script.wdl>;
Posted By: Grand_Wizard

Re: The most sillyest question, but please answer. - 04/26/07 12:05

I dont get the last part, and thats where the problem is actually, when i go to the behaviour, i dosent show the name of my script, it shows all other prebuilt ones.....So I figured I have to include the script in the game first and then use it. And this is where i ask, HOW?
Posted By: Scorpion

Re: The most sillyest question, but please answer. - 04/26/07 12:19

ok..small steps
in your project folder is a *.wdl file wiht the same name as your project.
open it!
and in the first line u write
Code:
include <the_name_of_your_script.wdl>;


save it!
now it should work(maybe u have to restart the level-editor)
Posted By: tompo

Re: The most sillyest question, but please answer. - 04/26/07 12:20

1. Make new script, name it and save in game directory(f.e. test)
2. in tour new and empty script write:
Code:
 
action my_new_behaviour
{
while(1)
{
my.pan += 5 * time_step;
wait(1);
}
}


Your behaviour must be acttion not function!

Then in your main.wdl, over the main function write:
Code:
 
include <test.wdl>:


Save all.

Now open wed (you have to reopen wed to see new scripts)
Place somewhere a model, then right click on the model -> properties -> open behaviour and You should see your new action "my_new_behaviour". Chose it and close properties.
Click ok, build and run.
Posted By: Grand_Wizard

Re: The most sillyest question, but please answer. - 04/26/07 16:07

Ohk...so I gotta save the file first, and then open it again?
Posted By: tompo

Re: The most sillyest question, but please answer. - 04/26/07 16:22

Not script file... but you have to reload (close and open agian) level in wed to see your new actions.
Posted By: RedPhoenix

Re: The most sillyest question, but please answer. - 04/27/07 15:52

Did you set a main script file in your properties? Go to file\properties and check f there is a script file set in the box.
© 2023 lite-C Forums