Community Forum

Need help for my script please

Forum Overview >> Scripting

CategoryScripting
Created14.02.2016 17:13


Fred Zanella (fredzaza2) 14.02.2016 17:14
hi , i want to make my own script like Waterlog.lua

in my map, if i put my script in moddesc like this :

<extraSourceFiles>
<sourceFile filename="Myscript.lua" />
</extraSourceFiles>

and in Mymap.i3d

<UserAttribute nodeId="367862">
<Attribute name="onCreate" type="scriptCallback" value="Myscript.onCreate"/>
</UserAttribute>

it is correctly ?

because my script don't want launch

Emil Drefers (Unknown) 15.02.2016 08:29
Hi,

the value for the script callback depends on where you place your script.
In the shown example the system would expect the script to be in its very own mod directory, not in the directory of the map.

Cheers,
Emil

Pawel Lesniak (Unknown) 15.02.2016 10:24
Hello i want to ask about shaders.\
I've modeled a tree pine and branches are separated index and i want to add TreeBranchShader for that windy effect but when i aplly it with GE and save next time when i open a tree .i3d on one tree i dont see the leaves they are there but texture is disapear or on another tree leaves are still there but nothing hapend to them in game they are still in one place and dont move.
What im doing wrong?

Should the branches index got the same name as original got "attachments"?

Emil Drefers (Unknown) 16.02.2016 07:56
Hi,

please have a look at the log.txt (or the output which the Editor generates in the scripting window during startup).
Are there any error messages?
Maybe a texture file could not be loaded?

But the treeBranchShader.xml does not generate any wind effects on the trees ;)

Cheers,
Emil

Pawel Lesniak (Unknown) 16.02.2016 10:49
so what should i do to get this wind effect (movement) for my branches add some shader or what?

Emil Drefers (Unknown) 17.02.2016 07:55
Hi,

in principle a shader is the right option to chose if you want to make the branches move in the wind.
But if you have a closer look at the default trees you will notice that they don't move.


Cheers,
Emil



Note: Log in to post. Create a new account here.