Jump to content

subabrain

Members
  • Posts

    194
  • Joined

  • Last visited

Everything posted by subabrain

  1. Hello my Friends, its done!!! here my tutorial about it: http://blog.beran-solutions.de/2017/10/04/mow-a-meadow-with-torque-3d/ i hope its working for you!!! Have a good Time!!! Regards Robert
  2. Hey irei1as, thanks a lot for your help - it works perfect! Greetings Robert
  3. okay - i get it its because the distance view of the groundcover. an somebody tell my how i can change the distance view of the groundcover? would be nice - thx! greetz Robert
  4. Hello Again, this is the last question i have :) i get the following if i do some actions with the terrain painter. i get some groundcover and paint a material on the ground and now there is some graphical problem it always stucks a little bit and the groundcover will disappear for a moment. It would be nice if you could help me to solve this problem :) Greetings Robert
  5. Good Morning Guys, EDIT: i will do it with the processAction method (like shown before) ;) there will follow a tutorial soon 8-) greetings and nice day! Robert
  6. hi, yes i tried this already - i think its from the player class? So i tried this with included the player.h :( : Player *pl = new Player(); Point3F pos = pl->getPosition(); but its not the active position it always goes to point 0.000 0.000 100.000 :/ maybe you know why? thx and greetz! Robert
  7. Hello Friends, i tried to look for a Function to get the Position from the Player - i know the thing in Torquescript but i need it for the c++ code of Torque 3D. would be nice if you could tell me :) thx and gn8! Robert
  8. Okay now, i get it 8-) So for change the groundcover (here the terrain Material which can layered by Groundcover) from torquescript do the following (without c++): go to the file "EditorGui.ed.gui" in the folder "tools/worldEditor/gui" and change the line: processUsesBrush = "0"; into processUsesBrush = "1"; then go to "scripts/server/" and create a File - name it "grass.cs" with the following content: function grass(%this) { //Make the size of the brush ETerrainEditor.setBrushSize(2, 2); //Set the Shape of the brush ETerrainEditor.setBrushType("box"); //Change "grass1" to the material you like %matIndex = ETerrainEditor.getMaterialIndex( "grass1" ); //Change "test" to a terrain id you like ETerrainEditor.setPaintMaterial(%matIndex, "test"); //%curPos = LocalClientConnection.Player.getPosition(); //%x = getword(%curPos, 0); //%y = getword(%curPos, 1); //%pZ = getword(%trans, 2); //ETerrainEditor.processAction(%pX, %pY, %pZ, "paintMaterial"); //ETerrainEditor.setBrushPos(getWord(%curPos, 0) + %x, getWord(%curPos, 1) + %y); //Run the thing ETerrainEditor.processAction("paintMaterial"); //$eventID = schedule(230,0,grass); } please recognize that the Comments are important for make the brush pos to the player ... Then add a entry in "scriptExec.cs" with the folder "scripts/server/" somewhere in the file: ... exec("./grass.cs"); ... Okay now you can add a material texture with run the command "grass();" in the console (can be opened with "^" in game). There is a thing to get the Ground of the Player to be changed -> From C++ it works with some arguments... But it should do it also with the TorqueScript -> therefore is a function: %curPos = LocalClientConnection.Player.getPosition(); %x = getword(%curPos, 0); %y = getword(%curPos, 1); //%pZ = getword(%trans, 2); ETerrainEditor.setBrushPos(getWord(%curPos, 0) + %x, getWord(%curPos, 1) + %y); But its not working in my case :/ I get the following error: scripts/server/grass.cs (19): ETerrainEditor::setBrushPos - wrong number of arguments (got 4, expected min 3 and max 3). maybe someone could help me here :roll: but thats the way how to do it without C++ ;) Greetings Robert PS: As soon as it works perfect ill make a bigger tutorial - but i think im not getting it without c++ :roll:
  9. Hi Guys, sorry for the amount of posts here but i have a problem with my solution - now i try it directly with the grid functions of t3d ;) please be patient - it takes a little bit ^^ have a nice day! Robert
  10. Hi there, i just want to say that i will take a while till my tut is ready because i have Problems to reproduce it with several versions of t3d ... but im working on the problem ;) greetings and nice sunday! Robert
  11. hi, thanks for your answer but i need the editor without any window ... please tell me how you do it ;) thanks! greetz Robert
  12. Hi Guys, to make the thing simple - i need to make fullscreen mode in terraineditor. it would be great if you can answer :) greetings Robert
  13. yes this should do it ;) but it only works in the terraineditor :/ maybe someone could help me ... would be very nice 8) greetings Robert
  14. Hi there, here an working example of my solution: https://www.youtube.com/watch?v=-SSio2tMuDA tutorial will follow ;) greetz robert PS: Can someone Tell me how i make editor commands in play mode? thx!
  15. Hi, yes i would do a little tutorial but first i have to modify it a little bit ;) greetz Robert
  16. Hello Friends, this is the last Post of getting the stuff to work - this is my solution to view: https://youtu.be/mFWtS1sQfnE If you need help - just ask ;) Greetz Robert
  17. hi, sorry but i have a little problem with this solution... its only working with the active TerrainEditor ... :/ please help me ... thanks and stay tuned! Robert
  18. Hello there, okay - its almost perfect - just have to move the brush position - but its working: //Set the Brush size here - not necessary ETerrainEditor.setBrushSize(30, 30); //Read the index from a specific material - in this case the material with name "sand" %matIndex = ETerrainEditor.getMaterialIndex( "sand" ); //Here set the paint material and paint it - "test" is in this case the name of your terrain ETerrainEditor.setPaintMaterial(%matIndex, "test" ); ETerrainEditor.processAction("paintMaterial"); i hope i could help you 8-) the only thing to do is the brush position .... but thats all you need - you dont have to make anything with c++ ;) so thanks a lot! Greetings Robert
  19. Hey, here a cool thing - this is the solution: void TerrainEditor::processAction(const char* sAction) { if(!checkTerrainBlock(this, "processAction")) return; TerrainAction * action = mCurrentAction; if (dStrcmp(sAction, "") != 0) { action = lookupAction(sAction); if(!action) { Con::errorf(ConsoleLogEntry::General, "TerrainEditor::cProcessAction: invalid action name '%s'.", sAction); return; } } if(!getCurrentSel()->size() && !mProcessUsesBrush) return; mUndoSel = new Selection; Gui3DMouseEvent event; if(mProcessUsesBrush) action->process(mMouseBrush, event, true, TerrainAction::Process); else action->process(getCurrentSel(), event, true, TerrainAction::Process); // check if should delete the undo if(mUndoSel->size()) submitUndo( mUndoSel ); else delete mUndoSel; mUndoSel = 0; } this code makes all you need! and call it from torque script like this: ETerrainEditor.processAction("paintMaterial"); but it needs some specific things i didnt know at the moment but it has to do like this! So stay tuned and good luck!!! Greetings Robert
  20. Hi again, okay it seems to do the job - but i have a littl Problem. "SuperType": Ist kein Element von "Gui3DMouseEvent" what does this mean? Thank you very much! Greetings Robert
  21. Hi Guys, after working endless i found the key function... how to change material on a specific Position - but im not ready now with it ... void TerrainEditor::on3DMouseDown(const Gui3DMouseEvent & event) { getRoot()->showCursor( false ); if(mTerrainBlocks.size() == 0) return; if (!dStrcmp(getCurrentAction(),"paintMaterial")) { Point3F pos; TerrainBlock* hitTerrain = collide(event, pos); if(!hitTerrain) return; // Set the active terrain bool changed = mActiveTerrain != hitTerrain; mActiveTerrain = hitTerrain; if (changed) { Con::executef(this, "onActiveTerrainChange", Con::getIntArg(hitTerrain->getId())); mMouseBrush->setTerrain(mActiveTerrain); //if(mRenderBrush) //mCursorVisible = false; mMousePos = pos; mMouseBrush->setPosition(mMousePos); return; } } else if ((event.modifier & SI_ALT) && !dStrcmp(getCurrentAction(),"setHeight")) { // Set value to terrain height at mouse position GridInfo info; getGridInfo(mMouseBrush->getGridPoint(), info); mSetHeightVal = info.mHeight; mBrushChanged = true; return; } mMousePlane.set( mMousePos, Point3F(0,0,1) ); mMouseDown = true; mSelectionLocked = false; mouseLock(); mMouseDownSeq++; mUndoSel = new Selection; mCurrentAction->process(mMouseBrush, event, true, TerrainAction::Begin); // process on ticks - every 30th of a second. Sim::postEvent(this, new TerrainProcessActionEvent(mMouseDownSeq), Sim::getCurrentTime() + 30); } now i just have to get it running :) if you can help me please answer 8) Greetings Robert
  22. hi there, here a little video of my try on changing groundcover with torque 3d: https://www.youtube.com/watch?v=obYls7lnc-8 its not finished - just an idea from me. what i need is to set the player to the position of the brush :) thanks a lot! greetings Robert PS: im not klicking anything - it shows the material automatically by code - im just moving around with the view ;)
  23. Hello, i have a plan now - i let you know if its ready ;) greetz Robert
  24. Hi, omg - what shall i do now? sorry for penetrating you but i am at the end of my knowledge :? please help! greetings Robert
  25. Hello Friends, okay now i found something useful http://abighole.hngamers.com/terrainDeformer.zip i hope i get it with this one ;) greetz Robert :D
×
×
  • Create New...