The builder will show highlight for structure but not build.
Moderator: Moderators
- The_Igishly_Co
- Posts: 34
- Joined: 10 Oct 2013, 01:56
The builder will show highlight for structure but not build.
My basic builder unit (CUBL) a moving builder of structures will not construct structures that are programmed into the game. It will show the blueprint but not actually begin construction.
- Attachments
-
- buildervehicle(script).lua
- The script... For you
- (1.49 KiB) Downloaded 7 times
-
- buildervehicle.lua
- NOTE: I used the same script with a different model and it worked fine
- (1010 Bytes) Downloaded 20 times
Last edited by The_Igishly_Co on 18 Oct 2013, 15:51, edited 2 times in total.
Re: Builder not buildin' unites mate... Halp meh
We cannot always spoon feed you, what will happen when you get to the actual hard part?
Your post is not cute, or funny, it is insultingly lazy. Please make a real post detailing what part is failing.
Here is an example for the future:
"my build is not building a unit, it has a build tree, the unit is with in it, but it doesn't build the unit when I click the button" This at least tells us that your builder is an immobile builder which would give us an idea of what could be a potential issue.
what did you put in the script?
"here is my script: LINK TO YOUR SCRIPT ON PASTEBIN"
If you want help, make the effort to post a real thread, there is barely a post here. You essentially said "my stuff is broke, why"
Your post is not cute, or funny, it is insultingly lazy. Please make a real post detailing what part is failing.
Here is an example for the future:
"my build is not building a unit, it has a build tree, the unit is with in it, but it doesn't build the unit when I click the button" This at least tells us that your builder is an immobile builder which would give us an idea of what could be a potential issue.
what did you put in the script?
"here is my script: LINK TO YOUR SCRIPT ON PASTEBIN"
If you want help, make the effort to post a real thread, there is barely a post here. You essentially said "my stuff is broke, why"
- The_Igishly_Co
- Posts: 34
- Joined: 10 Oct 2013, 01:56
Re: Builder not buildin' unites mate... Halp meh
You are correct, I most humbly apologise for my crude and unacceptable post, I was in a hurry and needed to try to get some kind of answer before I left for school, and because it was via mobile I had no access to my files, however I will make an edit to this post with more detailed explanations into my issue
With sincerest apologies: The Igishly Company
With sincerest apologies: The Igishly Company
Re: The builder will show highlight for structure but not bu
First guess is, does your model have a piece called "nano"?
(Assuming you use SpringTutorialGame) The builderscript will try to emit a nanoparticle-builder-blablub effect from this piece. If such does piece does not exist errors should appear in chat console whenenver the unit tries to build.
So either add a piece with such name to the model or adjust the script.
http://springrts.com/wiki/Infolog.txt
(Assuming you use SpringTutorialGame) The builderscript will try to emit a nanoparticle-builder-blablub effect from this piece. If such does piece does not exist errors should appear in chat console whenenver the unit tries to build.
So either add a piece with such name to the model or adjust the script.
http://springrts.com/wiki/Infolog.txt
Re: The builder will show highlight for structure but not bu
Do you have a unit script for that builder? The file in the first post is only unitdef, no script in there. Such a unit will be able to move around, but won't be able to attack or build, those need a script with proper callins implemented.
I'm talking about that line:
script = "buildervehicle.lua"
I'm talking about that line:
script = "buildervehicle.lua"
Re: The builder will show highlight for structure but not bu
well first, this is a unit DEFinition file. The script dictates behaviors like where the nanopieces spray from. When you say that "it will show the blueprint" are you saying the picture shows in the menu or that it has a little wireframe sitting there indefinitely?The_Igishly_Co wrote:My basic builder unit (CUBL) a moving builder of structures will not construct structures that are programmed into the game. It will show the blueprint but not actually begin construction.
- The_Igishly_Co
- Posts: 34
- Joined: 10 Oct 2013, 01:56
Re: The builder will show highlight for structure but not bu
It's the wireframesmoth wrote:well first, this is a unit DEFinition file. The script dictates behaviors like where the nanopieces spray from. When you say that "it will show the blueprint" are you saying the picture shows in the menu or that it has a little wireframe sitting there indefinitely?The_Igishly_Co wrote:My basic builder unit (CUBL) a moving builder of structures will not construct structures that are programmed into the game. It will show the blueprint but not actually begin construction.
Re: The builder will show highlight for structure but not bu
not enough money?
type
/cheat
/atm
to get more resources.
type
/cheat
/atm
to get more resources.
- Silentwings
- Posts: 3720
- Joined: 25 Oct 2008, 00:23
Re: The builder will show highlight for structure but not bu
or you could use the "/nocost" gadget; http://pastebin.com/j6HWayAz. Put that into a file called cmd_nocost.lua in /spring/luarules/gadgets and then after typingnot enough money?
/cheat
/nocost
ingame everything will build for no cost
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: The builder will show highlight for structure but not bu
This is far too vague.
We need the unitdef of the builder, the script of the builder, the unitdef of the unit being built, and the script of the unit being built and your infolog.txt
Most importantly is the script of the builder. Smoth was a bit harsh, but he was also right. We can't just divine what is going on in your game from a unitdef. That tells us basically nothing.
We need the unitdef of the builder, the script of the builder, the unitdef of the unit being built, and the script of the unit being built and your infolog.txt
Most importantly is the script of the builder. Smoth was a bit harsh, but he was also right. We can't just divine what is going on in your game from a unitdef. That tells us basically nothing.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: The builder will show highlight for structure but not bu
Code: Select all
buildCostMetal = 0,
buildCostEnergy = 0,
Re: The builder will show highlight for structure but not bu
I wasn't harsh. He edited his post, which originally was just a sentence about how his unit wasn't building.Forboding Angel wrote:Smoth was a bit harsh, but he was also right. We can't just divine what is going on in your game from a unitdef. That tells us basically nothing.
Re: The builder will show highlight for structure but not bu
Not an issue.Forboding Angel wrote:My guess is that this may be the issue. 20 bucks says that his unit he is trying to build has 0 costs associated and spring is choking on it (I haven't tested, but sounds legit).Code: Select all
buildCostMetal = 0, buildCostEnergy = 0,
It will most likely be the script.
Re: The builder will show highlight for structure but not bu
I have not done a lua based builder script so I did:
http://springrts.com/phpbb/search.php?k ... mit=Search
http://springrts.com/phpbb/viewtopic.ph ... E&start=20
Anyway, maybe try commenting out all of your animation code and just leaving set unit value stuff? Also Spring.Echos are SUPER HANDY... so for example:
http://springrts.com/phpbb/search.php?k ... mit=Search
http://springrts.com/phpbb/viewtopic.ph ... E&start=20
spiked was using activate and deactivate instead of stop building/start building. I am not sure if it is relevant..SpikedHelmet wrote:or y'know just use lua
Code: Select all
--piece defines local hull, pad, beam = piece ("hull", "pad", "beam") function script.Activate() SetUnitValue(COB.YARD_OPEN, 1) SetUnitValue(COB.INBUILDSTANCE, 1) SetUnitValue(COB.BUGGER_OFF, 1) return 1 end function script.Deactivate() SetUnitValue(COB.YARD_OPEN, 0) SetUnitValue(COB.INBUILDSTANCE, 0) SetUnitValue(COB.BUGGER_OFF, 0) return 0 end function QueryBuildInfo() return pad end function QueryNanopiece() return beam end function script.Killed(recentDamage, maxHealth) --boom end
Anyway, maybe try commenting out all of your animation code and just leaving set unit value stuff? Also Spring.Echos are SUPER HANDY... so for example:
Code: Select all
function script.StopBuilding()
Spring.Echo("stop building call")
--Turn (crane1, y_axis, 0, math.rad(100))
--StopSpin (nano, z_axis)
--Turn (nano, z_axis, 0, math.rad(200))
--moveCrane (0)
SetUnitValue(COB.INBUILDSTANCE, 0)
end
function script.StartBuilding(heading, pitch)
Spring.Echo("start building call")
--Turn (crane1, y_axis, heading+math.rad(180), math.rad(100))
--moveCrane (75)
--waitForCrane ()
--Spin (nano, z_axis, math.rad (200))
SetUnitValue(COB.INBUILDSTANCE, 1)
end
function script.QueryNanoPiece()
Spring.Echo(nano, "nanopiece")
return nano
end
Re: The builder will show highlight for structure but not bu
The most common cause is not setting the build stance in the unit script (which indicates to the engine that the builder is done unfolding and can now spray nano).
- The_Igishly_Co
- Posts: 34
- Joined: 10 Oct 2013, 01:56
Re: The builder will show highlight for structure but not bu
Okay... ALL of the pieces in the script are not in my model, because I was using Knorkes Spring Tutorial game as a base... So... How would I code a model to build without using an animation? Maybe some particle effects
Re: The builder will show highlight for structure but not bu
re-read my post. Start there.
- FireStorm_
- Posts: 666
- Joined: 19 Aug 2009, 16:09
Re: The builder will show highlight for structure but not bu
If I remember correctly, I think that is "impossible." (But because of semantics.) I usually call everything in a unit-script part of the animation.The_Igishly_Co wrote:How would I code a unit-script to build without using an animation? Maybe some particle effects

One could say Spring's history starts with OTA (the original Total Annihilation) As I suspect you know, in OTA stuff is build with a nano-spray from some nozzle.
So you could say that when Spring was developed, they didn't really imagine any other way of building. You could say it is the standard, or build-in-way, to show units building stuff.
In the end you can make building stuff look like whatever you want, but in the beginning nano-spray is how Spring kinda assumes you will do it. "Oh, you made a builder? Then I'm sure you can tell me where your nozzle is, can't you?"
You can and did. Info like that goes in the unit script:
Code: Select all
local nano = piece "nano"
Code: Select all
function script.QueryNanoPiece()
return nano
end
Whether the spray is visible or not, is defined in the Unit definitions file:
I hope that helps.springrts.com/wiki/Units-UnitDefs wrote: bool showNanoSpray Default: true
Does the builder emit OTA-style nanospray whilst constructing?
float[3] nanoColor Default: {0.2, 0.7, 0.2} aka green
The RGB colour of a builders' emitted nano particles if showNanoSpray = true. Also controls the RBG colour of a unit's own nanoframe if showNanoFrame = true.
(I assume knowledgeable Spring Elders will correct me if I made any mistakes

Re: The builder will show highlight for structure but not bu
https://github.com/spring/spring/blob/d ... g.txt#L391 :FireStorm_ wrote:You can and did. Info like that goes in the unit script:Code: Select all
local nano = piece "nano"
Code: Select all
function script.QueryNanoPiece() return nano end
! LUS/COB: deprecate QueryNanoPiece() makes SimCode ~10% faster use the new Spring.SetUnitNanoPieces instead
Note, once set the engine won't call `QueryNanoPiece` anymore and instead randomly toggles between the set nanopieces,
saving a lot time-consuming COB/LUS calls.
- The_Igishly_Co
- Posts: 34
- Joined: 10 Oct 2013, 01:56
Re: The builder will show highlight for structure but not bu
... I feel stupid...
After all this time... I just needed to rename a piece of the model: Nano... Thank you for your help, now... BACK TO MY GAME!
After all this time... I just needed to rename a piece of the model: Nano... Thank you for your help, now... BACK TO MY GAME!