printing piece hierachy of a unit

printing piece hierachy of a unit

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

printing piece hierachy of a unit

Post by knorke »

A widget to create an ascii view from the piece hierachy of a unit/model.
I used to make notes by hand as as not to forgett the names of pieces. Now its automagic :shock:

/give simplewalker

Code: Select all

  *** pieces tree of simplewalker ***
base
 -body
 --hip_left
 ---leg_left
 ----foot_left
 --hip_right
 ---leg_right
 ----foot_right
/give simpleattackvehicle

Code: Select all

 *** pieces tree of simpleattackvehicle ***
 base
 -body
 -turret
 --barrel
 ---flare
 -wheel1
 -wheel2
 -wheel3
 -wheel4
and a long one

Just read it in console or copy it from infolog to keep it as reference.
It prints such thing on every UnitCreated but only when /cheat is enabled. (as not to spam all the time)

/edit
sex change from gadget to widget
Attachments
debug_UnitPieceList.lua
goes in luaui\widgets\
(1.52 KiB) Downloaded 151 times
Last edited by knorke on 17 Apr 2011, 23:29, edited 1 time in total.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: printing piece hierachy of a unit

Post by jK »

why is it a gadget?
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: printing piece hierachy of a unit

Post by knorke »

Spring.GetUnitPieceInfo not on http://springrts.com/wiki/Lua_UnsyncedRead
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: printing piece hierachy of a unit

Post by jK »

User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: printing piece hierachy of a unit

Post by knorke »

search&replace in progress.
didnt really understand that page before. Now maybe just did.
The Lua_SyncedRead / LuaUI field is yellow and says "with special LOS handling and decoy unit handling"
so everything from syncedread pageworks in unsynced too, just that you can only get your own units (+those in los) and that the unitIDs are "faked" to prevent cheating?
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: printing piece hierachy of a unit

Post by Beherith »

drill_named_zeroed.3ds
-base
--baseplate
Use 'swap' in upspring to get rid of empty 3ds import base pieces.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: printing piece hierachy of a unit

Post by knorke »

yes thanks but i figured that out already. (was an old model)
renaming that piece works too. for some things i find it usefull to have
empty base
-body
--stuff
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: printing piece hierachy of a unit

Post by Beherith »

Useful tool though :)
I'm so dumb I coded this in python a while ago :P
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: printing piece hierachy of a unit

Post by Forboding Angel »

Needs a conditional other than cheat being on.

I use cheat and give all the time and would prefer to be able to add this to evo so I have it available when I need it but not print all the pieces and stuff out everytimes I do a /give
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: printing piece hierachy of a unit

Post by knorke »

forb, its a widget now meaning you can just toggle it in F11 list.
i wouldnt put it in evo but in luaui\widgets of your engine install as not to confuse players with it.
Post Reply

Return to “Lua Scripts”