View previous topic :: View next topic |
Author |
Message |
JSH357

Joined: 02 Feb 2003 Posts: 1705
|
Posted: Tue Sep 04, 2007 6:26 pm Post subject: Switch statements |
|
|
This is more of a question for the OHR programmers.
Will there ever be any implementation of a switch/case statement (C++ one is the only one I'm familiar with)? It would make several things a LOT easier for me, fo sho. If not--I'm just curious--why wouldn't it be implementable? |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Tue Sep 04, 2007 8:00 pm Post subject: |
|
|
There already is. As example, here's a script from Eldardeen:
Code: | script, dir X, dir, begin
switch (dir) do (
case (up, down) do (return (0))
case (right) do (return (1))
case (left) do (return (-1))
)
end |
You can also use continue inside a case block, causing it to fall through (well actually, jump) to the next one.
(Actually, you don't have to put constants in the case() arguments, you can put expressions there, which is undocumented, and weird. Doing this would (when I get round to it) mean losing a large speed increase though. Still faster than lots of if's) _________________ "It is so great it is insanely great."
Last edited by TMC on Tue Sep 04, 2007 8:10 pm; edited 1 time in total |
|
Back to top |
|
 |
JSH357

Joined: 02 Feb 2003 Posts: 1705
|
Posted: Tue Sep 04, 2007 8:04 pm Post subject: |
|
|
What the heck? When did this come in? |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Tue Sep 04, 2007 8:23 pm Post subject: |
|
|
11th June 2006.
I actually implemented it before hasta-la-qb was released, in the wip branch. Hasta-la-qb forked from tirgoviste, missing out on any new features since then. (Incidently, this is also the reason hasta was so buggy: pretty much none of the devs ever used it, and also the reason Ubersetzung has so many new features). And that's why you've been missing out for so many years. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
Posted: Tue Sep 04, 2007 8:52 pm Post subject: |
|
|
This is JSH, who didn't know you could right-click or press ENTER to eyedrop a color.
Yes, I'm still going to be laughing about that for awhile yet. _________________
|
|
Back to top |
|
 |
JSH357

Joined: 02 Feb 2003 Posts: 1705
|
Posted: Tue Sep 04, 2007 9:07 pm Post subject: |
|
|
Hey, where is eyedropping documented? I'd say I had an excuse! It isn't obvious in CUSTOM, anyway. The switch statements weren't documented either. |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
|
Back to top |
|
 |
JSH357

Joined: 02 Feb 2003 Posts: 1705
|
Posted: Tue Sep 04, 2007 9:42 pm Post subject: |
|
|
Well the eyedrop was a feature most people probably knew about but I, for some reason, never noticed. (You wouldn't believe all the time I wasted trying to guess which colors I had been using) I guess I never noticed it since it's a selectable tool in MS Paint but a keyboard tool in CUSTOM. (I rarely, if ever, discover keyboard functions on my own with no visual representation)
A lot of the nightly stuff is just totally hard to find. I can't find switches in the plotdictionary in my OHR folder, but as long as they're there in the new one, it shouldn't be a problem. |
|
Back to top |
|
 |
msw188
Joined: 02 Jul 2003 Posts: 1041
|
Posted: Wed Sep 05, 2007 7:43 am Post subject: |
|
|
Heh heh, I didn't know about the CTRL+SPACE to bring up a text character picker for a while. I wasted so much time as well holding down alt and pressing all of the keys until I found the special character I wanted. _________________ My first completed OHR game, Tales of the New World:
http://castleparadox.com/gamelist-display.php?game=161
This website link is for my funk/rock band, Euphonic Brew:
www.euphonicbrew.com |
|
Back to top |
|
 |
TwinHamster ♫ Furious souls, burn eternally! ♫

Joined: 07 Mar 2004 Posts: 1352
|
Posted: Wed Sep 05, 2007 8:51 am Post subject: |
|
|
Quote: | Heh heh, I didn't know about the CTRL+SPACE to bring up a text character picker for a while. |
Copies into notes.
There really should be a hotkey list on the wiki. |
|
Back to top |
|
 |
Camdog
Joined: 08 Aug 2003 Posts: 606
|
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Wed Sep 05, 2007 8:54 pm Post subject: |
|
|
The OHR is (or was, anyway) documented primarily in whatsnew. If you look in there, you'll find all of these things. But that's unrealistic. The HOWTO is the real documentation, but it doesn't cover everything. You'll find all the controls to the sprite and map editors there.
Yeah, the truth is, not everything is well documented. But things have greatly improved since the wiki. We still really need to finish this: 'Menu:Main Menu'. It'll document all of Custom, replacing the need to wade through the HOWTO. But there's just so much to write.
A bot is meant to update all the plotdict pages. I don't know the details. I think it's Mike's, and maybe he needs to manually cause it to update everything (based on the xml file, which is stored in SVN). I'm also not sure whether changes by anyone else would get wiped. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
Camdog
Joined: 08 Aug 2003 Posts: 606
|
Posted: Thu Sep 06, 2007 5:46 am Post subject: |
|
|
Well, that's cool. I just cut and pasted from the plotscript dictionary. |
|
Back to top |
|
 |
|