Height Detection in Spring - Page 2

Height Detection in Spring

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

User avatar
ILMTitan
Spring Developer
Posts: 410
Joined: 13 Nov 2004, 08:35

Post by ILMTitan »

Scheme, a Lisp dialect, is my favorite language to program in. I have only used it in a class though, so I've never had to use it for something more real. It saddens me that parenthesis scare you.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Image
Boogalizer
Posts: 6
Joined: 20 Apr 2007, 06:38

Post by Boogalizer »

Alright so maybe height detection is bad form, and there is easier/better ways to do it in spring... but for the first version of Devolution in spring i don't mind if the scripts aren't super clean. I want to attempt just to bring what I did in TA into Spring, and apparently to do that I need to remeasure heights. I tried throwing zwzsg's caliper into my mod to do that, but I quickly realized that it needs the custom number textures included in the caliper.ufo file. How do I add textures from a gaf file into spring?
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

You have to convert them to a format spring can read, i.e. bmp, tga, png etc. Alpha channel is the team color mask IIRC.

Take a look at .\Spring\base\tatextures_v062.sdz (it's a zip file).

Animated GAFs aren't supported at all, so you'd have to clone geometry and use show/hide for animation.
User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Post by Dragon45 »

tombom wrote:
imbaczek wrote:...and more like lisp :P
lisp is the second best language in the world after perl

i've never made anything in lisp
what the heck is up with you and declarative programming languages
User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

Post by SinbadEV »

Man, I'm sure there's a way to spit out a unit's height to LUA or something... in s3o format you specify the unit's height so it's a non-issue in there... hmmmm

I'm not very LUA savy but there should be like a:

UnitDefs[216]["height"] property that could be read by a script... and script something simple like:

Code: Select all

local color  = { 1.0, 1.0, 1.0 }
local theheight = "None Selected"

function UnitSelected(unitID, unitDefID, teamID)
       gl.Color(color)
       theheight = ("UnitCreated: id=" .. unitID .. " Name: " UnitDefs[unitID]["model"]["name"]" .. " Height: " UnitDefs[unitID]["height"])
       gl.Text(theheight, 500, 500, size, format)

end
Excepts the whole LUA interface is documented in such a way that I am completely baffled by it so what I have suggested is comletely wrong... maybe someone like trepan can fix it.
User avatar
Nemo
Spring 1944 Developer
Posts: 1376
Joined: 30 Jan 2005, 19:44

Post by Nemo »

http://spring.clan-sy.com/phpbb/viewtopic.php?t=9934 a simple way to find unit heights ingame. in pure BOS.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

I'd like to mention get PRINT(a,b,c,d). Outputs those four values to the console. Put get PRINT(get UNIT_HEIGHT(get MY_ID)); into your unit's script and it'll output its height to the console.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Post by FLOZi »

Height detection works fine. And as KDR pointed out, get PRINT can provide you with a simple means of reading values from BOS. Tis why I made it. :-)
User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

Post by SinbadEV »

Where are console messages sent when there is no console?
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

To the logfile.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Post by FLOZi »

N.B. KDR meant Spring chat.
Post Reply

Return to “Engine”