When creating a ped can you have him do fighting animations while he already has a gun?
GTA: Modification Area
{$CLEO}
0000:
var
$PLAYER_CHAR : Player
end
while true
wait 250
if
$PLAYER_CHAR.Defined
then
if
00E1: player 0 pressed_key 10 // N (Latin)
then
break
end
end
end
#BIKDRUG.Load
#AK47.Load
04ED: load_animation "FIGHT_C"
038B: load_requested_models
while true
if and
#BIKDRUG.Available
#AK47.Available
04EE: animation "FIGHT_C" loaded
then
break
end
wait 0
end
04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 1.0 3.0 1.0
009A: 0@ = create_actor_pedtype 4 model #BIKDRUG at 1@ 2@ 3@
0223: set_actor 0@ health_to 500
01B2: give_actor 0@ weapon 30 ammo 0xFFFFFFF // Load the weapon model before using this
if
not Actor.Dead(0@)
then
0605: actor 0@ perform_animation_sequence "FIGHTC_M" IFP_file "FIGHT_C" 4.0 loop 0 1 1 0 time -1 // versionA
end
while 0611: actor 0@ performing_animation "FIGHTC_M"
wait 0
end
wait 500
0605: actor 0@ perform_animation_sequence "FIGHTC_G" IFP_file "FIGHT_C" 4.0 loop 0 1 1 0 time -1 // versionA
while 0611: actor 0@ performing_animation "FIGHTC_G"
wait 0
end
wait 2000
#BIKDRUG.Destroy
#AK47.Destroy
04EF: release_animation "FIGHT_C"
01C2: remove_references_to_actor 0@ // Like turning an actor into a random pedestrian
0a93: enc_custom_thread
{$CLEO}
0000:
var
$PLAYER_CHAR : Player
end
while true
wait 250
if
$PLAYER_CHAR.Defined
then
if
00E1: player 0 pressed_key 10 // N (Latin)
then
break
end
end
end
#BIKDRUG.Load
#AK47.Load
04ED: load_animation "FIGHT_C"
038B: load_requested_models
while true
if and
#BIKDRUG.Available
#AK47.Available
04EE: animation "FIGHT_C" loaded
then
break
end
wait 0
end
04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 1.0 8.0 1.0
009A: 0@ = create_actor_pedtype 4 model #BIKDRUG at 1@ 2@ 3@
0223: set_actor 0@ health_to 500
01B2: give_actor 0@ weapon 30 ammo 0xFFFFFFF // Load the weapon model before using this
04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0
0668: AS_actor 0@ rotate_and_shoot_at 1@ 2@ 3@ 3000 ms
33@ = 0
repeat
wait 0
until 33@ > 3100
if
not Actor.Dead(0@)
then
0605: actor 0@ perform_animation_sequence "FIGHTC_IDLE" IFP_file "FIGHT_C" 4.0 loop 1 0 0 0 time -1 // versionA
end
33@ = 0
while true
if
33@ > 2300
then
break
end
wait 0
end
05D9: AS_actor 0@ run_to_actor $PLAYER_ACTOR timelimit 0xFFFFFFFE stop_within_radius 2.0
repeat
wait 0
until 0104: actor $PLAYER_ACTOR near_actor 0@ radius 1.58659369 2.0 2.0 sphere 0
if and
not Actor.Dead(0@)
not Actor.Dead($PLAYER_ACTOR)
then
0605: actor 0@ perform_animation_sequence "FIGHTC_M" IFP_file "FIGHT_C" 4.0 loop 0 1 1 0 time -1 // versionA
05BB: AS_actor $PLAYER_ACTOR fall_down 0 time_on_ground 1500
0851: set_actor $PLAYER_ACTOR decrease_health_by 10 flag 1
gosub @ReadMem
000E: 4@ -= @Message1
gosub @BlackBox
end
while 0611: actor 0@ performing_animation "FIGHTC_M"
wait 0
end
wait 2000
gosub @ReadMem
000E: 4@ -= @Message2
gosub @BlackBox
33@ = 0
#BIKDRUG.Destroy
#AK47.Destroy
04EF: release_animation "FIGHT_C"
01C2: remove_references_to_actor 0@ // Like turning an actor into a random pedestrian
0a93: end_custom_thread
:ReadMem
0A9F: 4@ = current_thread_pointer
4@ += 0x10
0A8D: 4@ = read_memory 4@ size 4 virtual_protect 0
return
:BlackBox
if
0AA9: is_game_version_original
then
0AA5: call 0x588BE0 num_params 4 pop 4 0 0 0 4@
else
0AA5: call 0x5893B0 num_params 4 pop 4 0 0 0 4@
end
return // Set SB 'Case Converting' to 'As is'
:Message1
hex
"~r~ You_got_owned!" 00
end
:Message2
hex
"~s~ Test_script_ended." 00
end
edit whats the ~r~ and ~s~ do? Something with the text I presume?
~r~ - Red
~s~ - Set normal
~g~ - Green
~b~ - Blue
~p~ - Purple
~y~ - Yellow
~w~ - White
:BlackBox
if
0AA9: is_game_version_original
then
0AA5: call 0x588BE0 num_params 4 pop 4 0 0 0 4@
else
0AA5: call 0x5893B0 num_params 4 pop 4 0 0 0 4@
end
return // Set SB 'Case Converting' to 'As is'
:Message1
hex
"~r~ You_got_owned!" 00
end
:Message2
hex
"~s~ Test_script_ended." 00
end
hex
"~r~ You_got_owned!" 00
end
hex
7E 72 7E 59 6F 75 5F 67 6F 74 5F 6F 77 6E 65 64
21 00
end
0@ = -429566
if
&0(0@,1i) == 4611680
then
....
else
....
end
015F: set_camera_position 664.9277 -479.6112 16.1668 rotation 0.0 0.0 0.0
0160: set_camera_point_at 665.8948 -479.5685 16.4175 mode 2
068D: get_camera_position_to $TEMPVAR_FLOAT_1 $TEMPVAR_FLOAT_2 $TEMPVAR_FLOAT_3
068E: get_camera_target_point_to $TEMPVAR_FLOAT_1 $TEMPVAR_FLOAT_2 $TEMPVAR_FLOAT_3
But I looked in the BigfootCleo.cs from the X-files 2
0A95: enable_thread_saving
0AB3: var 15 = 0
0AB4: 31@ = var 15
if
31@ == 5
then
...activate sub-Bigfoot script
end
0AB4: 31@ = var 15
000A: 31@ += 1 // integer values
0AB3: var 15 = 31@
{$CLEO}
0000:
var
$PLAYER_CHAR : Player
end
while true
wait 250
if
$PLAYER_CHAR.Defined
then
if
00E1: player 0 pressed_key 10 // N (Latin)
then
break
end
end
end
#BIKDRUG.Load
#AK47.Load
04ED: load_animation "FIGHT_C"
038B: load_requested_models
while true
if and
#BIKDRUG.Available
#AK47.Available
04EE: animation "FIGHT_C" loaded
then
break
end
wait 0
end
04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 1.0 8.0 1.0
009A: 0@ = create_actor_pedtype 4 model #BIKDRUG at 1@ 2@ 3@
0223: set_actor 0@ health_to 500
060B: set_actor 0@ decision_maker_to 32
01B2: give_actor 0@ weapon 30 ammo 0xFFFFFFF // Load the weapon model before using this
04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0
0668: AS_actor 0@ rotate_and_shoot_at 1@ 2@ 3@ 3000 ms
33@ = 0
repeat
wait 0
until 33@ > 3100
if
not Actor.Dead(0@)
then
0605: actor 0@ perform_animation_sequence "FIGHTC_IDLE" IFP_file "FIGHT_C" 4.0 loop 1 0 0 0 time -1 // versionA
end
33@ = 0
while true
if
33@ > 2300
then
break
end
wait 0
end
05D9: AS_actor 0@ run_to_actor $PLAYER_ACTOR timelimit 0xFFFFFFFE stop_within_radius 2.0
33@ = 0
repeat
wait 0
until 0104: actor $PLAYER_ACTOR near_actor 0@ radius 1.58659369 2.0 2.0 sphere 0
if and
not Actor.Dead(0@)
not Actor.Dead($PLAYER_ACTOR)
then
0605: actor 0@ perform_animation_sequence "FIGHTC_M" IFP_file "FIGHT_C" 4.0 loop 0 1 1 0 time -1 // versionA
05BB: AS_actor $PLAYER_ACTOR fall_down 0 time_on_ground 1500
0851: set_actor $PLAYER_ACTOR decrease_health_by 9 flag 1
gosub @ReadMem
000E: 4@ -= @Message1
gosub @BlackBox
end
while 0611: actor 0@ performing_animation "FIGHTC_M"
wait 0
end
wait 1000
04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 0.0 4.8 0.0
07CD: AS_actor 0@ walk_to 1@ 2@ 3@ stop_with_angle -1 within_radius 1.0
wait 2500
0A1D: AS_actor 0@ rotate_to_and_look_at_actor $PLAYER_ACTOR
wait 2000
0792: disembark_instantly_actor $PLAYER_ACTOR
0605: actor $PLAYER_ACTOR perform_animation_sequence "FIGHTC_IDLE" IFP_file "FIGHT_C" 4.0 loop 1 0 0 0 time -1 // versionA
while true
if
33@ > 2000
then
break
end
wait 0
end
33@ = 0
// --- end of attack start
:RepeatAction
wait 0
if and
not Actor.Dead(0@)
not Actor.Dead($PLAYER_ACTOR)
then
05D9: AS_actor 0@ run_to_actor $PLAYER_ACTOR timelimit 0xFFFFFFFE stop_within_radius 1.7
end
repeat
wait 0
until 0104: actor $PLAYER_ACTOR near_actor 0@ radius 1.5865936487 1.7 2.0 sphere 0
if and
not Actor.Dead(0@)
not Actor.Dead($PLAYER_ACTOR)
then
0605: actor 0@ perform_animation_sequence "FIGHTC_M" IFP_file "FIGHT_C" 4.0 loop 0 1 1 0 time -1 // versionA
05BB: AS_actor $PLAYER_ACTOR fall_down 0 time_on_ground 1500
0851: set_actor $PLAYER_ACTOR decrease_health_by 5 flag 1
end
if or
not Actor.Dead($PLAYER_ACTOR)
not Actor.Dead(0@)
jf @EndScript
while 0611: actor 0@ performing_animation "FIGHTC_M"
wait 0
end
wait 1000
04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 0.0 4.8 0.0
07CD: AS_actor 0@ walk_to 1@ 2@ 3@ stop_with_angle -1 within_radius 1.0
wait 2500
0A1D: AS_actor 0@ rotate_to_and_look_at_actor $PLAYER_ACTOR
wait 2000
0792: disembark_instantly_actor $PLAYER_ACTOR
0605: actor $PLAYER_ACTOR perform_animation_sequence "FIGHTC_IDLE" IFP_file "FIGHT_C" 4.0 loop 1 0 0 0 time -1 // versionA
while true
if
33@ > 3000 // in/de/crease this timer, for a time you want to re-loop the kick-action
then
break
end
wait 0
end
33@ = 0
jump @RepeatAction
:EndScript
wait 2000
gosub @ReadMem
000E: 4@ -= @Message2
gosub @BlackBox
#BIKDRUG.Destroy
#AK47.Destroy
04EF: release_animation "FIGHT_C"
01C2: remove_references_to_actor 0@ // Like turning an actor into a random pedestrian
0a93: end_custom_thread
:ReadMem
0A9F: 4@ = current_thread_pointer
4@ += 0x10
0A8D: 4@ = read_memory 4@ size 4 virtual_protect 0
return
:BlackBox
if
0AA9: is_game_version_original
then
0AA5: call 0x588BE0 num_params 4 pop 4 0 0 0 4@
else
0AA5: call 0x5893B0 num_params 4 pop 4 0 0 0 4@
end
return // Set SB 'Case Converting' to 'As is' !
:Message1
hex
"~r~ You_got_owned!" 00
end
:Message2
hex
"~s~ Test_script_ended." 00
end
{$CLEO}
0000:
var
$PLAYER_CHAR : Player
end
while true
wait 250
if
$PLAYER_CHAR.Defined
then
if
00E1: player 0 pressed_key 10 // N (Latin)
then
break
end
end
end
#BIKDRUG.Load
#AK47.Load
04ED: load_animation "FIGHT_C"
038B: load_requested_models
while true
if and
#BIKDRUG.Available
#AK47.Available
04EE: animation "FIGHT_C" loaded
then
break
end
wait 0
end
04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 1.0 8.0 1.0
009A: 0@ = create_actor_pedtype 4 model #BIKDRUG at 1@ 2@ 3@
0223: set_actor 0@ health_to 500
060B: set_actor 0@ decision_maker_to 32
01B2: give_actor 0@ weapon 30 ammo 0xFFFFFFF // Load the weapon model before using this
04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0
0668: AS_actor 0@ rotate_and_shoot_at 1@ 2@ 3@ 3000 ms
33@ = 0
repeat
wait 0
until 33@ > 3100
if
not Actor.Dead(0@)
then
0605: actor 0@ perform_animation_sequence "FIGHTC_IDLE" IFP_file "FIGHT_C" 4.0 loop 1 0 0 0 time -1 // versionA
end
33@ = 0
while true
if
33@ > 2300
then
break
end
wait 0
end
05D9: AS_actor 0@ run_to_actor $PLAYER_ACTOR timelimit 0xFFFFFFFE stop_within_radius 2.0
33@ = 0
repeat
wait 0
until 0104: actor $PLAYER_ACTOR near_actor 0@ radius 1.58659369 2.0 2.0 sphere 0
if and
not Actor.Dead(0@)
not Actor.Dead($PLAYER_ACTOR)
then
0605: actor 0@ perform_animation_sequence "FIGHTC_M" IFP_file "FIGHT_C" 4.0 loop 0 1 1 0 time -1 // versionA
05BB: AS_actor $PLAYER_ACTOR fall_down 0 time_on_ground 1500
0851: set_actor $PLAYER_ACTOR decrease_health_by 9 flag 1
gosub @ReadMem
000E: 4@ -= @Message1
gosub @BlackBox
end
while 0611: actor 0@ performing_animation "FIGHTC_M"
wait 0
end
wait 1000
04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 0.0 4.8 0.0
07CD: AS_actor 0@ walk_to 1@ 2@ 3@ stop_with_angle -1 within_radius 1.0
wait 2500
0A1D: AS_actor 0@ rotate_to_and_look_at_actor $PLAYER_ACTOR
wait 2000
0792: disembark_instantly_actor $PLAYER_ACTOR
0605: actor $PLAYER_ACTOR perform_animation_sequence "FIGHTC_IDLE" IFP_file "FIGHT_C" 4.0 loop 1 0 0 0 time -1 // versionA
while true
if
33@ > 2000
then
break
end
wait 0
end
33@ = 0
0687: clear_actor 0@ task
05E2: AS_actor 0@ kill_actor $PLAYER_ACTOR
repeat
wait 0
until Actor.Dead($PLAYER_ACTOR)
:EndScript
wait 2000
gosub @ReadMem
000E: 4@ -= @Message2
gosub @BlackBox
#BIKDRUG.Destroy
#AK47.Destroy
04EF: release_animation "FIGHT_C"
01C2: remove_references_to_actor 0@ // Like turning an actor into a random pedestrian
0a93: end_custom_thread
:ReadMem
0A9F: 4@ = current_thread_pointer
4@ += 0x10
0A8D: 4@ = read_memory 4@ size 4 virtual_protect 0
return
:BlackBox
if
0AA9: is_game_version_original
then
0AA5: call 0x588BE0 num_params 4 pop 4 0 0 0 4@
else
0AA5: call 0x5893B0 num_params 4 pop 4 0 0 0 4@
end
return // Set SB 'Case Converting' to 'As is' !
:Message1
hex
"~r~ You_got_owned!" 00
end
:Message2
hex
"~s~ Test_script_ended." 00
end
{$CLEO .cs}
//-------------MAIN---------------
thread "HUNT_N"
0A95: enable_thread_saving
:HUNT_N_10
wait 0
if
Player.Defined($PLAYER_CHAR)
jf @HUNT_N_10
if
$ONMISSION == 0
jf @HUNT_N_10
jump @HUNT_N_55
:HUNT_N_55
wait 0
if and
$ONMISSION == 0
00FF: actor $PLAYER_ACTOR sphere 1 in_sphere -1907.506 716.6337 45.4453 radius 2.0 2.0 3.0 on_foot
jf @HUNT_N_13
00BE: text_clear_all
$ONMISSION = 1
00BA: show_text_styled GXT 'NEME1' time 1000 style 2
0A94: start_custom_mission "NEMESISMISSION"
jump @HUNT_N_10
:HUNT_N_13
gosub @ReadMem
000E: 4@ -= @Message1
gosub @BlackBox
:ReadMem
0A9F: 4@ = current_thread_pointer
4@ += 0x10
0A8D: 4@ = read_memory 4@ size 4 virtual_protect 0
return
:BlackBox
if
0AA9: is_game_version_original
then
0AA5: call 0x588BE0 num_params 4 pop 4 0 0 0 4@
else
0AA5: call 0x5893B0 num_params 4 pop 4 0 0 0 4@
end
return // Set SB 'Case Converting' to 'As is'
:Message1
hex
"~r~ Finish_Your_Curent_Mission_First!" 00
end
jump @HUNT_N_10
000E: 4@ -= @Message1
{$CLEO}
0000:
:Script_01
while true
wait 250
if
Player.Defined($PLAYER_CHAR)
then
if
$ONMISSION == 0
then
break
end
end
end
wait 0
if and
$ONMISSION == 0
00FF: actor $PLAYER_ACTOR sphere 1 in_sphere -1907.506 716.6337 45.4453 radius 2.0 2.0 3.0 on_foot
then
00BE: text_clear_all
$ONMISSION = 1
00BA: show_text_styled GXT 'NEME1' time 1000 style 2
0A94: start_custom_mission "NEMESISMISSION"
wait 500
jump @Script_01
end
gosub @ReadMem
000E: 4@ -= @Message1
gosub @BlackBox
jump @Script_01
:ReadMem
0A9F: 4@ = current_thread_pointer
4@ += 0x10
0A8D: 4@ = read_memory 4@ size 4 virtual_protect 0
return
:BlackBox
if
0AA9: is_game_version_original
then
0AA5: call 0x588BE0 num_params 4 pop 4 0 0 0 4@
else
0AA5: call 0x5893B0 num_params 4 pop 4 0 0 0 4@
end
return // Set SB 'Case Converting' to 'As is'
:Message1
hex
"~r~ Finish_Your_Curent_Mission_First!" 00
end
Last edited by gtasbigfoot on Sun Jul 19, 2009 2:32 am; edited 1 time in total
gosub @ReadMem // gosub to read address
// okay we finished gosubing to ReadMem..
000E: 4@ -= @Message1 // the data-text
gosub @BlackBox // call the text box
// OK!! we finished gosubing now where do we go??
// ANSWER: just continue ...
// SHOULD BE (what we should put here): put a jump here to restart the start - we should NOT CONTINUE!!!
// so we read this again - useless
:ReadMem
0A9F: 4@ = current_thread_pointer
4@ += 0x10
0A8D: 4@ = read_memory 4@ size 4 virtual_protect 0
// we see this 'return' it's useless now since we DID NOT gosub WE ALREADY DID IT! we just continue from the last gosub. no gosub to return from = CRASH!
return
.....
how the while-true and break work
:Script_01
while true
wait 250
if
Player.Defined($PLAYER_CHAR)
then
if
$ONMISSION == 0
then
break
end
end
end
:Noname_4
0001: wait 250 ms
00D6: if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @Noname_50
00D6: if
0038: $ONMISSION == 0
004D: jump_if_false @Noname_50
0002: jump @Noname_57
:Noname_50
0002: jump @Noname_4
{$CLEO}
0000:
:Script_01
while true
wait 250
if
Player.Defined($PLAYER_CHAR)
then
break
end
end
wait 0
if
00FF: actor $PLAYER_ACTOR sphere 1 in_sphere -1907.506 716.6337 45.4453 radius 2.0 2.0 3.0 on_foot
then
if
$ONMISSION == 0
jf @PlayerOnMission
00BE: text_clear_all
$ONMISSION = 1
00BA: show_text_styled GXT 'NEME1' time 1000 style 2
0A94: start_custom_mission "NEMESISMISSION"
wait 500
jump @Script_01
end
jump @Script_01
:PlayerOnMission
gosub @ReadMem
000E: 4@ -= @Message1
gosub @BlackBox
jump @Script_01
:ReadMem
0A9F: 4@ = current_thread_pointer
4@ += 0x10
0A8D: 4@ = read_memory 4@ size 4 virtual_protect 0
return
:BlackBox
if
0AA9: is_game_version_original
then
0AA5: call 0x588BE0 num_params 4 pop 4 0 0 0 4@
else
0AA5: call 0x5893B0 num_params 4 pop 4 0 0 0 4@
end
return // Set SB 'Case Converting' to 'As is'
:Message1
hex
"~r~ Finish_Your_Curent_Mission_First!" 00
end
Go to page : 1, 2, 3, 4
Similar topics
Permissions in this forum:
You cannot reply to topics in this forum