View Single Post
Old January 10th, 2012 (12:00 PM). Edited January 10th, 2012 by tinix.
tinix's Avatar
tinix tinix is offline
PearlShipper & C Programmer
Join Date: Feb 2010
Location: Bratislava, Slovakia
Age: 19
Gender: Male
Posts: 86
Originally Posted by Stash View Post
Adding a looping feature is very good idea:

loop(@i ; 10)
      message("Message " + i);

loop(@i ; 10) :
message("Message " + i);
@i declares an integer variable and 10 represents how many times the loop will iterate. Using for or while might be a little confusing to some so using a keyword like loop explains what will happen upon usage better. I also am fond of using brackets since they organize the script, but not really needed. This is regards for a loop. I haven't seen something similar to this in other languages, so this will be great if it is to be implemented. Having a script editor that have a close syntax to an actual programming language would be great, at least in my opinion.
Well you can already do this in XSE by doing something like this:
#dynamic 0x80000
#org @main
setvar 0x8000 0x0
goto @loop
#org @loop
compare 0x8000 0xA
if 0x1 goto @cont
//Code Here
addvar 0x8000 0x1
goto @loop
#org @cont
Anyway I think it is great idea to have loops implemented with less annoying syntax.
EDIT: This is very similar to Assembler loops and I think that if we will be implementing some other dialect for scripting whit some advanced freatures like loops or objects, we should treat XSE like "assembly". By that I mean like C on computers which is compiled into assembly and the machine code. We could make the compiler compile the new dialect into machine code BUT any freature of the new dialect must be implementable somehow through the "assembly" (XSE in our case).
Also, making it open source would be a great idea.
I also support this.
Pokémon games I own:
Pokémon Diamond
Pokémon Platinum
Pokémon Ranger: Shadows of Almia
Pokémon HeartGold Version