Deji Posted May 6, 2012 Share Posted May 6, 2012 'THREAD' isn't the native-y name for that. In pure SCR coding, a thread only occurs on sweaters. Link to comment Share on other sites More sharing options...
Bad.boy! Posted May 6, 2012 Author Share Posted May 6, 2012 (edited) 'THREAD' isn't the native-y name for that. In pure SCR coding, a thread only occurs on sweaters. That fixes the thread bug, it's SCRIPT_NAME in my compiler EDIT: Also fixed the wrong int bug, my compiler didn't switch from 8bit to 16bit int. EDIT2: It's alive! SCRIPT_NAME "WHILE"WHILE IS_PLAYER_PLAYING PLAYER WAIT 0GET_CHAR_HEALTH PLAYER_CHAR healthIF health < 150i health += 5i IF health > 150i health = 150i ENDIF SET_CHAR_HEALTH PLAYER healthENDIFENDWHILE {$CLEO .cs}//-------------MAIN---------------thread "WHILE" :WHILE_9wait 0 [email protected] = Actor.Health($PLAYER_ACTOR)if not [email protected] >= 150 else_jump @WHILE_82 [email protected] += 5 if [email protected] > 150 else_jump @WHILE_74 [email protected] = 150 :WHILE_74Actor.Health($PLAYER_CHAR) = [email protected]:WHILE_82 Player.Defined($PLAYER_CHAR)else_jump @WHILE_9 I still have to add labels and jumps, and then add more opcodes. Edited May 6, 2012 by Bad.boy! Link to comment Share on other sites More sharing options...
Bad.boy! Posted May 9, 2012 Author Share Posted May 9, 2012 Opcodes that uses integers can use float too, right? Like wait 100000000000000 = wait 100000000000000.0 (float) Don't know why someone wants to use numbers higher than 32bit ints. But I'll make it just in case. I've finished the GOTO opcode. Next up is gosub (easier version of goto, should be done quickly). Link to comment Share on other sites More sharing options...
Link2012 Posted May 9, 2012 Share Posted May 9, 2012 But the game will not read this right, the game expects a integer in wait. Link to comment Share on other sites More sharing options...
Deji Posted May 10, 2012 Share Posted May 10, 2012 The game will handle a float value just fine. The game reads floats and integer with the same function, which reads the data type and decides how to read the value. Link to comment Share on other sites More sharing options...
Link2012 Posted May 10, 2012 Share Posted May 10, 2012 (edited) Maybe you didn't understand what I mean... Yes, the game will read the float fine, but will not send the correct (in integer) value to CScriptThread::wakeTime. The game will read the float, and will not do any kind of conversion to integer, since wait is expecting a integer, will not go right. so wait 1.0 will be like doing wait 1065353216 I know that the float and integer is get in the same function (CScriptThread::getNumberParams). Did you understood what I mean? Edited May 10, 2012 by Link2012 Link to comment Share on other sites More sharing options...
Deji Posted May 10, 2012 Share Posted May 10, 2012 I knew that, but its not really a reason for the compiler to not support using floats in place of integers. Also I dont get why you're having to add these opcodes individually. Something like an xml file with opcode information should be the only thing that has to be changed per-opcode. Link to comment Share on other sites More sharing options...
Bad.boy! Posted May 10, 2012 Author Share Posted May 10, 2012 I'll leave the float instead of int. I didn't want to use numbers that high anyway. Also I dont get why you're having to add these opcodes individually. Something like an xml file with opcode information should be the only thing that has to be changed per-opcode. I wanted to add opcodes in a xml or something, but I skipped it and added a few opcodes to test the compiler. I've still got loads of work to do. I've recently discovered some bugs with "GOTO", I have to make the opcode list, make something to tell the user what they did wrong instead of a crash, the design of the program and maybe a popup menu in the textbox which shows opcodes, like visual studio does. And if I get everything to work maybe improving the calculating part, now you have to end the senctence with i(nt) or f(loat). Link to comment Share on other sites More sharing options...
Link2012 Posted May 10, 2012 Share Posted May 10, 2012 I knew that, but its not really a reason for the compiler to not support using floats in place of integers. Also I dont get why you're having to add these opcodes individually. Something like an xml file with opcode information should be the only thing that has to be changed per-opcode. I understood his question as something like "If I put a float in WAIT the game will read good as a INTEGER?" Link to comment Share on other sites More sharing options...
Bad.boy! Posted May 10, 2012 Author Share Posted May 10, 2012 That was my question, I was wondering because Sanny Builder converts ints that are higher than 32bit int to float. Link to comment Share on other sites More sharing options...
Bad.boy! Posted May 11, 2012 Author Share Posted May 11, 2012 Is there some sort of rule of order of opcode parameters? 0223: set_actor [email protected] health_to 500 = OPCODE + VAR + INT009A: [email protected] = create_actor_pedtype 4 model #MALE01 at 0.0 0.0 0.0 = OPCODE + INT + INT + FLOAT + FLOAT + FLOAT + VAR01C8: [email protected] = create_actor_pedtype 23 model #SPECIAL01 in_car [email protected] passenger_seat 0 = OPCODE + VAR + INT + INT + INT VAR Link to comment Share on other sites More sharing options...
Bad.boy! Posted May 13, 2012 Author Share Posted May 13, 2012 I'll leave the order problem to the user (me). I completed the read opcodes from xml file and changed something in the design. I'll have to edit the main code again because it got really messy and to leave the possibility open to maybe add scm files in the future. The program also takes much memory compared to Sanny Builder (almost twice the memory whilst doing nothing). Link to comment Share on other sites More sharing options...
Bad.boy! Posted May 28, 2012 Author Share Posted May 28, 2012 It's been some time since I worked on this thing, anyway I've got a question about this datatype: 09 immediate 8 byte string Especially the last bytes, are they a random value or do they actually do something? For example: AI = 09 48 41 00 00 B2 00 00 00 // .HA..²...HAIS = 09 48 41 49 53 53 00 54 00 // .HAISS.T. ------------------------------------ Calculating works, if-then-end works, if-then-else-end works. Comparing works, conditions works. Basically it's finished for simple scripts. Link to comment Share on other sites More sharing options...
Link2012 Posted May 28, 2012 Share Posted May 28, 2012 They're nothing specific, just some memory trash after the null terminator. Link to comment Share on other sites More sharing options...
Bad.boy! Posted May 28, 2012 Author Share Posted May 28, 2012 Does anyone know a good font for the compiler, or what is Sanny Builder's font? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now