You are not logged in.
Pages: 1
Hi,
I can wirte informations to file with this:
:01 0001: wait 0 ms 068D: get_camera_position_to $CAM_POS_X $CAM_POS_Y $CAM_POS_Z 068E: get_camera_target_point_to $CAM_TARGET_X $CAM_TARGET_Y $CAM_TARGET_Z 00D6: if 0 0AB0: key_pressed 88 004D: jump_if_false @01 00D6: if 0 0256: player $PLAYER_CHAR defined 004D: jump_if_false @01 00D6: if 0 0A9A: $hFILE = openfile "cam.ini" mode 0x77 // IF and SET 004D: jump_if_false @01 0AD9: write_formatted_text "Camera Position: %g %g %g Camera Target: %g %g %g" in_file $hFile $CAM_POS_X $CAM_POS_Y $CAM_POS_Z $CAM_TARGET_X $CAM_TARGET_Y $CAM_TARGET_Z 0A9B: closefile $hFILE 0002: jump @01
That works fine, but if I try to append the informations to the file my game crashes, I use this code:
:01 0001: wait 0 ms 068D: get_camera_position_to $CAM_POS_X $CAM_POS_Y $CAM_POS_Z 068E: get_camera_target_point_to $CAM_TARGET_X $CAM_TARGET_Y $CAM_TARGET_Z 00D6: if 0 0AB0: key_pressed 88 004D: jump_if_false @01 00D6: if 0 0256: player $PLAYER_CHAR defined 004D: jump_if_false @01 00D6: if 0 0A9A: $hFILE = openfile "cam.ini" mode "at+" // IF and SET 004D: jump_if_false @01 0AD9: write_formatted_text "Camera Position: %g %g %g Camera Target: %g %g %g" in_file $hFile $CAM_POS_X $CAM_POS_Y $CAM_POS_Z $CAM_TARGET_X $CAM_TARGET_Y $CAM_TARGET_Z 0A9B: closefile $hFILE 0002: jump @01
Offline
Maybe you should try "wt+"? I can't understand a difference between at and wt
Edit: You've selected 'As is' case converting in SB option? 'cos I've had the same problem when my case converting was set to 'uppercase' - "AT+" =/= "at+"
Last edited by SilentPL (04-10-2010 20:27)
Offline
Edit: You've selected 'As is' case converting in SB option? 'cos I've had the same problem when my case converting was set to 'uppercase' - "AT+" =/= "at+"
Thanks man, that solved my problem
Last edited by ATP (04-10-2010 22:29)
Offline
For the record, "at" means "append text", so it adds it to the end of the text file. + just creates the file if it doesn't exist.
Let's say we wanna write " programs are annoying" to a file.
wt
File before
Hello world
File after
programs are annoying
at
File before
Hello world
File after
Hello world programs are annoying
Offline
Pages: 1