IMG

 
IMG
IMG   IMG
  Welcome to GTAForums! Be sure to check out the Grand Theft Auto V Forum.

You are not registered! (If you are, click here to login) Registering is fast, free and easy and allows you to instantly reply to any topic on GTAForums.
Why wait? Click here to register your own unique username and become part of the ever-growing community!


( Log In | Register | Revalidate Validation E-mail )
Quick Log-In:
  IMG
       
>
Forum Rules GTA Modification Forums

Please post mod releases in the Mod Showroom

GTAGarage.com
free mod hosting from GTANet, simply login with your GTAForums account details

GTAModding.com
GTANet's modding wiki

GTA Modding Chatroom
provided by irc.gtanet.com (Don't have an IRC client? Click here)


Pages: (8) « First ... 6 7 [8]   ( Go to first unread post ) Reply to this topicStart new topicStart Poll

 Bear Mod (help needed)

 Bear Mod CLEO help
 
tysman  
Posted: Monday, May 9 2011, 21:24
Quote Post


Mark Chump
Group Icon
Group: Members
Joined: Mar 20, 2009

cd.gif

XXXXX



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 smile.gif 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
PM
  Top
 

 
ZAZ  
Posted: Monday, May 9 2011, 21:42
Quote Post


Kernlochbohrer
Group Icon
Group: Members
Joined: Jan 10, 2005

eu.gif

Member Award




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 smile.gif 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:
CODE
4@ = 5.0


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
Users WebsitePM
  Top
 

 
tysman  
Posted: Monday, May 9 2011, 21:49
Quote Post


Mark Chump
Group Icon
Group: Members
Joined: Mar 20, 2009

cd.gif

XXXXX



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
PM
  Top
 

 
tysman  
Posted: Tuesday, May 10 2011, 17:54
Quote Post


Mark Chump
Group Icon
Group: Members
Joined: Mar 20, 2009

cd.gif

XXXXX



Sorry for double post, I figured out why the bear was running up towards the sky then slowly coming down. I had to remove these codes
CODE

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

apparently the bear is up in the air using the first Z axis of 10.0 then it uses the next one which is 1.0 where the bear is on the ground, so I removed them both and now the bear runs on the ground smile.gif OK I am ready for hard math coding smile.gif
PM
  Top
 

 
ZAZ  
Posted: Tuesday, May 10 2011, 19:16
Quote Post


Kernlochbohrer
Group Icon
Group: Members
Joined: Jan 10, 2005

eu.gif

Member Award




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
Users WebsitePM
  Top
 

 
tysman  
Posted: Tuesday, May 10 2011, 19:20
Quote Post


Mark Chump
Group Icon
Group: Members
Joined: Mar 20, 2009

cd.gif

XXXXX



Hey thanks now the bear slows down when it is close to CJ smile.gif 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 smile.gif

This post has been edited by tysman on Tuesday, May 10 2011, 21:40
PM
  Top
 

 
tysman  
Posted: Wednesday, May 11 2011, 17:17
Quote Post


Mark Chump
Group Icon
Group: Members
Joined: Mar 20, 2009

cd.gif

XXXXX



I know double post, I really need to stop doing it. Hey ZAZ I noticed you have allot of guys to help on this Forum site, so help me with the math coding when ever you are free. smile.gif OH I haven't really said it before but, I really appreciate you helping me with this mod smile.gif
PM
  Top
 

 
ZAZ  
Posted: Wednesday, May 11 2011, 17:24
Quote Post


Kernlochbohrer
Group Icon
Group: Members
Joined: Jan 10, 2005

eu.gif

Member Award




QUOTE (tysman @ May 10 2011, 19:20)
Hey thanks now the bear slows down when it is close to CJ smile.gif  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 smile.gif

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
Users WebsitePM
  Top
 

 
tysman  
Posted: Wednesday, May 11 2011, 17:40
Quote Post


Mark Chump
Group Icon
Group: Members
Joined: Mar 20, 2009

cd.gif

XXXXX



It works great but the animation for the attack is to fast the bear moves his paw to hurt CJ a little to fast
PM
  Top
 

 
ZAZ  
Posted: Wednesday, May 11 2011, 18:03
Quote Post


Kernlochbohrer
Group Icon
Group: Members
Joined: Jan 10, 2005

eu.gif

Member Award




QUOTE (tysman @ May 11 2011, 17:40)
It works great but the animation for the attack is to fast the bear moves his paw to hurt CJ a little to fast

Do you mean the "FightA_3" of IFP_file "PED" ?
or do you have a BEAR_FIGHT animation?
Is the animation itself to fast or does it repeat to fast?
Users WebsitePM
  Top
 

 
tysman  
Posted: Wednesday, May 11 2011, 18:05
Quote Post


Mark Chump
Group Icon
Group: Members
Joined: Mar 20, 2009

cd.gif

XXXXX



it's the BEAR_ATTACK animation it is performing it to fast if it was 0.5 like the run animation it would be perfect smile.gif
PM
  Top
 

 
ZAZ  
Posted: Wednesday, May 11 2011, 18:09
Quote Post


Kernlochbohrer
Group Icon
Group: Members
Joined: Jan 10, 2005

eu.gif

Member Award




QUOTE (tysman @ May 11 2011, 18:05)
it's the BEAR_ATTACK animation it is performing it to fast if it was 0.5 like the run animation it would be perfect smile.gif

so add the animation speed codes
CODE
: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_327
0393: actor 1@ perform_animation "FightA_3" at 0.5 times_normal_rate

:BEAR_327
Users WebsitePM
  Top
 

 
tysman  
Posted: Wednesday, May 11 2011, 18:14
Quote Post


Mark Chump
Group Icon
Group: Members
Joined: Mar 20, 2009

cd.gif

XXXXX



Thanks works like a charm smile.gif so are we ready to hurt CJ?
PM
  Top
 

 
ZAZ  
Posted: Wednesday, May 11 2011, 19:34
Quote Post


Kernlochbohrer
Group Icon
Group: Members
Joined: Jan 10, 2005

eu.gif

Member Award




QUOTE (tysman @ May 11 2011, 18:14)
Thanks works like a charm smile.gif 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
Users WebsitePM
  Top
 

 
tysman  
Posted: Wednesday, May 11 2011, 19:49
Quote Post


Mark Chump
Group Icon
Group: Members
Joined: Mar 20, 2009

cd.gif

XXXXX



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
PM
  Top
 

 
Wesser  
Posted: Wednesday, May 11 2011, 20:40
Quote Post


The complexity simplifier, the efficiency optimizer
Group Icon
Group: Members
Joined: Aug 19, 2006

eu.gif

Member Award




@tysman, you really need to learn some coding tutorials before posting every ideas thought at moment. I have nothing wrong with you but you're bothering too much because that wouldn't be your mod at all! turn.gif
PMMSNPlayStation Network
  Top
 

 
tysman  
Posted: Wednesday, May 11 2011, 20:45
Quote Post


Mark Chump
Group Icon
Group: Members
Joined: Mar 20, 2009

cd.gif

XXXXX



I know sorry, I am just not that good at coding, I know the basics but not the hard stuff. I will say in the credits that ZAZ helped more than he should of. I figured out how to make CJ say hurt sounds when his health is going down, all I had to do was add the following code twice. One for Armor going down and the other for health
CODE

05C1: AS_actor $PLAYER_ACTOR speak_from_audio_table 344

My mod is finally finished, ZAZ you are the man biggrin.gif biggrin.gif you deserve lots of cookie.gif cookie.gif cookie.gif cookie.gif cookie.gif cookie.gif cookie.gif cookie.gif I will definitely put your name in the credits, for your hard work. Thanks again for everything


This post has been edited by tysman on Wednesday, May 11 2011, 23:25
PM
  Top
 

 
dtd190  
Posted: Thursday, May 19 2011, 20:01
Quote Post


Player Hater
Group Icon
Group: Members
Joined: May 16, 2011

XXXXX



its a great mod colgate.gif
PM
  Top
 

 
Dinhul  
Posted: Friday, Jul 27 2012, 07:08
Quote Post


Ree_K
Group Icon
Group: Members
Joined: Apr 30, 2011

ba.gif

XXXXX



QUOTE (tysman @ Wednesday, May 11 2011, 20:45)

My mod is finally finished ...


user posted image
http://i247.photobucket.com/albums/gg141/S...R/beargtasa.jpg

This is a fake screenshot ? confused.gif
why in the mod the bear dont stand up ?
is using the same skin and animation?
Bear in the screen seems much more dynamic and realistic.

sad.gif
Users WebsitePM
  Top
 

 

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)

0 Members:

Pages: (8) « First ... 6 7 [8] 

Topic Options Reply to this topicStart new topicStart Poll
Search topic for posted by (exact match)



 
IMG IMG