Cubescript and menu |
by RPG
on 02/09/2011 21:55, 12 messages, last message: 02/14/2011 20:01, 1201 views, last view: 04/18/2024 19:07 |
|
I noticed, that script, that draws menu items is called every frame. Is it necessary? Why script is called so often?
So I think I know why I have 30 frames per second in menu and 100-200 in game.
Screen:
http://ompldr.org/vN2N6Zg
|
|
Board Index
|
|
#1: .. |
by RPG
on 02/09/2011 22:09
|
|
tst = []
tst = [tst echo 1]
tst = [tst echo 2]
tst
=> segfault:)
How to create pre-defined list of commands?
For ex:
tst = []
addcmd tst [echo 1]
addcmd tst [echo 2]
tst
as result:
1
2
This may improve performance.
reply to this message
|
|
#2: .. |
by Razgriz
on 02/09/2011 22:24
|
|
addcmd = [$arg1 = (concat (getalias $arg1) ";" $arg2)]
also: cubescript is probably in no way similar to cpp or any other language out there. don't try to base your previous experiences for a better understanding of cubescript, it may prove harder ;)
reply to this message
|
|
#3: .. |
by RPG
on 02/09/2011 23:07
|
|
Thanks!
reply to this message
|
|
#4: .. |
by Razgriz
on 02/09/2011 23:24
|
|
And yea, its true that gui items are constantly being drawn and called, but this is what allows for the items to be dynamic in it. I do agree that in cases, this is useless though.
I bet many more experience this GUI lag, and i certainly did with my fps dropping to 30 from a least of 500 every time i opened the servers menu. But in the svn i can gladly say that the cubescript is way lighter and faster since it was almost completely rebuilt, if that is correct as a term. Now the heaviest of GUI elements and loops don't bog me down at all :)
reply to this message
|
|
#5: Re: .. |
by srbs
on 02/10/2011 10:02, refers to #1
|
|
By the way, the segfault was because called tst recursively which resulted in an infinite loop.
And yes, dynamic GUIs are awesome.
reply to this message
|
|
#6: .. |
by Q009
on 02/10/2011 11:36
|
|
I totally agree with that.
reply to this message
|
|
#7: .. |
by RPG
on 02/10/2011 19:51
|
|
Okay, waiting for the next release.
reply to this message
|
|
#8: Re: .. |
by Razgriz
on 02/10/2011 22:51, refers to #7
|
|
that could take well over 2 years, by estimation. you're better off downloading the svn from
https://sauerbraten.svn.sourceforge.net/svnroot/sauerbraten
with an SVN client, like TortoiseSVN, or SmartSVN which you can get the trial for 30 days and still use its basic features afterwards.
reply to this message
|
|
#9: .. |
by RPG
on 02/11/2011 00:21
|
|
Hm... Maybe you right. But I see that releases were quite often last time.
reply to this message
|
|
#10: Re: .. |
by Razgriz
on 02/11/2011 12:49, refers to #9
|
|
But the more awesome stuff added in the svn, the less you can wait for a release :P
reply to this message
|
|
#11: .. |
by RPG
on 02/14/2011 18:15
|
|
How to sort items in list alphabetically?
list = "beta alpha"
list = sort $list
=> "alpha beta"
Maybe someone wrote sorting function:)
reply to this message
|
|
#12: Re: .. |
by Razgriz
on 02/14/2011 20:01, refers to #11
|
|
there is no sorting command as far as i know, and making one in cubescript is not really efficient..
reply to this message
|
|
|
Board Index
|
|