Kyoufu Kawa
Posts: 2013/2481 |
Having written something not quite unlike a scripting language before (Jesus, used in Catnip Dreams), I want to write something for Unkillable as well to handle basic enemy AI, animation and maybe cutscenes.
Here's all the controller code I have now, hardcoded in C:case CRAZYFROG: { AI_DoLocatorBound(i); if(DIST < 4096) //if we're close enough (say a couple grids) setsoundvol(5, 255 - (DIST >> 4)); //compute new volume from distance and set it else //if we're out of range setsoundvol(5, 0); //mute it out if((DIST < 256) && (ZDIST <= 50)) { //TODO -- Insert proper effect of getting hit here. //Use a version of the car's code below if one must. sysmessage("Frog hit ya."); } break; }
case CAR1: { AI_DoLocatorBound(i); if((DIST < 256) && (klabs(PZ) <= SZ - 1000)) { sysmessage("Car hit ya."); //TODO -- Insert screen flash here //TODO -- Figure out how to whap the player to the side. Player.posz -= 64 << 8; Player.horiz = 175; HurtAPlayer(-30,-1,i); } break; }
case CIVILIAN1: { if((DIST < 512) && (CANSEEPLAYER)) { if(Player.GTAStars > 1) //Does he fear you? sysmessage("Civvie: \"Stay away from me!\""); else sysmessage("Civvie: \"Hi.\""); } break; } case CIVILIAN1_DIE1: { if(TIMEPASSED(16)) { sprite[ i].extra = lockclock; SP = CIVILIAN1_DIE2; } break; } case CIVILIAN1_DIE2: { if(TIMEPASSED(16)) { sprite[ i].extra = lockclock; SP = CIVILIAN1_DEAD; } break; } case CIVILIAN1_DEAD: { changespritestat(i, 0); sprite[ i].lotag = 100; Kawa_GetStar(); //Ooooops! break; } The engine I intend to write should be able to do AT LEAST this. I have done ASM-like if clauses in Jesus, so that's no problem.
However, I want this code to be in a human-readable form. Where Jesus code is interpreted in bytecode form and written with a simple translator program, this stuff should be read in the same format it's written.
I kinda liked the Cave Story code, which was basically a terminator character ("<" if I remember correctly) with a three-letter mnemonic for each actual command.
Any suggestions before I burn my hands very badly trying to write this thing? Or can any one of you guys recommend a non-GPL scripting language that's relatively easy to snap in? |