[08 Jan 2010] Changing page in Designer in code.

Contains all messages from the Hollywood mailing list between 01/2006 and 08/2012
Locked
Bugala
Posts: 1178
Joined: Sun Feb 14, 2010 7:11 pm

[08 Jan 2010] Changing page in Designer in code.

Post by Bugala »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Fri, 08 Jan 2010 21:06:26 -0000

IS this bug or is it suppsoed to work this way.

I tried to change a page in code on designer:

Code: Select all

if Status=0 then %>8
however, doing this gives me "Function wihtout EndFunction" error message.

If i put

Code: Select all

If Status=0 then a=1
it works fine, so its not about coding error.

In the end i was able to trace the problem. That if i was trying to jump to next page inside any loop or function, then it gave that "Function without EndFunction" error message.

So in practice i solved it by getting that pag echange out of any loops by

Code: Select all

repeat
program , including status=x and stopprogram=true
until (stopprogram=True)

if Status=0 then %>8
if Status=1 then %>5
but is it supposed to be this way? Or should change page work where ever put at code?

And what is there some other command i could use that would work inside a loop and would jump to either chosen or next page? (even next page would fix my problem)
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

[09 Jan 2010] Re: Changing page in Designer in code.

Post by airsoftsoftwair »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Sat, 09 Jan 2010 01:05:53 +0100
but is it supposed to be this way? Or should change page work where ever put at code?

And what is there some other command i could use that would work inside a loop and would jump to either chosen or next page? (even next page would fix my problem)
You should never use the Short If statement with these special Designer commands. Designer 2.1 is very sensitive here and it could lead to problems. So, never use this:

Code: Select all

; BAD CODE!
If Status=0 Then %>8
Instead, please use the following:

Code: Select all

; GOOD CODE!
If Status=0
  %>8
EndIf
Using the normal If statement makes sure that there is room for the code that will be inserted at the %>8 marker.
Bugala
Posts: 1178
Joined: Sun Feb 14, 2010 7:11 pm

[09 Jan 2010] Re: Changing page in Designer in code.

Post by Bugala »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Sat, 09 Jan 2010 00:21:49 -0000
Using the normal If statement makes sure that there is room for the code that will be inserted at the %>8 marker.
ah, thanks. Good to know.

But actually i did try it with good way too, and it refused to work inside a any loop.

Only way i got it to work, was to get it out of any loops.
Bugala
Posts: 1178
Joined: Sun Feb 14, 2010 7:11 pm

[09 Jan 2010] Re: Changing page in Designer in code.

Post by Bugala »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Sat, 09 Jan 2010 02:47:15 -0000
ah, thanks. Good to know.

But actually i did try it with good way too, and it refused to work inside a any loop.

Only way i got it to work, was to get it out of any loops.
And now this got even funnier, now it refuses to work with GOOD CODE!, but does work with BAD CODE!.

I guess the solution im going to do is that it will simply just jump to some page, without any IFs, and then i will do nothing else on that target page but check something like:

Code: Select all

switch page
case 0:
%>2
case 1:
%>6
endswitch
i guess that will be best choice, since now it seems that when i alter code although its not around the jump page place (since that is out of programs repeat loop and only thing after that loop) it for some reason also alters the page jumping.
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

[11 Jan 2010] Re: Re: Changing page in Designer in code.

Post by airsoftsoftwair »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Mon, 11 Jan 2010 11:34:12 +0100
And now this got even funnier, now it refuses to work with GOOD CODE!, but does work with BAD CODE!.

I guess the solution im going to do is that it will simply just jump to some page, without any IFs, and then i will do nothing else on that target page but check something like:

switch page case 0: %>2 case 1: %>6 endswitch

i guess that will be best choice, since now it seems that when i alter code although its not around the jump page place (since that is out of programs repeat loop and only thing after that loop) it for some reason also alters the page jumping.
Well, I'm still of the opinion that it would be much better to use Hollywood directly. Designer is fine for presentations and smaller games but if for games with complicated engine, I'd always use Hollywood directly because if you use too much custom code in Designer, it becomes a hell to debug it.
Bugala
Posts: 1178
Joined: Sun Feb 14, 2010 7:11 pm

[11 Jan 2010] Re: Changing page in Designer in code.

Post by Bugala »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Mon, 11 Jan 2010 15:28:45 -0000
Well, I'm still of the opinion that it would be much better to use Hollywood directly. Designer is fine for presentations and smaller games but if for games with complicated engine, I'd always use Hollywood directly because if you use too much custom code in Designer, it becomes a hell to debug it.
Currently page changes are not a problem to me anymore. Or are, but i was able to find solution.

If i use any if, switch, whatever, and i put them to their own line (the GOOD way) it complains that Function without Endfunction thing, but by using IF something THEN pagechange (the BAD way) it works fine for now (who knows for how long, since seems changing code affects which way it decides to work)

I have one page that handles the jumps where it automatically goes after end of each level (page being next to level code page, so when it gets out of loop it goes to next page which is the jump handling page) and that way i have at least for now been able to handle all necessary jumping.

So i however am having now a problem with Designer, and it is a bug i suppose.

Thing is, basically in any page, but one, i have just stuff like "money=100, level=2" that its just telling how much money you ae going to get from next level, or what is the number of level and so on.

But i have this one page that has the actual game engine (about 500 lines of code currently) which is voked when missions starts. And this page gives me trouble now.

For thing is, if i put this code in that page, and then save, designer wont let me load that HWD file next timme anymore but reports error in one of the code lines, (the one i posted in otheer topic here before).

I made new test project and created there only one page and loaded that same code to that one page, saved project and opened it, and it opened wihtout trouble.

So it seems that code bugs only in that real project.

That page in that real project has nothing else but that code. So in that sense its exactly similar to the test project.

So do you have any idea what might be causing this?

Basically this isnt ultimate disaster, since i can always load that code to that page again, test it, compile (havent tried actually) it and so on, without any problem, but if i save the project, then im not able to open that project anymore.

So its bit inconvenient.

Problem is also that i was coding for quite long before i saved that code, so tracing all the new lines that might have affected that situation is pretty hard too.

So just to repeat it shortly again.

If i put that code to page, program works fine, no errors and as supposed, but if i save that project, it wont open it anymore but reports about error in one of the line.

When copied to new project that same code and saved. No problem in opening.

Any idea what i should be trying to look out for?
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

[13 Jan 2010] Re: Re: Changing page in Designer in code.

Post by airsoftsoftwair »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Wed, 13 Jan 2010 12:02:04 +0100
So do you have any idea what might be causing this?
No, but I can surely tell you if you send me the *.hwd file that refuses to load in Designer :) I just need the *.hwd file, no data files whatsoever.

If you want me to investigate into the weird change page issue, however, then I'd also need all data files.
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

[16 Jan 2010] Re: Re: Changing page in Designer in code.

Post by airsoftsoftwair »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Sat, 16 Jan 2010 13:16:11 +0100

Ok, I've investigated the issues and both things were caused by bugs in Designer 2.1. They are all fixed in the current CVS build of Designer. As part of Airsoft Softwair's incredible customer support, I've exported the fixes into the Designer 2.1 CVS and I'll send you a fixed version of Designer 2.1 to your private email. Both errors (page change error and parser error) will be gone then and you can continue your work.

But please always use the GOOD way in page changes, i.e.

Code: Select all

; GOOD way
If bla=1
  %>4
EndIf
Using

Code: Select all

; BAD way
If bla=1 Then %>4
will work too but not under all conditions. So if you want to be on the safe side, use the GOOD way.

Nevertheless, I'd still use Hollywood directly if I were you. I think it's much easier than forcing a game engine into Designer :)
Bugala
Posts: 1178
Joined: Sun Feb 14, 2010 7:11 pm

[16 Jan 2010] Re: Re: Changing page in Designer in code.

Post by Bugala »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Sat, 16 Jan 2010 19:08:04 +0200 (EET)

Thanks a loads!

one question about your recent comments concerning rather using Hollywood alone than with designer.

So do you mean there is some malfucntion in designer that i can hit, ie. same way as these two were but just major one or something.

Or you just referring to debugging being easier with hollywood only and designer limitations (ie. world map currently having that "update" button to do its stuff, since designer cant do it automatically so that buttons would stay pressable if i add that code to pagecode place).

Just asking since right now even with designer2.1s limitations i think its wonderful solution working together with them in kind of simple game like this is. And it also makes testing very easy, that i can just run some certain page rightaway and test out how it works (although at this point im starting to be in need of starting from beginning everytime most time already). And i like so much more placing those dots on map (still missing) with designer than on code level and so on.

And basically the debugging problem is out since im for example making that engine part (level code) with cubic IDE and test running it there, so everytime i paste it to designer, its already tested to be working (although something can of course occur there too, but basically not).

And i also test run it from even small changes, exactly because of that debugging difficulty. So by test running every chages, not just major ones, i get to find errors. I mean the ones it reports when it tries to start but fails. Of course misspellings are still ones i can only find by better testing when i notice something isnt happening like it should.

So if these are the only bad things to come at me from using designer2.1, then i continue using designer, but if theres some issue i dont know and you tell me, then i can of course switch to Hollywood only (=Cubic IDE only).

Im very much waiting for Designer 3, i think it will be pretty much a dream come true developer tool for me, since even this 2.1 almost already is. Only those couple of limiations that make its usefulness go somewhat away, but i trust i can easily fix for example those "update" buttons to work automatically without buttons in the final code by fixing that issue in code level (havent even test tried that yet, so there can be some unpleasant surprise still waiting for me)

"As part of Airsoft Softwair's incredible customer support"

You indeed have dang good customer support for someone having this extensive one man project.

- Samuli
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

[17 Jan 2010] Re: Re: Changing page in Designer in code.

Post by airsoftsoftwair »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Sun, 17 Jan 2010 12:06:19 +0100
Thanks a loads!

one question about your recent comments concerning rather using Hollywood alone than with designer.

So do you mean there is some malfucntion in designer that i can hit, ie. same way as these two were but just major one or something.
No, I think you can get this to work with Designer 2.1 but the big problem is that it will probably not work with the next Designer version because that uses an entirely different mechanism of converting *.hwd into *.hws scripts. Of course, the next Designer is compatible to older Designer projects but that does not apply to custom code. Projects that do not use any custom code will always be compatible. As soon as you use custom code, it will not always work. It depends on how well your custom code is laid out. But it's generally not possible to guarantee that projects with lots of custom code will work with future Designer versions because custom code inevitably makes certain assumptions about the design of the rest of the script which is automatically generated by Designer. However, these assumptions are based on observations of the Designer 2 behaviour... in the next Designer version the script will work differently. That's why I suppose that the project wouldn't work the same way with the next version of Designer.... but I could be wrong :)
"As part of Airsoft Softwair's incredible customer support"

You indeed have dang good customer support for someone having this extensive one man project.
Thanks :)
Locked