change groundcover via script

There are no stupid questions, just stupid answers.
41 posts Page 4 of 5
subabrain
Posts: 91
Joined: Sat Aug 20, 2016 4:58 pm
 
by subabrain » Wed Jul 12, 2017 2:03 pm
Hello again :P

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
Duion
Posts: 758
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Wed Jul 12, 2017 3:28 pm
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
subabrain
Posts: 91
Joined: Sat Aug 20, 2016 4:58 pm
 
by subabrain » Wed Jul 12, 2017 4:45 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
Duion
Posts: 758
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Wed Jul 12, 2017 7:08 pm
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
subabrain
Posts: 91
Joined: Sat Aug 20, 2016 4:58 pm
 
by subabrain » Wed Jul 12, 2017 7:32 pm
hey - thanks alot for this answer :)

i will try to modify 8)

edit: yes it seem to work - thx!

greetz
Robert
subabrain
Posts: 91
Joined: Sat Aug 20, 2016 4:58 pm
 
by subabrain » Thu Jul 13, 2017 8:34 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) :P :)

Thanks a lot for your help!

Regards -
Robert
subabrain
Posts: 91
Joined: Sat Aug 20, 2016 4:58 pm
 
by subabrain » Sat Jul 15, 2017 12:01 am
hey there,

i stuck a little bit :P

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
Duion
Posts: 758
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Sat Jul 15, 2017 10:13 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.
subabrain
Posts: 91
Joined: Sat Aug 20, 2016 4:58 pm
 
by subabrain » Sun Jul 16, 2017 10:45 am
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
subabrain
Posts: 91
Joined: Sat Aug 20, 2016 4:58 pm
 
by subabrain » Sun Jul 23, 2017 2:49 pm
hi,

sorry i didnt get it :(

greetz
Robert
41 posts Page 4 of 5

Who is online

Users browsing this forum: Bing [Bot] and 1 guest