### change groundcover via script

There are no stupid questions, just stupid answers.
• 1
• 2
• 3
• 4
• 5
• 6
• 8

#### Re: change groundcover via script

subabrain
Posts: 136
Joined: Sat Aug 20, 2016 4:58 pm

Hello again

as i wrote:

subabrain wrote:hey guys,

i find out something good...

thats how you an set the brush (for painting etc.):

Code: Select all

ETerrainEditor.setBrushPos(getWord(%curPos, 0) + %x, getWord(%curPos, 1) + %y);

and get the brush:

Code: Select all

%curPos = ETerrainEditor.getBrushPos();

now i just need to "paint" on the brush position... - maybe you can help me?

Thank you very much!

Greetz
Robert

Sorry that im disturbing you :/

but i know how to set the position of the brush... i tried to paint through the command Azaezel shows ... but maybe someone could tell me how i get this right?

i tried to make the player position to the brush one - thats working ...

i hope you could help me a last time ... would be nice - THANKS!

Greetings
Robert

#### Re: change groundcover via script

Duion
Posts: 844
Joined: Sun Feb 08, 2015 1:51 am

So now you need to know what happens when you press the mouse button on the terrain painter?
I don't know where this is done, maybe try setting a breakpoint and see what happens, I think it is in terrainEditor.ed.cs

#### Re: change groundcover via script

subabrain
Posts: 136
Joined: Sat Aug 20, 2016 4:58 pm

Duion wrote:So now you need to know what happens when you press the mouse button on the terrain painter?
I don't know where this is done, maybe try setting a breakpoint and see what happens, I think it is in terrainEditor.ed.cs

yes thats the point - theres nothing shown in the console or somewhere else in torsion when i do the paint in the terrainpainter :/

okay but i hope we will get it

thanks alot - i try to search the "terrainEditor.ed.cs" again

greetings
Robert

#### Re: change groundcover via script

Duion
Posts: 844
Joined: Sun Feb 08, 2015 1:51 am

Then it will probably be in the C++ source code.
I looked it up for you and it may be this one:
https://github.com/GarageGames/Torque3D ... #L197-L247

#### Re: change groundcover via script

subabrain
Posts: 136
Joined: Sat Aug 20, 2016 4:58 pm

hey - thanks alot for this answer

i will try to modify 8)

edit: yes it seem to work - thx!

greetz
Robert

#### Re: change groundcover via script

subabrain
Posts: 136
Joined: Sat Aug 20, 2016 4:58 pm

hi there,

okay i made an output from the method and when i press the mouse button while painting.
So its the right thing

but i have troubles to be able to execute this function by torquescript ... i read some things but i dont know if im right ..

would be nice i you could help me (maybe i will find it out faster)

Thanks a lot for your help!

Regards -
Robert

#### Re: change groundcover via script

subabrain
Posts: 136
Joined: Sat Aug 20, 2016 4:58 pm

hey there,

i stuck a little bit

i want to call the method "PaintMaterialAction::process" from torquescript.
so now i took the following in the c++ code:

DefineEngineFunction(tesla, void, (), , "")
{
PaintMaterialAction::process;
}

and the following to the torquescript:

DefineEngineFunction( tesla, void, (),, "" )
{
echo("test");
}

so this is not working.
what do i made wrong?

Thanks a lot and gn8
Robert

#### Re: change groundcover via script

Duion
Posts: 844
Joined: Sun Feb 08, 2015 1:51 am

I'm not very good at the C++ side, but I would look if you find something that already does the same thing that you want and copy it and replace it with your function.
Otherwise I cannot help you much with that.

#### Re: change groundcover via script

subabrain
Posts: 136
Joined: Sat Aug 20, 2016 4:58 pm

hi,

okay now i found out how to call a c++ method from torquescript.
Now i only have to execute the PaintMaterialAction::process method - but im sure to find it out

greetz
Robert

#### Re: change groundcover via script

subabrain
Posts: 136
Joined: Sat Aug 20, 2016 4:58 pm

hi,

sorry i didnt get it

greetz
Robert
• 1
• 2
• 3
• 4
• 5
• 6
• 8

#### Who is online

Users browsing this forum: SqHd and 2 guests