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 » 17 Apr 2011, 23:08

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 147 times
Last edited by knorke on 17 Apr 2011, 23:29, edited 1 time in total.
0 x

User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: printing piece hierachy of a unit

Post by jK » 17 Apr 2011, 23:11

why is it a gadget?
0 x

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

Re: printing piece hierachy of a unit

Post by knorke » 17 Apr 2011, 23:13

Spring.GetUnitPieceInfo not on http://springrts.com/wiki/Lua_UnsyncedRead
0 x

User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: printing piece hierachy of a unit

Post by jK » 17 Apr 2011, 23:15

0 x

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

Re: printing piece hierachy of a unit

Post by knorke » 17 Apr 2011, 23:24

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?
0 x

User avatar
Beherith
Moderator
Posts: 4934
Joined: 26 Oct 2007, 16:21

Re: printing piece hierachy of a unit

Post by Beherith » 18 Apr 2011, 00:09

drill_named_zeroed.3ds
-base
--baseplate
Use 'swap' in upspring to get rid of empty 3ds import base pieces.
0 x

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

Re: printing piece hierachy of a unit

Post by knorke » 18 Apr 2011, 00:24

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
0 x

User avatar
Beherith
Moderator
Posts: 4934
Joined: 26 Oct 2007, 16:21

Re: printing piece hierachy of a unit

Post by Beherith » 18 Apr 2011, 00:35

Useful tool though :)
I'm so dumb I coded this in python a while ago :P
0 x

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14605
Joined: 17 Nov 2005, 02:43

Re: printing piece hierachy of a unit

Post by Forboding Angel » 18 Apr 2011, 02:15

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
0 x

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

Re: printing piece hierachy of a unit

Post by knorke » 18 Apr 2011, 14:56

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.
0 x

Post Reply

Return to “Lua Scripts”