Beta release 1.9.9b

Information and change log about the latest ZGameEditor release.

Moderator: Moderators

Post Reply
User avatar
y offs et
Posts: 418
Joined: Wed Apr 22, 2009 4:26 pm
Location: BC, Canada

Post by y offs et »

keypress <space> using CharCode 32 doesn't seem to work anymore.
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

y offs et wrote:keypress <space> using CharCode 32 doesn't seem to work anymore.
You are right, it was a bug. I just uploaded a new version that should fix this. Thanks for reporting.
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

I updated the YakYakReader-project to use the new string functionality. The code to parse the html-page becomes much cleaner and shorter:

Code: Select all

Color1.Color.B=0;
IsUpdating=0;

string topicmatch="topictitle";
string data=Web1.ResultString;
string display="";

int linkCount=0;
int end=0;
int i=0;
for( ;end!=1; )  {

  //Sample string that we are trying to parse:
  //<a href="./viewtopic.php?f=2&t=78879" class="topictitle">Question about English language?</a>
  //We want to extract the topictitle and the topicID (the number after "t=") so that we can create a url to it

  i=indexOf(topicmatch,data,i);
  if(i==-1) {
    end=1;
  } else {
    //Extract topic id
    int k=indexOf(";t=",data,i-25) + 3;
    int l=indexOf("\"",data,k);
    Links[linkCount]=strToInt( subStr(data,k,l-k) );
    linkCount++;
    if(linkCount==Links.SizeDim1)
      end=1;

    //Extract topic title
    k=indexOf("</a>",data,i);
    i+=length(topicmatch)+2;
    //Add topic title to displaystring
    display+=subStr(data,i,k-i) + "\n";
    i=k;
  }

}
Rtext1.Text=display;
And when a link is clicked then we can simply assign the Url-property directly without having to use arrays:

Code: Select all

int clicked=round( (1.0 - ((App.MousePosition.Y+1.0)/2.0)) * 9 );
Web2.Url="http://www.yakyak.org/viewtopic.php?f=2&t=" + intToStr(Links[clicked]);
Updated zgeproj file here.
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Beta updated today with more pieces of string support present. These updates will hopefully make things like highscore tables much easier to implement!

I've updated the first post, but here are the details for easy reference:

- char(charcode) function for creating a string based on a ansi-code
- while-loop support. "while(i<42) { i++; }".
- special characters in string literals to make strings containing double quotes and newline.
- DefineVariable and DefineArray now supports "string" type.

Note:
-- Persistent arrays of string-type are not supported
-- Don't make your string arrays larger than you need because even unused array-slots affect performance of the garbage collector
User avatar
Kjell
Posts: 1876
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

:)

Just downloaded the ( latest ) Beta with String support. Already a impressive list of String related functions 8)

First bug I ran into is that when you assign the result of strToInt() to a DefineVariable ( integer ), the editor throws a exception ( access violation ) as soon as you click on the Component. Even when first assigning the value to a local variable before writing to the Component, the bug still occurs ..

And since you did already include chr() .. don't forget about ord() :roll:

+ Did you make some changes to the code editor syntax scheme? I could have sworn comments used to turn blue ( now they are black ).

K
User avatar
y offs et
Posts: 418
Joined: Wed Apr 22, 2009 4:26 pm
Location: BC, Canada

Post by y offs et »

1) define variable now has an IntValue value of 6466576
2) string isn't in the code completion
3) the test file produces something strange (to me anyway)
Attachments
test.zip
(357 Bytes) Downloaded 682 times
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Kjell wrote:Just downloaded the ( latest ) Beta with String support. Already a impressive list of String related functions 8)
Thanks!
Kjell wrote:First bug I ran into is that when you assign the result of strToInt() to a DefineVariable ( integer )
Oops, this turned out to be quite a serious bug, so I've already fixed it (including the strange default integer value) and uploaded an updated version. Also comments are blue again :)
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

y offs et wrote:3) the test file produces something strange (to me anyway)
This is also related to the Integer-variable bug that Kjell reported and is now fixed. Please download the beta again, and it should work.
User avatar
y offs et
Posts: 418
Joined: Wed Apr 22, 2009 4:26 pm
Location: BC, Canada

Post by y offs et »

I like the new log read out. You can have just a sliver showing, yet get full readout with cursor over.
User avatar
y offs et
Posts: 418
Joined: Wed Apr 22, 2009 4:26 pm
Location: BC, Canada

Post by y offs et »

OK, I got all the .zproj fles in this thread working now.
I used shadowCaster for this testing.

They all had the same problem (for my rig). The Render Target components all had 0 as values for CustomWidth/Height, and I would get nothing happening. I get good display with 512/512. With 256/256, 128/128 etc. things get progressively granulated, and with 1028/1028 I get nothing again.

I'm suggesting a default value for Render Target of 512/512.

And I get nothing with the fish-eye demo, probably for the above reason.

Also, the drop downs of half/quarter don't seem to have any effect.
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Updated again because I fixed a memory leak when using string-arrays.

Also:
- RenderTarget size now defaults to 256x256.
- ord()-function to get ansi-code from character
User avatar
Lupo
Posts: 76
Joined: Wed Sep 09, 2009 6:21 pm
Location: Montevideo, Uruguay

Code Editor / FBO

Post by Lupo »

Loved the code editor autocomplete/string improvements.

I'm still way behind regarding shaders, FBO and passes, because my notebook has a crappy intel onboard card, and is practically unusable for this.

BTW ZGE rocks!
Close, but not there yet.
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Minor update today:

- not-syntax in scripts ("!(lives==0)", "!finished" etc)
- DefineConstant-component now has a type-property so you can define string and integer constants.
- App.Caption is now assignable from scripts so you can type things like "App.Caption = "Frame rate: " + IntToStr(App.FpsCounter);" when you quickly want to display a value and not bother with a RenderText-component.
- Generated exe-files now display the standard application icon in the task-bar (instead of "missing icon"-icon that was displayed previously).
User avatar
Kjell
Posts: 1876
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

8)

Couldn't resist .. a feature that Ville is still working on ~

External libraries :)

K
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Post by jph_wacheski »

Ha! that is cool,. I was going to suggest an ogg component for sound samples, however dll support is much better as there are many that do neeto things availble,. . hope this gets added for sure!!!
iterationGAMES.com
Post Reply