subabrain Posted November 7, 2016 Share Posted November 7, 2016 Hello Friends,i have a simple but stupid question:is it possible to change the groundcover at realtime per script?Would be nice for your answers.GreetingsRobert Quote Link to comment Share on other sites More sharing options...
JeffR Posted November 11, 2016 Share Posted November 11, 2016 Depends on what you want to change.You could change the various static fields, which should trigger network updates and propagate to the client(though you may see the grass dissapear and re-populate).Is there a particular thing you're trying to change/edit? Quote Link to comment Share on other sites More sharing options...
Duion Posted November 11, 2016 Share Posted November 11, 2016 You can try changing things in the editor while another player is connected, then you will see what gets networked and what not. Quote Link to comment Share on other sites More sharing options...
subabrain Posted November 11, 2016 Author Share Posted November 11, 2016 hello there,okay - i need it for an agriculture game to change the groundcover by passing a machine over...okay - i hope you understand 8)greetz robert Quote Link to comment Share on other sites More sharing options...
Duion Posted November 11, 2016 Share Posted November 11, 2016 This is not directly possible, since the groundcover is procedurally generated on a specific terrain material, but what you can do is changing the terrain material, this will also change or remove the groundcover on it, the problem with terrain is, it is not networked. Quote Link to comment Share on other sites More sharing options...
subabrain Posted November 11, 2016 Author Share Posted November 11, 2016 Hi and thanks for your answers!something like that i thought already - but how can i change the material by script?okay - i hope i dont disturb you but i dont have that much knowledge for do that...so have a nice time - and thanks for your answers :)Greetings Robert Quote Link to comment Share on other sites More sharing options...
Duion Posted November 12, 2016 Share Posted November 12, 2016 You could look up the terrain painter and see what it does when you click the mouse button. Quote Link to comment Share on other sites More sharing options...
subabrain Posted November 12, 2016 Author Share Posted November 12, 2016 Hi,okay - thanks a lot!ill try ;)greetingsRobert Quote Link to comment Share on other sites More sharing options...
subabrain Posted November 12, 2016 Author Share Posted November 12, 2016 YEAH - i found something nice - https://www.garagegames.com/community/forums/viewthread/132741- thanks for yoir answers anyway ;)greetzRobert Quote Link to comment Share on other sites More sharing options...
subabrain Posted November 19, 2016 Author Share Posted November 19, 2016 hi there,it was not the right thing i didnt get it running. so now the same problem again - any ideas?thank you very much!greetzRobert Quote Link to comment Share on other sites More sharing options...
JeffR Posted November 21, 2016 Share Posted November 21, 2016 Can you clarify the difficulty you had with getting it working? Changing the painting on the terrain SHOULD(the most dangerous of words, haha) have gotten it to locally update the distributed ground cover, so if it didn't, we can try and dial in on where it's going weird.Did you get the painting part to work? If so, is the ground cover not updating when you do it? Quote Link to comment Share on other sites More sharing options...
subabrain Posted December 6, 2016 Author Share Posted December 6, 2016 Hi,sorry for the delay!but the problem is, that i dont have that much knowledge to change it with c++.So i need to make it with the standard torque script - but i dont know how to change the texture from the terrain at live time.So it would be nice if you could help me :)Thanks a lot and have a nice day!Greetings Robert Quote Link to comment Share on other sites More sharing options...
subabrain Posted February 25, 2017 Author Share Posted February 25, 2017 Hello Friends,i looked for a way to get this with the groundcover http://docs.garagegames.com/torque-3d/reference/classGroundCover.html class. But i dont know how to use it correctly or how i create the object - can you help me please?Thank you very much!greetingsRobert Quote Link to comment Share on other sites More sharing options...
subabrain Posted February 25, 2017 Author Share Posted February 25, 2017 hi,now i got it -> it should look like this: function set_grass() { new GroundCover() { Material = "grass3"; radius = "200"; dissolveRadius = "50"; reflectScale = "0.25"; gridSize = "7"; zOffset = "0"; seed = "1"; maxElements = "900000"; maxBillboardTiltAngle = "90"; shapeCullRadius = "75"; shapesCastShadows = "1"; billboardUVs[0] = "0 0 1 1"; billboardUVs[1] = "0 0 1 1"; billboardUVs[2] = "0 0 1 1"; billboardUVs[3] = "0 0 1 1"; billboardUVs[4] = "0 0 1 1"; billboardUVs[5] = "0 0 1 1"; billboardUVs[6] = "0 0 1 1"; billboardUVs[7] = "0 0 1 1"; shapeFilename[0] = "art/shapes/groundCover/Grass.dds"; invertLayer[0] = "0"; invertLayer[1] = "0"; invertLayer[2] = "0"; invertLayer[3] = "0"; invertLayer[4] = "0"; invertLayer[5] = "0"; invertLayer[6] = "0"; invertLayer[7] = "0"; probability[0] = "1"; probability[1] = "0"; probability[2] = "0"; probability[3] = "0"; probability[4] = "0"; probability[5] = "0"; probability[6] = "0"; probability[7] = "0"; sizeMin[0] = "0.1"; sizeMin[1] = "0.1"; sizeMin[2] = "1"; sizeMin[3] = "1"; sizeMin[4] = "1"; sizeMin[5] = "1"; sizeMin[6] = "1"; sizeMin[7] = "1"; sizeMax[0] = "0.5"; sizeMax[1] = "0.5"; sizeMax[2] = "1"; sizeMax[3] = "1"; sizeMax[4] = "1"; sizeMax[5] = "1"; sizeMax[6] = "1"; sizeMax[7] = "1"; sizeExponent[0] = "1"; sizeExponent[1] = "1"; sizeExponent[2] = "1"; sizeExponent[3] = "1"; sizeExponent[4] = "1"; sizeExponent[5] = "1"; sizeExponent[6] = "1"; sizeExponent[7] = "1"; windScale[0] = "1"; windScale[1] = "1"; windScale[2] = "1"; windScale[3] = "1"; windScale[4] = "1"; windScale[5] = "1"; windScale[6] = "1"; windScale[7] = "1"; maxSlope[0] = "0"; maxSlope[1] = "0"; maxSlope[2] = "0"; maxSlope[3] = "0"; maxSlope[4] = "0"; maxSlope[5] = "0"; maxSlope[6] = "0"; maxSlope[7] = "0"; minElevation[0] = "-99999"; minElevation[1] = "-99999"; minElevation[2] = "-99999"; minElevation[3] = "-99999"; minElevation[4] = "-99999"; minElevation[5] = "-99999"; minElevation[6] = "-99999"; minElevation[7] = "-99999"; maxElevation[0] = "99999"; maxElevation[1] = "99999"; maxElevation[2] = "99999"; maxElevation[3] = "99999"; maxElevation[4] = "99999"; maxElevation[5] = "99999"; maxElevation[6] = "99999"; maxElevation[7] = "99999"; minClumpCount[0] = "1"; minClumpCount[1] = "1"; minClumpCount[2] = "1"; minClumpCount[3] = "1"; minClumpCount[4] = "1"; minClumpCount[5] = "1"; minClumpCount[6] = "1"; minClumpCount[7] = "1"; maxClumpCount[0] = "1"; maxClumpCount[1] = "1"; maxClumpCount[2] = "1"; maxClumpCount[3] = "1"; maxClumpCount[4] = "1"; maxClumpCount[5] = "1"; maxClumpCount[6] = "1"; maxClumpCount[7] = "1"; clumpExponent[0] = "1"; clumpExponent[1] = "1"; clumpExponent[2] = "1"; clumpExponent[3] = "1"; clumpExponent[4] = "1"; clumpExponent[5] = "1"; clumpExponent[6] = "1"; clumpExponent[7] = "1"; clumpRadius[0] = "1"; clumpRadius[1] = "1"; clumpRadius[2] = "1"; clumpRadius[3] = "1"; clumpRadius[4] = "1"; clumpRadius[5] = "1"; clumpRadius[6] = "1"; clumpRadius[7] = "1"; windDirection = "1 0"; windGustLength = "20"; windGustFrequency = "0.5"; windGustStrength = "0.5"; windTurbulenceFrequency = "1.2"; windTurbulenceStrength = "0.125"; lockFrustum = "0"; renderCells = "0"; noBillboards = "0"; noShapes = "0"; position = "354.572 -7.3566 465.621"; rotation = "1 0 0 0"; scale = "1 1 1"; canSave = "1"; canSaveDynamicFields = "1"; }; } if now the function "set_grass" is called -> your groundcover will change 8-) i will experiment now a bit :)greetzRobert Quote Link to comment Share on other sites More sharing options...
subabrain Posted February 26, 2017 Author Share Posted February 26, 2017 Sorry - it was the right thing but its useless for my game :/i need to change the terrain material at lifetime on a certain position ...so i found this: http://torque-3d.readthedocs.io/en/latest/script/class/TerrainMaterial.htmlbut i dont know how i can use it with positions?Thank you for answers ;)GreetingsRobert Quote Link to comment Share on other sites More sharing options...
subabrain Posted June 19, 2017 Author Share Posted June 19, 2017 hey there,sorry for awake this thread - but its important for me ...how can i use the "position" Member of GroundCover Object?is there any way to do it with a workaround? If not ill try with areas ..okay - would be nice if you know something about :)Thanks a lot!GreetingsRobert Quote Link to comment Share on other sites More sharing options...
subabrain Posted June 19, 2017 Author Share Posted June 19, 2017 hi,okay - i will do it with the layer property from the groundcover ;)greetzRobert Quote Link to comment Share on other sites More sharing options...
subabrain Posted June 22, 2017 Author Share Posted June 22, 2017 Hi again,okay - i have a plan now how to do it.1. ill create triggers in the torque 3d world editor as big as the groundmaterials should be (first problem i need over 1000 trigger points).2. then i add a groundtexture via terrain painter tool in each trigger square (second problem i need over 1000 terrainmaterials).3. ill give them the layer 0 with full height groundcover.4. now if i enter the trigger the layer 0 there will be another groundmaterial and so another groundcover.okay - ill tested this - its working.maybe you can give me some tips how it will be better? :roll: okay - thanks alot!GreetingsRobert Quote Link to comment Share on other sites More sharing options...
subabrain Posted June 24, 2017 Author Share Posted June 24, 2017 hi,okay - i have an other plan now.Im trying to get the function, which is there for control the paint action from the terrain painter.But i tried almost all functions and i dont know how the function is :(Please help a last time :)GreetingsRobertPS: hopefully the error of your forum is not good for hackers... Quote Link to comment Share on other sites More sharing options...
subabrain Posted June 26, 2017 Author Share Posted June 26, 2017 hey guys,i find out something good...thats how you an set the brush (for painting etc.): ETerrainEditor.setBrushPos(getWord(%curPos, 0) + %x, getWord(%curPos, 1) + %y); and get the brush: %curPos = ETerrainEditor.getBrushPos(); now i just need to "paint" on the brush position... - maybe you can help me?Thank you very much!GreetzRobert Quote Link to comment Share on other sites More sharing options...
subabrain Posted July 2, 2017 Author Share Posted July 2, 2017 hi there,sorry i cant get it :(please help me i just need the command to create a material like the terrain painter.i dont get further ... its really important for me.greetingsRobert Quote Link to comment Share on other sites More sharing options...
JeffR Posted July 10, 2017 Share Posted July 10, 2017 Whoops, sorry! Somehow had missed this.Ok, so just to clarify, you're trying to set the terrain texture on a spot on the terrain at runtime in the game - like, say if you built a house, and it'd put a dirt texture on the terrain so the grass wouldn't render where the house is.Is that a correct breakdown of what you're trying to do? Quote Link to comment Share on other sites More sharing options...
subabrain Posted July 10, 2017 Author Share Posted July 10, 2017 Hello,im very happy to see that someone has answered. THX!So i just want to make the same like the terrain painter but from the script. I had an idea - set very much triggers and give them an groundlayer :(but it is not realizable ..i need the command to "paint" the terrain texture from the brush from "terrain painter" somewhere in the map ...okay i hope someone could help me :)Thanks alot!GreetingsRobert Quote Link to comment Share on other sites More sharing options...
Azaezel Posted July 10, 2017 Share Posted July 10, 2017 Bit tricky. If you only need it during a singleplayer session, you'll want to do something similar to https://github.com/GarageGames/Torque3D/blob/c83efa59e0a11fc15c68afaf106807643191ac6f/Templates/Full/game/core/scripts/server/centerPrint.cs#L47+https://github.com/GarageGames/Torque3D/blob/c83efa59e0a11fc15c68afaf106807643191ac6f/Templates/Full/game/core/scripts/client/centerPrint.cs#L32+ the painting command you found earlier.multiplayer, a naive approach would be keeping a log of all of those commands and run them for the connecting client as well. possibly using https://github.com/GarageGames/Torque3D/pull/959 (assumign it is still capable of being rolled in) to take a snapshot from before they began the loading process to cut down on how many additional updates a given terrain file would need to sync. Quote Link to comment Share on other sites More sharing options...
JeffR Posted July 10, 2017 Share Posted July 10, 2017 Also, how fast does this need to happen? Is it going to be a constant repainting of surfaces, like in Splatoon? Or will it be a less common event like my 'build a building' example?How often the event happen would determine how efficient we need to make it. If it's not a constant thing, then doing stuff like the log of the changes in MP az mentioned and whatnot as opposed to a more elegant solution is fine. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.