Suggestion for Lua widget - Ghost timer.

Suggestion for Lua widget - Ghost timer.

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

Moderator: Moderators

Post Reply
User avatar
Pendrokar
Posts: 658
Joined: 30 May 2007, 10:45

Suggestion for Lua widget - Ghost timer.

Post by Pendrokar »

It would be usefull to know how old the info of the base ghost units are!
A small timer that starts as the ghost unit is created and the timer stays with it.
Maybe refresh after 5 secs!

PS. This widget should automatically disable if ghost units is off!!
User avatar
Pendrokar
Posts: 658
Joined: 30 May 2007, 10:45

Post by Pendrokar »

Neutrality in the air!!
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

This would be a great widget
User avatar
Lindir The Green
Posts: 815
Joined: 04 May 2005, 15:09

Post by Lindir The Green »

+1
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Post by Kloot »

Here's one: http://spring.unknown-files.net/file/32 ... Timer.lua/

Note that the Game table does not contain an entry indicating whether ghosted buildings are enabled, so you'll have to manage the deactivation part yourself. ;)
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post by Snipawolf »

What is ghosting...?

I never noticed it before, but I have seen the checkbox thingy..
User avatar
Pendrokar
Posts: 658
Joined: 30 May 2007, 10:45

Post by Pendrokar »

Gj on that. Although sad that it only shows seconds not minutes when passed 60 secs and so on. What I mean : 54s - later - 1.1 min. - much much later - 1 .43 h.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Post by Kloot »

A new version is up which does show time in h:m:s format: http://spring.unknown-files.net/file/32 ... er-v2.lua/
User avatar
Neddie
Community Lead
Posts: 9406
Joined: 10 Apr 2006, 05:05

Post by Neddie »

Kloot, I may steal one of AF's cookies for you.
ZellSF
Posts: 1187
Joined: 08 Jul 2006, 19:07

Post by ZellSF »

delete this
Last edited by ZellSF on 27 Jul 2007, 03:07, edited 2 times in total.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

*AF goes into a nosedive, reaches into hsi backpack, and pulls out very large jar of napalm, drops the jar and rises upwards to see neddia burning*

Cookie mine I tell you! MINE!
User avatar
Pendrokar
Posts: 658
Joined: 30 May 2007, 10:45

Post by Pendrokar »

Kloot wrote:A new version is up which does show time in h:m:s format: http://spring.unknown-files.net/file/32 ... er-v2.lua/
Good, but I tried to place 100 solars and gave em to the enemy bot and flew over with a scout and the timers are not sync with game time or real time you can see this when changing gamespeed!(There is no real need em to refresh every second every fifth second would be enough)
+ I think timers which are set on buildings with ghost units which are seen in radar are destroyed timer should disappear!
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Post by Kloot »

http://spring.unknown-files.net/file/33 ... er-v3.lua/ ;)

Syncs the timers and updates them only every 5 secs, etc.
User avatar
Linebacker
Posts: 128
Joined: 25 Jul 2007, 21:30

Post by Linebacker »

Downloaded.
User avatar
Pendrokar
Posts: 658
Joined: 30 May 2007, 10:45

Post by Pendrokar »

It shows up on ghosts even in replay too!! That is not needed and it even doesn"t count time too, cause spectator sees it!
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Post by Kloot »

Open it in a text editor and change line 114 from

Code: Select all

if (ghost[4]) then
to

Code: Select all

if (ghost[4] and ghost[2] > 0) then
And there's no need to shout.
User avatar
Pendrokar
Posts: 658
Joined: 30 May 2007, 10:45

Post by Pendrokar »

Gotch ya! :wink:
Post Reply

Return to “Lua Scripts”