|
 |
|
|
|
|
|
GTA Modification Forums
Bear Mod (help needed) Bear Mod CLEO help
 |
|
 |
| |
tysman  |
|
Mark Chump

Group: Members
Joined: Mar 20, 2009


|
Hey thanks it worked the bear dies properly and he follows cj no matter what, how can I slow the run animation down a bit or put some space between cj and the bear so cj has a chance to shoot it  My working code | CODE | // This file was decompiled using sascm.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007
{$VERSION 3.1.0027} {$CLEO .cs}
//-------------MAIN--------------- thread 'BEAR'
:BEAR_11 wait 0 if Player.Defined($PLAYER_CHAR) else_jump @BEAR_11 if $ONMISSION == 0 else_jump @BEAR_11 if 00FF: actor $PLAYER_ACTOR sphere 0 in_sphere -696.9056 -2102.9678 26.2662 radius 60.0 60.0 60.0 on_foot else_jump @BEAR_11 023C: load_special_actor 'BEAR' as 5 // models 290-299 wait 5 04ED: load_animation "BEAR_ANIMATION"
:BEAR_117 wait 0 if and 023D: special_actor 5 loaded 04EE: animation "BEAR_ANIMATION" loaded else_jump @BEAR_117 1@ = Actor.Create(Mission1, #SPECIAL05, -594.8727, -2067.8113, 42.0035) Actor.Angle(1@) = 254.662 Actor.Health(1@) = 10000 0446: set_actor 1@ immune_to_headshots 0 04D8: set_actor 1@ drowns_in_water 0 0946: set_actor 1@ actions_uninterupted_by_weapon_fire 1 060B: set_actor 1@ decision_maker_to 32 03FE: set_actor 1@ money 0 0A1D: AS_actor 1@ rotate_to_and_look_at_actor $PLAYER_ACTOR wait 100 0615: define_AS_pack_begin 15@ 0618: assign_actor 1@ to_AS_pack 15@ 0605: actor -1 perform_animation_sequence "BEAR_STAND" IFP_file "BEAR_ANIMATION" 4.0 loop 1 0 0 0 time -1 // versionA 0616: define_AS_pack_end 15@ 061B: remove_references_to_AS_pack 15@ wait 200 $BEAR_ACTOR = Actor.Health(1@) $BEAR_ACTOR /= 40 03C4: set_status_text $BEAR_ACTOR type 1 GXT 'NA' // global_variable 0296: unload_special_actor 5
:BEAR_220 wait 300 0812: AS_actor 1@ perform_animation "BEAR_RUN" IFP_file "BEAR_ANIMATION" 4.0 loopA 1 lockX 1 lockY 1 lockF 0 time -1 // versionB wait 500 083C: set_actor 1@ velocity_in_direction_XYZ 0.0 2.0 10.0 wait 50 083C: set_actor 1@ velocity_in_direction_XYZ 0.0 2.0 1.0 4@ = 5.0 jump @BEAR_321
:BEAR_321 wait 0 if Player.Defined($PLAYER_CHAR) else_jump @BEAR_410 if not Actor.Dead(1@) else_jump @BEAR_431 if 00F2: actor $PLAYER_ACTOR near_actor 1@ radius 200.0 200.0 0 else_jump @BEAR_410 // the move calculation to follow the player Actor.StorePos(1@, 11@, 12@, 13@) Actor.StorePos($PLAYER_ACTOR, 21@, 22@, 23@) 0063: 11@ -= 21@ // (float) 0063: 12@ -= 22@ // (float)
0604: get_Z_angle_for_point 11@ 12@ store_to 30@ 30@ += 180.0 Actor.Angle(1@) = 30@
02F6: 5@ = sine 30@ // (float) 02F7: 6@ = cosine 30@ // (float) 006B: 5@ *= 4@ // (float) 006B: 6@ *= 4@ // (float) 5@ *= -1.0
083C: set_actor 1@ velocity_in_direction_XYZ 5@ 6@ 0.7
if or 051A: actor 1@ damaged_by_actor $PLAYER_ACTOR 0457: player $PLAYER_CHAR aiming_at_actor 1@ $BEAR_ACTOR = Actor.Health(1@) $BEAR_ACTOR /= 25 if 0 >= $BEAR_ACTOR then 0829: actor 1@ perform_animation "BEAR_DEATH" IFP_file "BEAR_ANIMATION" rate 4.0 time 0 and_dies 0321: kill_actor 1@ end jump @BEAR_321
:BEAR_410 Actor.RemoveReferences(1@) 0151: remove_status_text $BEAR_ACTOR 065C: release_decision_maker 32 jump @BEAR_11
:BEAR_431 Actor.RemoveReferences(1@) 0151: remove_status_text $BEAR_ACTOR 0A93: end_custom_thread
| This post has been edited by tysman on Monday, May 9 2011, 22:31
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
ZAZ  |
|
Kernlochbohrer

Group: Members
Joined: Jan 10, 2005



|
| QUOTE (tysman @ May 9 2011, 21:24) | Hey thanks it worked the bear dies properly and he follows cj no matter what, how can I slow the run animation down a bit or put some space between cj and the bear so cj has a chance to shoot it My working code
|
in this way | CODE | 0605: actor 1@ perform_animation_sequence "BEAR_RUN" from_file "BEAR_ANIMATION" 4.0 0 1 1 0 -1 ms
then checks in the following loop
if 0611: actor 1@ performing_animation "BEAR_RUN" else_jump @bear_loop 5@ = 0.5 if <your condition> else_jump @step1 5@ = 0.7 jump @run
:step1 if <your condition> else_jump @step2 5@ = 1.0 jump @run
:step2 if <your condition> else_jump @run 5@ = 1.5 jump @run
:run 0393: actor 1@ perform_animation "BEAR_RUN" at 5@ times_normal_rate
|
and for the move speed: this is the value for the speed: you must add checks to adjust value | CODE | if <your condition> else_jump @step1 4@ = 3.0 jump @run
:step1 if <your condition> else_jump @step2 4@ = 5.0 jump @run
:step2 if <your condition> else_jump @run 4@ = 10.0 jump @run
:run // the move calculation to follow the player Actor.StorePos(1@, 11@, 12@, 13@) Actor.StorePos($PLAYER_ACTOR, 21@, 22@, 23@) 0063: 11@ -= 21@ // (float) 0063: 12@ -= 22@ // (float)
0604: get_Z_angle_for_point 11@ 12@ store_to 30@ 30@ += 180.0 Actor.Angle(1@) = 30@
02F6: 5@ = sine 30@ // (float) 02F7: 6@ = cosine 30@ // (float) 006B: 5@ *= 4@ // (float) 006B: 6@ *= 4@ // (float) 5@ *= -1.0
083C: set_actor 1@ velocity_in_direction_XYZ 5@ 6@ 0.7 |
now it's time for you to learn about Math coding This post has been edited by ZAZ on Monday, May 9 2011, 21:47
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
tysman  |
|
Mark Chump

Group: Members
Joined: Mar 20, 2009


|
I decided to try the mod again, but this time the bear is running up into the sky, when I wait little bit then the bear starts to slowly come down to about on top of CJ's head then if CJ moves the bear will slowly, go to the ground and it will remain on the ground after that. The bear is still following CJ through all of that but I want the bear to be on the ground LOL, how can I fix that? | CODE | // This file was decompiled using sascm.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007
{$VERSION 3.1.0027} {$CLEO .cs}
//-------------MAIN--------------- thread 'BEAR'
:BEAR_11 wait 0 if Player.Defined($PLAYER_CHAR) else_jump @BEAR_11 if $ONMISSION == 0 else_jump @BEAR_11 if 00FF: actor $PLAYER_ACTOR sphere 0 in_sphere -696.9056 -2102.9678 26.2662 radius 60.0 60.0 60.0 on_foot else_jump @BEAR_11 023C: load_special_actor 'BEAR' as 5 // models 290-299 wait 5 04ED: load_animation "BEAR_ANIMATION"
:BEAR_117 wait 0 if and 023D: special_actor 5 loaded 04EE: animation "BEAR_ANIMATION" loaded else_jump @BEAR_117 1@ = Actor.Create(Mission1, #SPECIAL05, -594.8727, -2067.8113, 42.0035) Actor.Angle(1@) = 254.662 Actor.Health(1@) = 10000 0446: set_actor 1@ immune_to_headshots 0 04D8: set_actor 1@ drowns_in_water 0 0946: set_actor 1@ actions_uninterupted_by_weapon_fire 1 060B: set_actor 1@ decision_maker_to 32 03FE: set_actor 1@ money 0 0A1D: AS_actor 1@ rotate_to_and_look_at_actor $PLAYER_ACTOR wait 100 0615: define_AS_pack_begin 15@ 0618: assign_actor 1@ to_AS_pack 15@ 0605: actor -1 perform_animation_sequence "BEAR_STAND" IFP_file "BEAR_ANIMATION" 4.0 loop 1 0 0 0 time -1 // versionA 0616: define_AS_pack_end 15@ 061B: remove_references_to_AS_pack 15@ wait 200 $BEAR_ACTOR = Actor.Health(1@) $BEAR_ACTOR /= 40 03C4: set_status_text $BEAR_ACTOR type 1 GXT 'NA' // global_variable 0296: unload_special_actor 5
:BEAR_220 wait 300 0812: AS_actor 1@ perform_animation "BEAR_RUN" IFP_file "BEAR_ANIMATION" 4.0 loopA 1 lockX 1 lockY 1 lockF 0 time -1 // versionB wait 500 083C: set_actor 1@ velocity_in_direction_XYZ 0.0 2.0 10.0 wait 50 083C: set_actor 1@ velocity_in_direction_XYZ 0.0 2.0 1.0 4@ = 5.0 jump @BEAR_321
:BEAR_321 wait 0 if Player.Defined($PLAYER_CHAR) else_jump @BEAR_410 if not Actor.Dead(1@) else_jump @BEAR_431 if 00F2: actor $PLAYER_ACTOR near_actor 1@ radius 200.0 200.0 0 else_jump @BEAR_410 // the move calculation to follow the player Actor.StorePos(1@, 11@, 12@, 13@) Actor.StorePos($PLAYER_ACTOR, 21@, 22@, 23@) 0063: 11@ -= 21@ // (float) 0063: 12@ -= 22@ // (float)
0604: get_Z_angle_for_point 11@ 12@ store_to 30@ 30@ += 180.0 Actor.Angle(1@) = 30@
02F6: 5@ = sine 30@ // (float) 02F7: 6@ = cosine 30@ // (float) 006B: 5@ *= 4@ // (float) 006B: 6@ *= 4@ // (float) 5@ *= -1.0
083C: set_actor 1@ velocity_in_direction_XYZ 5@ 6@ 0.7
if or 051A: actor 1@ damaged_by_actor $PLAYER_ACTOR 0457: player $PLAYER_CHAR aiming_at_actor 1@ $BEAR_ACTOR = Actor.Health(1@) $BEAR_ACTOR /= 25 if 0 >= $BEAR_ACTOR then 0829: actor 1@ perform_animation "BEAR_DEATH" IFP_file "BEAR_ANIMATION" rate 4.0 time 0 and_dies 0321: kill_actor 1@ end jump @BEAR_321
:BEAR_410 Actor.RemoveReferences(1@) 0151: remove_status_text $BEAR_ACTOR 065C: release_decision_maker 32 jump @BEAR_11
:BEAR_431 Actor.RemoveReferences(1@) 0151: remove_status_text $BEAR_ACTOR 0A93: end_custom_thread
| This post has been edited by tysman on Monday, May 9 2011, 23:12
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
ZAZ  |
Posted: Tuesday, May 10 2011, 19:16
|
Kernlochbohrer

Group: Members
Joined: Jan 10, 2005



|
I find out that it is very easy with a run animtion without opcode 083C: in the case that your "BEAR_RUN" works correct I tested with "BBALL_run" of IFP_file "BSKTBALL" Try the script below then replace the animations and test again "BSKTBALL" into "BEAR_ANIMATION" "BBALL_run" into "BEAR_RUN" "BBALL_react_miss" into "BEAR_DEATH" | CODE | {$CLEO .cs}
//-------------MAIN--------------- thread 'BEAR' wait 1000
:BEAR_11 wait 0 if Player.Defined($PLAYER_CHAR) else_jump @BEAR_11 if $ONMISSION == 0 else_jump @BEAR_11 if 00FF: actor $PLAYER_ACTOR sphere 0 in_sphere -696.9056 -2102.9678 26.2662 radius 60.0 60.0 60.0 on_foot else_jump @BEAR_11 023C: load_special_actor 'BEAR' as 5 // models 290-299 wait 5 04ED: load_animation "BSKTBALL"
:BEAR_117 wait 0 if and 023D: special_actor 5 loaded 04EE: animation "BSKTBALL" loaded else_jump @BEAR_117 1@ = Actor.Create(Mission1, #SPECIAL05, -594.8727, -2067.8113, 42.0035) Actor.Angle(1@) = 254.662 Actor.Health(1@) = 10000 0446: set_actor 1@ immune_to_headshots 0 04D8: set_actor 1@ drowns_in_water 0 0946: set_actor 1@ actions_uninterupted_by_weapon_fire 1 060B: set_actor 1@ decision_maker_to 32 03FE: set_actor 1@ money 0 wait 500 0639: AS_actor 1@ rotate_to_actor $PLAYER_ACTOR wait 1500 $BEAR_ACTOR = Actor.Health(1@) $BEAR_ACTOR /= 40 03C4: set_status_text $BEAR_ACTOR type 1 GXT 'NA' // global_variable 0296: unload_special_actor 5 0812: AS_actor 1@ perform_animation "BBALL_run" IFP_file "BSKTBALL" 4.0 loopA 1 lockX 1 lockY 1 lockF 0 time -1 // versionB
:BEAR_321 wait 0 if Player.Defined($PLAYER_CHAR) else_jump @BEAR_410 if not Actor.Dead(1@) else_jump @BEAR_431 if 00F2: actor $PLAYER_ACTOR near_actor 1@ radius 200.0 200.0 0 else_jump @BEAR_410 if 80F2: not actor $PLAYER_ACTOR near_actor 1@ radius 0.5 0.5 0 else_jump @BEAR_377 3@ = 1.0 if 00F2: actor $PLAYER_ACTOR near_actor 1@ radius 8.0 8.0 0 else_jump @BEAR_325 3@ = 0.5
:BEAR_325 if 0611: actor 1@ performing_animation "BBALL_run" else_jump @BEAR_327 0393: actor 1@ perform_animation "BBALL_run" at 3@ times_normal_rate
:BEAR_327 Actor.StorePos(1@, 11@, 12@, 13@) Actor.StorePos($PLAYER_ACTOR, 21@, 22@, 23@) 0063: 11@ -= 21@ // (float) 0063: 12@ -= 22@ // (float)
0604: get_Z_angle_for_point 11@ 12@ store_to 30@ 30@ += 180.0 Actor.Angle(1@) = 30@
:BEAR_377 if or 051A: actor 1@ damaged_by_actor $PLAYER_ACTOR 0457: player $PLAYER_CHAR aiming_at_actor 1@ $BEAR_ACTOR = Actor.Health(1@) $BEAR_ACTOR /= 25 if 0 >= $BEAR_ACTOR then 0829: actor 1@ perform_animation "BBALL_react_miss" IFP_file "BSKTBALL" rate 4.0 time 0 and_dies wait 1000 0792: disembark_instantly_actor 1@ 05BE: AS_kill_actor 1@ jump @BEAR_431 end jump @BEAR_321
:BEAR_410 Actor.RemoveReferences(1@) 0151: remove_status_text $BEAR_ACTOR 065C: release_decision_maker 32 jump @BEAR_11
:BEAR_431 Actor.RemoveReferences(1@) 0151: remove_status_text $BEAR_ACTOR 0A93: end_custom_thread |
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
ZAZ  |
Posted: Wednesday, May 11 2011, 17:24
|
Kernlochbohrer

Group: Members
Joined: Jan 10, 2005



|
| QUOTE (tysman @ May 10 2011, 19:20) | Hey thanks now the bear slows down when it is close to CJ I read your tutorial on math coding, and it is well explained. I think I have a basic idea of how it works, but I couldn't find anything on performing an animation and hurting the player at the same time, can you please help  |
At first we need to make it possible that BEAR makes a fight animation. The script should switch between RUN and FIGHT. This could basicly easy because the script can check if the BEAR is near CJ and let him do a fight animation and if the BEAR is not near CJ, it can let him do the run anim. | CODE | if 00F2: actor $PLAYER_ACTOR near_actor 1@ radius 1.5 1.5 0 else_jump @BEAR_322 0812: AS_actor 1@ perform_animation "FightA_3" IFP_file "PED" 4.0 loopA 1 lockX 1 lockY 1 lockF 0 time -1 // versionB jump @BEAR_324
:BEAR_322 if 80F2: not actor $PLAYER_ACTOR near_actor 1@ radius 1.7 1.7 0 else_jump @BEAR_324 0812: AS_actor 1@ perform_animation "BBALL_run" IFP_file "BSKTBALL" 4.0 loopA 1 lockX 1 lockY 1 lockF 0 time -1 // versionB |
But the problem is that the animation code shouldn't loop otherwise the BEAR would studdering so we need something which I called "Give access with math coding" Use a variable which have the value 0 as default check if the value is still 0 to give access for a command then change the value to 1 to prevent access for the command Now merge the access check with the check "if BEAR is near CJ" into one conditional check Make 2 of such conditional checks to toggle between RUN and FIGHT. I hope you understand what i mean, look at the script snippet below | CODE | 8@ = 0
:BEAR_LOOP if and 8@ == 0 00F2: actor $PLAYER_ACTOR near_actor 1@ radius 1.5 1.5 0 else_jump @BEAR_322 0812: AS_actor 1@ perform_animation "FightA_3" IFP_file "PED" 4.0 loopA 1 lockX 1 lockY 1 lockF 0 time -1 // versionB 8@ = 1 jump @BEAR_324
:BEAR_322 if and 8@ == 1 80F2: not actor $PLAYER_ACTOR near_actor 1@ radius 1.7 1.7 0 else_jump @BEAR_324 0812: AS_actor 1@ perform_animation "BBALL_run" IFP_file "BSKTBALL" 4.0 loopA 1 lockX 1 lockY 1 lockF 0 time -1 // versionB 8@ = 0 |
Try the script below. I used again the BSKTBALL animation and at this time the "FightA_3" of IFP_file "PED" Then change the animations with yours | CODE | {$CLEO .cs}
//-------------MAIN--------------- thread 'BEAR'
:BEAR_11 wait 0 if Player.Defined($PLAYER_CHAR) else_jump @BEAR_11 if $ONMISSION == 0 else_jump @BEAR_11 if 00FF: actor $PLAYER_ACTOR sphere 0 in_sphere -696.9056 -2102.9678 26.2662 radius 60.0 60.0 60.0 on_foot else_jump @BEAR_11 023C: load_special_actor 'BEAR' as 5 // models 290-299 wait 5 04ED: load_animation "BSKTBALL"
:BEAR_117 wait 0 if and 023D: special_actor 5 loaded 04EE: animation "BSKTBALL" loaded else_jump @BEAR_117 1@ = Actor.Create(Mission1, #SPECIAL05, -594.8727, -2067.8113, 42.0035) Actor.Angle(1@) = 254.662 Actor.Health(1@) = 10000 0446: set_actor 1@ immune_to_headshots 0 04D8: set_actor 1@ drowns_in_water 0 0946: set_actor 1@ actions_uninterupted_by_weapon_fire 1 060B: set_actor 1@ decision_maker_to 32 03FE: set_actor 1@ money 0 wait 500 0639: AS_actor 1@ rotate_to_actor $PLAYER_ACTOR wait 1500 $BEAR_ACTOR = Actor.Health(1@) $BEAR_ACTOR /= 40 03C4: set_status_text $BEAR_ACTOR type 1 GXT 'NA' // global_variable 0296: unload_special_actor 5 0812: AS_actor 1@ perform_animation "BBALL_run" IFP_file "BSKTBALL" 4.0 loopA 1 lockX 1 lockY 1 lockF 0 time -1 // versionB 8@ = 0
:BEAR_321 wait 0 if Player.Defined($PLAYER_CHAR) else_jump @BEAR_410 if not Actor.Dead(1@) else_jump @BEAR_431 if 00F2: actor $PLAYER_ACTOR near_actor 1@ radius 200.0 200.0 0 else_jump @BEAR_410 if and 8@ == 0 00F2: actor $PLAYER_ACTOR near_actor 1@ radius 1.5 1.5 0 else_jump @BEAR_322 0812: AS_actor 1@ perform_animation "FightA_3" IFP_file "PED" 4.0 loopA 1 lockX 1 lockY 1 lockF 0 time -1 // versionB 8@ = 1 jump @BEAR_324
:BEAR_322 if and 8@ == 1 80F2: not actor $PLAYER_ACTOR near_actor 1@ radius 1.7 1.7 0 else_jump @BEAR_324 0812: AS_actor 1@ perform_animation "BBALL_run" IFP_file "BSKTBALL" 4.0 loopA 1 lockX 1 lockY 1 lockF 0 time -1 // versionB 8@ = 0
:BEAR_324 3@ = 1.0 if 00F2: actor $PLAYER_ACTOR near_actor 1@ radius 8.0 8.0 0 else_jump @BEAR_325 3@ = 0.5
:BEAR_325 if 0611: actor 1@ performing_animation "BBALL_run" else_jump @BEAR_327 0393: actor 1@ perform_animation "BBALL_run" at 3@ times_normal_rate
:BEAR_327 Actor.StorePos(1@, 11@, 12@, 13@) Actor.StorePos($PLAYER_ACTOR, 21@, 22@, 23@) 0063: 11@ -= 21@ // (float) 0063: 12@ -= 22@ // (float) 0604: get_Z_angle_for_point 11@ 12@ store_to 30@ 30@ += 180.0 Actor.Angle(1@) = 30@
:BEAR_377 if or 051A: actor 1@ damaged_by_actor $PLAYER_ACTOR 0457: player $PLAYER_CHAR aiming_at_actor 1@ $BEAR_ACTOR = Actor.Health(1@) $BEAR_ACTOR /= 25 if 0 >= $BEAR_ACTOR then 0829: actor 1@ perform_animation "BBALL_react_miss" IFP_file "BSKTBALL" rate 4.0 time 0 and_dies wait 1000 0792: disembark_instantly_actor 1@ 05BE: AS_kill_actor 1@ jump @BEAR_431 end jump @BEAR_321
:BEAR_410 Actor.RemoveReferences(1@) 0151: remove_status_text $BEAR_ACTOR 065C: release_decision_maker 32 jump @BEAR_11
:BEAR_431 Actor.RemoveReferences(1@) 0151: remove_status_text $BEAR_ACTOR 0A93: end_custom_thread | This post has been edited by ZAZ on Wednesday, May 11 2011, 17:28
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
ZAZ  |
Posted: Wednesday, May 11 2011, 19:34
|
Kernlochbohrer

Group: Members
Joined: Jan 10, 2005



|
| QUOTE (tysman @ May 11 2011, 18:14) | Thanks works like a charm so are we ready to hurt CJ? | | CODE | {$CLEO .cs}
//-------------MAIN--------------- thread 'BEAR'
:BEAR_11 wait 0 if Player.Defined($PLAYER_CHAR) else_jump @BEAR_11 if $ONMISSION == 0 else_jump @BEAR_11 if 00FF: actor $PLAYER_ACTOR sphere 0 in_sphere -696.9056 -2102.9678 26.2662 radius 60.0 60.0 60.0 on_foot else_jump @BEAR_11 023C: load_special_actor 'BEAR' as 5 // models 290-299 wait 5 04ED: load_animation "BSKTBALL"
:BEAR_117 wait 0 if and 023D: special_actor 5 loaded 04EE: animation "BSKTBALL" loaded else_jump @BEAR_117 1@ = Actor.Create(Mission1, #SPECIAL05, -594.8727, -2067.8113, 42.0035) Actor.Angle(1@) = 254.662 Actor.Health(1@) = 10000 0446: set_actor 1@ immune_to_headshots 0 04D8: set_actor 1@ drowns_in_water 0 0946: set_actor 1@ actions_uninterupted_by_weapon_fire 1 060B: set_actor 1@ decision_maker_to 32 03FE: set_actor 1@ money 0 wait 500 0639: AS_actor 1@ rotate_to_actor $PLAYER_ACTOR wait 1500 $BEAR_ACTOR = Actor.Health(1@) $BEAR_ACTOR /= 40 03C4: set_status_text $BEAR_ACTOR type 1 GXT 'NA' // global_variable 0296: unload_special_actor 5 0812: AS_actor 1@ perform_animation "BBALL_run" IFP_file "BSKTBALL" 4.0 loopA 1 lockX 1 lockY 1 lockF 0 time -1 // versionB 8@ = 0
:BEAR_321 wait 0 if Player.Defined($PLAYER_CHAR) else_jump @BEAR_410 if not Actor.Dead(1@) else_jump @BEAR_431 if 00F2: actor $PLAYER_ACTOR near_actor 1@ radius 200.0 200.0 0 else_jump @BEAR_410 if and 8@ == 0 00F2: actor $PLAYER_ACTOR near_actor 1@ radius 1.5 1.5 0 else_jump @BEAR_322 0812: AS_actor 1@ perform_animation "FightA_3" IFP_file "PED" 4.0 loopA 1 lockX 1 lockY 1 lockF 0 time -1 // versionB 8@ = 1 jump @BEAR_324
:BEAR_322 if and 8@ == 1 80F2: not actor $PLAYER_ACTOR near_actor 1@ radius 1.7 1.7 0 else_jump @BEAR_324 0812: AS_actor 1@ perform_animation "BBALL_run" IFP_file "BSKTBALL" 4.0 loopA 1 lockX 1 lockY 1 lockF 0 time -1 // versionB 8@ = 0
:BEAR_324 3@ = 1.0 if 00F2: actor $PLAYER_ACTOR near_actor 1@ radius 8.0 8.0 0 else_jump @BEAR_325 3@ = 0.5
:BEAR_325 if 0611: actor 1@ performing_animation "BBALL_run" else_jump @BEAR_326 0393: actor 1@ perform_animation "BBALL_run" at 3@ times_normal_rate
:BEAR_326 if 0611: actor 1@ performing_animation "FightA_3" else_jump @BEAR_335 0393: actor 1@ perform_animation "FightA_3" at 0.5 times_normal_rate 0613: 31@ = actor 1@ animation "FightA_3" time if and 31@ > 0.4 0.5 > 31@ 00F2: actor $PLAYER_ACTOR near_actor 1@ radius 1.5 1.5 0 004D: jump_if_false @BEAR_335 04DD: 7@ = actor $PLAYER_ACTOR armour if 7@ > 0 jf @BEAR_328 035F: actor $PLAYER_ACTOR armour += -5 jump @BEAR_335
:BEAR_328 0851: set_actor $PLAYER_ACTOR decrease_health_by 5 flag 1 jump @BEAR_335
:BEAR_335 Actor.StorePos(1@, 11@, 12@, 13@) Actor.StorePos($PLAYER_ACTOR, 21@, 22@, 23@) 0063: 11@ -= 21@ // (float) 0063: 12@ -= 22@ // (float) 0604: get_Z_angle_for_point 11@ 12@ store_to 30@ 30@ += 180.0 Actor.Angle(1@) = 30@
:BEAR_377 if or 051A: actor 1@ damaged_by_actor $PLAYER_ACTOR 0457: player $PLAYER_CHAR aiming_at_actor 1@ $BEAR_ACTOR = Actor.Health(1@) $BEAR_ACTOR /= 25 if 0 >= $BEAR_ACTOR then 0829: actor 1@ perform_animation "BBALL_react_miss" IFP_file "BSKTBALL" rate 4.0 time 0 and_dies wait 1000 0792: disembark_instantly_actor 1@ 05BE: AS_kill_actor 1@ jump @BEAR_431 end jump @BEAR_321
:BEAR_410 Actor.RemoveReferences(1@) 0151: remove_status_text $BEAR_ACTOR 065C: release_decision_maker 32 jump @BEAR_11
:BEAR_431 Actor.RemoveReferences(1@) 0151: remove_status_text $BEAR_ACTOR 0A93: end_custom_thread |
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
tysman  |
Posted: Wednesday, May 11 2011, 19:49
|
Mark Chump

Group: Members
Joined: Mar 20, 2009


|
Thanks again it works great. Just a question is there a way to make CJ make an injured sound when his health is going down? Full Code | CODE | // This file was decompiled using sascm.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007
{$VERSION 3.1.0027} {$CLEO .cs}
//-------------MAIN--------------- thread 'BEAR'
:BEAR_11 wait 0 if Player.Defined($PLAYER_CHAR) else_jump @BEAR_11 if $ONMISSION == 0 else_jump @BEAR_11 if 00FF: actor $PLAYER_ACTOR sphere 0 in_sphere -696.9056 -2102.9678 26.2662 radius 60.0 60.0 60.0 on_foot else_jump @BEAR_11 023C: load_special_actor 'BEAR' as 5 // models 290-299 wait 5 04ED: load_animation "BEAR_ANIMATION"
:BEAR_117 wait 0 if and 023D: special_actor 5 loaded 04EE: animation "BEAR_ANIMATION" loaded else_jump @BEAR_117 1@ = Actor.Create(Mission1, #SPECIAL05, -594.8727, -2067.8113, 42.0035) Actor.Angle(1@) = 254.662 Actor.Health(1@) = 6000 0446: set_actor 1@ immune_to_headshots 0 04D8: set_actor 1@ drowns_in_water 0 0946: set_actor 1@ actions_uninterupted_by_weapon_fire 1 060B: set_actor 1@ decision_maker_to 32 03FE: set_actor 1@ money 0 0A1D: AS_actor 1@ rotate_to_and_look_at_actor $PLAYER_ACTOR wait 100 0615: define_AS_pack_begin 15@ 0618: assign_actor 1@ to_AS_pack 15@ 0605: actor -1 perform_animation_sequence "BEAR_STAND" IFP_file "BEAR_ANIMATION" 4.0 loop 1 0 0 0 time -1 // versionA 0616: define_AS_pack_end 15@ 061B: remove_references_to_AS_pack 15@ wait 200 $BEAR_ACTOR = Actor.Health(1@) $BEAR_ACTOR /= 40 03C4: set_status_text $BEAR_ACTOR type 1 GXT 'NA' // global_variable wait 200 0812: AS_actor 1@ perform_animation "BEAR_RUN" IFP_file "BEAR_ANIMATION" 4.0 loopA 1 lockX 1 lockY 1 lockF 0 time -1 // versionB 0296: unload_special_actor 5 8@ = 0
:BEAR_321 wait 0 if Player.Defined($PLAYER_CHAR) else_jump @BEAR_410 if not Actor.Dead(1@) else_jump @BEAR_431 if 00F2: actor $PLAYER_ACTOR near_actor 1@ radius 200.0 200.0 0 else_jump @BEAR_410 if and 8@ == 0 00F2: actor $PLAYER_ACTOR near_actor 1@ radius 1.5 1.5 0 else_jump @BEAR_322 0812: AS_actor 1@ perform_animation "BEAR_ATTACK" IFP_file "BEAR_ANIMATION" 4.0 loopA 1 lockX 1 lockY 1 lockF 0 time -1 // versionB 8@ = 1 jump @BEAR_324
:BEAR_322 if and 8@ == 1 80F2: not actor $PLAYER_ACTOR near_actor 1@ radius 1.7 1.7 0 else_jump @BEAR_324 0812: AS_actor 1@ perform_animation "BEAR_RUN" IFP_file "BEAR_ANIMATION" 4.0 loopA 1 lockX 1 lockY 1 lockF 0 time -1 // versionB 8@ = 0
:BEAR_324 3@ = 1.0 if 00F2: actor $PLAYER_ACTOR near_actor 1@ radius 8.0 8.0 0 else_jump @BEAR_325 3@ = 0.5
:BEAR_325 if 0611: actor 1@ performing_animation "BEAR_RUN" else_jump @BEAR_326 0393: actor 1@ perform_animation "BEAR_RUN" at 3@ times_normal_rate
:BEAR_326 if 0611: actor 1@ performing_animation "BEAR_ATTACK" else_jump @BEAR_335 0393: actor 1@ perform_animation "BEAR_ATTACK" at 0.5 times_normal_rate 0613: 31@ = actor 1@ animation "BEAR_ATTACK" time if and 31@ > 0.4 0.5 > 31@ 00F2: actor $PLAYER_ACTOR near_actor 1@ radius 1.5 1.5 0 004D: jump_if_false @BEAR_335 04DD: 7@ = actor $PLAYER_ACTOR armour if 7@ > 0 else_jump @BEAR_328 035F: actor $PLAYER_ACTOR armour += -5 jump @BEAR_335
:BEAR_328 0851: set_actor $PLAYER_ACTOR decrease_health_by 5 flag 1 jump @BEAR_335
:BEAR_335 Actor.StorePos(1@, 11@, 12@, 13@) Actor.StorePos($PLAYER_ACTOR, 21@, 22@, 23@) 0063: 11@ -= 21@ // (float) 0063: 12@ -= 22@ // (float) 0604: get_Z_angle_for_point 11@ 12@ store_to 30@ 30@ += 180.0 Actor.Angle(1@) = 30@
:BEAR_377 if or 051A: actor 1@ damaged_by_actor $PLAYER_ACTOR 0457: player $PLAYER_CHAR aiming_at_actor 1@ $BEAR_ACTOR = Actor.Health(1@) $BEAR_ACTOR /= 25 if 0 >= $BEAR_ACTOR then 0829: actor 1@ perform_animation "BEAR_DEATH" IFP_file "BEAR_ANIMATION" rate 4.0 time 0 and_dies 0321: kill_actor 1@ jump @BEAR_431 end jump @BEAR_321
:BEAR_410 Actor.RemoveReferences(1@) 0151: remove_status_text $BEAR_ACTOR 065C: release_decision_maker 32 jump @BEAR_11
:BEAR_431 Actor.RemoveReferences(1@) 0151: remove_status_text $BEAR_ACTOR 0A93: end_custom_thread
| This post has been edited by tysman on Wednesday, May 11 2011, 20:06
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
tysman  |
Posted: Wednesday, May 11 2011, 20:45
|
Mark Chump

Group: Members
Joined: Mar 20, 2009


|
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
Pages:
(8) « First ... 6 7 [8]
Track this topic
Receive email notification when a reply has been made to this topic and you are not active on the board.
Subscribe to this forum
Receive email notification when a new topic is posted in this forum and you are not active on the board.
Download / Print this Topic
Download this topic in different formats or view a printer friendly version.
| |
 |
|
 |
|
|
|
|