Please post mod releases in the Mod Showroom
Please read the Official Modification Forum Rules & Procedures BEFORE posting!
The following topics contain extremely useful data relating to the editing of missions and mission scripting:
If you are a begininer to mission coding, then please read Tutorial Links and Mission Coding Information.
Requests are to be made in the pinned topic.
cleo file structure
Posted 06 May 2012 - 02:00 AM
Posted 06 May 2012 - 08:14 AM
|QUOTE (Deji @ Sunday, May 6 2012, 04:00)|
|'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
Also fixed the wrong int bug, my compiler didn't switch from 8bit to 16bit int.
EDIT2: It's alive!
WHILE IS_PLAYER_PLAYING PLAYER
GET_CHAR_HEALTH PLAYER_CHAR health
IF health < 150i
health += 5i
IF health > 150i
health = 150i
SET_CHAR_HEALTH PLAYER health
0@ = Actor.Health($PLAYER_ACTOR)
not 0@ >= 150
0@ += 5
0@ > 150
0@ = 150
Actor.Health($PLAYER_CHAR) = 0@
I still have to add labels and jumps, and then add more opcodes.
Edited by Bad.boy!, 06 May 2012 - 12:18 PM.
Posted 09 May 2012 - 03:55 PM
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).
Posted 09 May 2012 - 03:58 PM
Posted 10 May 2012 - 08:51 AM
Posted 10 May 2012 - 03:46 PM
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.
will be like doing
I know that the float and integer is get in the same function (CScriptThread::getNumberParams).
Did you understood what I mean?
Edited by Link2012, 10 May 2012 - 03:50 PM.
Posted 10 May 2012 - 08:04 PM
Posted 10 May 2012 - 08:34 PM
|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).
Posted 10 May 2012 - 08:47 PM
|QUOTE (Deji @ Thursday, May 10 2012, 17:04)|
|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?"
Posted 10 May 2012 - 09:08 PM
Posted 11 May 2012 - 02:57 PM
|0223: set_actor 2@ health_to 500 = OPCODE + VAR + INT|
009A: 2@ = create_actor_pedtype 4 model #MALE01 at 0.0 0.0 0.0 = OPCODE + INT + INT + FLOAT + FLOAT + FLOAT + VAR
01C8: 40@ = create_actor_pedtype 23 model #SPECIAL01 in_car 35@ passenger_seat 0 = OPCODE + VAR + INT + INT + INT VAR
Posted 13 May 2012 - 08:09 PM
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).
Posted 28 May 2012 - 09:49 AM
|09 immediate 8 byte string|
Especially the last bytes, are they a random value or do they actually do something?
|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.
Posted 28 May 2012 - 11:07 AM
Posted 28 May 2012 - 06:44 PM
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users