View Single Post
  #28    
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: 17
Gender: Male
Posts: 86
Quote originally posted by Stash:
Adding a looping feature is very good idea:

Code:
loop(@i ; 10)
Code:
{
      message("Message " + i);
}
OR

Code:
loop(@i ; 10) :
Code:
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:
Code:
#dynamic 0x80000
 
#org @main
lock
setvar 0x8000 0x0
goto @loop
end
 
#org @loop
compare 0x8000 0xA
if 0x1 goto @cont
//Code Here
addvar 0x8000 0x1
goto @loop
end
 
#org @cont
release
end
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).
Quote:
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

75% of Pokemon gamers use cheats and specially made codes to make their pokemon battle-worthy. If you are one of the 25% percent that level their Pokemon up legally, put this in your signature.
-Started by SkittyLover77