Page 1 of 2
The builder will show highlight for structure but not build.
Posted: 16 Oct 2013, 01:01
by The_Igishly_Co
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: Builder not buildin' unites mate... Halp meh
Posted: 16 Oct 2013, 01:11
by smoth
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"
Re: Builder not buildin' unites mate... Halp meh
Posted: 16 Oct 2013, 05:42
by The_Igishly_Co
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
Re: The builder will show highlight for structure but not bu
Posted: 16 Oct 2013, 06:37
by knorke
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
Re: The builder will show highlight for structure but not bu
Posted: 16 Oct 2013, 11:25
by yuritch
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"
Re: The builder will show highlight for structure but not bu
Posted: 16 Oct 2013, 22:38
by smoth
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.
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?
Re: The builder will show highlight for structure but not bu
Posted: 16 Oct 2013, 22:50
by The_Igishly_Co
smoth wrote: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.
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?
It's the wireframe
Re: The builder will show highlight for structure but not bu
Posted: 16 Oct 2013, 22:58
by knorke
not enough money?
type
/cheat
/atm
to get more resources.
Re: The builder will show highlight for structure but not bu
Posted: 16 Oct 2013, 23:44
by Silentwings
not enough money?
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 typing
/cheat
/nocost
ingame everything will build for no cost
Re: The builder will show highlight for structure but not bu
Posted: 18 Oct 2013, 01:34
by Forboding Angel
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.
Re: The builder will show highlight for structure but not bu
Posted: 18 Oct 2013, 01:36
by Forboding Angel
Code: Select all
buildCostMetal = 0,
buildCostEnergy = 0,
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).
Re: The builder will show highlight for structure but not bu
Posted: 18 Oct 2013, 02:19
by smoth
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.
I wasn't harsh. He edited his post, which originally was just a sentence about how his unit wasn't building.
Re: The builder will show highlight for structure but not bu
Posted: 18 Oct 2013, 18:03
by FLOZi
Forboding Angel wrote:Code: Select all
buildCostMetal = 0,
buildCostEnergy = 0,
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).
Not an issue.
It will most likely be the script.
Re: The builder will show highlight for structure but not bu
Posted: 18 Oct 2013, 18:14
by smoth
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
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
spiked was using activate and deactivate instead of stop building/start building. I am not sure if it is relevant..
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
Posted: 18 Oct 2013, 22:52
by KDR_11k
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).
Re: The builder will show highlight for structure but not bu
Posted: 19 Oct 2013, 01:47
by The_Igishly_Co
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
Posted: 19 Oct 2013, 01:52
by smoth
re-read my post. Start there.
Re: The builder will show highlight for structure but not bu
Posted: 19 Oct 2013, 10:59
by FireStorm_
The_Igishly_Co wrote:How would I code a unit-script to build without using an animation? Maybe some particle effects
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.
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
function script.QueryNanoPiece()
return nano
end
So even if you don't want any visible spray, but i.e. some medieval orc with a wrench or something, Spring still asks you where the nozzle is, because of its history.
Whether the spray is visible or not, is defined in the
Unit definitions file:
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 hope that helps.
(I assume knowledgeable Spring Elders will correct me if I made any mistakes

)
Re: The builder will show highlight for structure but not bu
Posted: 19 Oct 2013, 17:20
by jK
FireStorm_ wrote:You can and did. Info like that goes in the unit script:
Code: Select all
function script.QueryNanoPiece()
return nano
end
https://github.com/spring/spring/blob/d ... g.txt#L391 :
! 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.
Re: The builder will show highlight for structure but not bu
Posted: 13 Nov 2013, 06:28
by The_Igishly_Co
... 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!