Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

Are globals limited to 1024 in the stable release?

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
chronoboy
Into the past with a splash




Joined: 04 Jun 2010
Posts: 162
Location: Canada

PostPosted: Mon Nov 22, 2010 6:21 pm    Post subject: Are globals limited to 1024 in the stable release? Reply with quote

For some reason when using string to globals with globals higher than 1024, it either does not write, or globals to strings does not read it.

It could also be that 4096 limit is only in the nightly? Could someone please clarify this for me and if I need to fill a global variable bug on this?

EDIT: Also confirmed to be an issue in the nightly build as well. I guess I'll use export globals and store this extra data in a separate save slot.

WORKAROUND: Three very simple scripts to export up to 7 strings stored in globals with the size of 38 to a separate save slot, depending on your save slot chosen.

Code:

script, memcopy,p1,p2,p3, begin
  variable (i,i2)
  i2:=0
  for (i,p1,p2,1) do (write global(i2+p3,read global(i)),i2:=i2+1)
end

script, store note,note, begin
  variable (tmp,offset)
  offset:=280*save slot
  offset:=offset+2048
  tmp:=note*40
  tmp:=tmp+offset
  memcopy (my notes+10,my notes+48,tmp)
  export globals (5,tmp,tmp+38)
end

script, receive note,note, begin
  variable (tmp,offset)
  offset:=280*save slot
  offset:=offset+2048
  tmp:=note*40
  tmp:=tmp+offset
  import globals (5,tmp,tmp+38)
  memcopy (tmp,tmp+38,my notes+10)
end


Two globals will need to exist for this to work: my notes and save slot.

my notes contains the temp location in the current global variables scope, which will be exported.

save slot stores your current save slot number, get this by any means you can.

I choose to use memcopy, as I wanted the strings to be stored in high global variables, of which string to globals currently does not allow. Feel free to use memcopy for anything, if you need it.

Also to note for the devs, this script doesn't slow down the engine(much), when it draws a textbox using strings imported from a separate save slot, it draws one line of text at a time, about 0.5 seconds apart. My previous code with only a 5 line textbox read from local global strings worked faster.

Feature request: Could you add a memcopy command to plotscript, it would allow copying globals to and from save slots in different locations. Say I want to load globals 0-1023 into local global scope of 1024-2047, currently only a wrapper script like this would work.
_________________
Current project: Chronoboy Adventures

Website: http://www.chronoboy.com/
Back to top
View user's profile Send private message Visit poster's website
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Mon Nov 22, 2010 10:49 pm    Post subject: Reply with quote

Thanks, fixed.

Quote:
it draws one line of text at a time, about 0.5 seconds apart.

Wow, slow

Quote:
Feature request: Could you add a memcopy command to plotscript, it would allow copying globals to and from save slots in different locations. Say I want to load globals 0-1023 into local global scope of 1024-2047, currently only a wrapper script like this would work.


There will eventually be a special "globals" array. Then you'll be able to use array slicing to do things like this.
_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
chronoboy
Into the past with a splash




Joined: 04 Jun 2010
Posts: 162
Location: Canada

PostPosted: Mon Nov 22, 2010 11:14 pm    Post subject: Reply with quote

The Mad Cacti wrote:
Thanks, fixed.

So it was a bug? And it's fixed up ready for the next nightly?
_________________
Current project: Chronoboy Adventures

Website: http://www.chronoboy.com/
Back to top
View user's profile Send private message Visit poster's website
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Tue Nov 23, 2010 8:39 am    Post subject: Reply with quote

It is now. I hadn't pushed my local changes to the SVN repository yet.
_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
chronoboy
Into the past with a splash




Joined: 04 Jun 2010
Posts: 162
Location: Canada

PostPosted: Tue Nov 23, 2010 11:05 am    Post subject: Reply with quote

I guess this Heart of OHR contest is really keeping you devs busy with new bug fixes almost every day -- especially from me. Razz
_________________
Current project: Chronoboy Adventures

Website: http://www.chronoboy.com/
Back to top
View user's profile Send private message Visit poster's website
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Thu Nov 25, 2010 6:23 am    Post subject: Reply with quote

Actually only a single person request a bug fix for the contest, and it hasn't been fixed yet!

You're currently reporting more bugs than everyone else put together. That's much appreciated; we don't get enough testing (or enough reporting).
_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group