Quantcast

Jump to content

» «
Photo

need help with this script

5 replies to this topic
GtaHellmodded
  • GtaHellmodded

    Coding

  • Members
  • Joined: 05 Jul 2013
  • None

#1

Posted 17 July 2014 - 02:23 PM

ok, i got a problem about this script, i don't know but when i loading game done my game crash, 

here this script

// This file was decompiled using SASCM.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007
{$CLEO .cs}

//-------------MAIN---------------
thread 'DODGE' 
wait 0 
04ED: load_animation "SPIDER" 

:DODGE_1
wait 0 
if 
   Player.Defined($PLAYER_CHAR)
jf @DODGE_1
0AB5: store_actor $PLAYER_ACTOR closest_vehicle_to 10@ closest_ped_to 1@
if or
   Actor.Animation(1@) == "FIGHTIDLE"
   Actor.Animation(1@) == "FIGHTC_IDLE"
jf @DODGE_1
if or
02D8:   actor $PLAYER_ACTOR current_weapon == 0 
02D8:   actor $PLAYER_ACTOR current_weapon == 1 
wait 0
jf @DODGE_1
jump @DODGE_6
 

:DODGE_2
if 
   Actor.Animation(1@) == "FIGHTA_1"
jf @DODGE_2 
if 
0613: 11@ = actor 1@ animation "FIGHTA_1" time 
if and
  11@ > 0.0 
  0.06 > 11@
 jf @DODGE_2
 jump @DODGE_5

:DODGE_3 
 wait 0 
if 
   Actor.Animation(1@) == "FIGHTA_2"
jf @DODGE_4 
if 
0613: 12@ = actor 1@ animation "FIGHTA_2" time 
if and
  12@ > 0.0 
  0.06 > 12@ 
  jf @DODGE_3 
  jump @DODGE_5

:DODGE_4  
  wait 0 
if 
   Actor.Animation(1@) == "FIGHTA_3"
jf @DODGE_1
if 
0613: 13@ = actor 1@ animation "FIGHTA_3" time 
if and
  13@ > 0.0 
  0.06 > 13@
 jf @DODGE_7      
 jump @DODGE_5

:DODGE_5
if
00F3:   actor 1@ near_actor $PLAYER_ACTOR radius 1.7 1.7 0.0 on_foot 
jf @DODGE_2
015D: set_gamespeed 0.2
if 
0AB0:   key_pressed 52 
jf @DODGE_1 
0619: enable_actor $PLAYER_ACTOR collision_detection 0 
17@ = Actor.Angle(1@)
17@ += 180.0 
Actor.Angle($PLAYER_ACTOR) = 17@ 
0812: AS_actor $PLAYER_ACTOR perform_animation "DodgeR" IFP_file "SPIDER" 4.0 loopA 0 lockX 1 lockY 1 lockF 0 time -1 // versionB 
wait 500
015D: set_gamespeed 1.0
0619: enable_actor $PLAYER_ACTOR collision_detection 1
jump @DODGE_1

:DODGE_7
wait 0 
if or
   Actor.Animation(1@) == "SPRINT_PANIC"
   Actor.Animation(1@) == "WOMAN_RUNPANIC"
80F3:   not actor 1@ near_actor $PLAYER_ACTOR radius 20.0 20.0 0.0 on_foot 
jf @DODGE_6 
Actor.RemoveReferences(1@)
jump @DODGE_1 

:DODGE_6
wait 0 
if 
   Player.Defined($PLAYER_CHAR)
jf @DODGE_1 
if 
   Actor.Dead(1@)
jf @DODGE_2 
Actor.RemoveReferences(1@)
jump @DODGE_1

 


please help me fix this 


Muxan
  • Muxan

    Player Hater

  • Members
  • Joined: 01 Jul 2014
  • Russia

#2

Posted 17 July 2014 - 02:27 PM

All simple,you dont have ckeck for actor 1@ defined.And no wait 0 at loop jump doodge_2.

ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union

#3

Posted 17 July 2014 - 04:31 PM

Anim file "SPIDER" is a custom animation file. Are you shure that it works? If not, then write a little testscript to check it out
I don't have this animation, so i used animation file "STRIP" and the animation "strip_E"
:DODGE_animload_1
wait 0
if
84EE: not  animation "STRIP" loaded
jf @DODGE_2
04ED: load_animation "STRIP" 
jump @DODGE_animload_1

0812: AS_actor $PLAYER_ACTOR perform_animation "strip_E" IFP_file "STRIP" 4.0 loopA 0 lockX 1 lockY 1 lockF 0 time -1 // versionB 

 

Test the script below, then change the animation entries.
And have a look how i find the random actor
{$CLEO .cs}
thread 'DODGE' 
wait 2000 

:DODGE_1// default loop
wait 0 
if 
   Player.Defined($PLAYER_CHAR)
jf @DODGE_1
04C4: store_coords_to 10@ 11@ 12@ from_actor $PLAYER_ACTOR with_offset 0.0 2.0 0.0
if
   0AE1:   1@ = random_actor_near_point 10@ 11@ 12@ in_radius 8.0 find_next 0 pass_deads 1 // CLEO 4 opcode
jf @DODGE_1
if
    8118:   not actor 1@ dead 
jf @DODGE_cleanup
if or
   Actor.Animation(1@) == "FIGHTIDLE"
   Actor.Animation(1@) == "FIGHTC_IDLE"
jf @DODGE_cleanup
if or
02D8:   actor $PLAYER_ACTOR current_weapon == 0 
02D8:   actor $PLAYER_ACTOR current_weapon == 1
jf @DODGE_cleanup
00BA: show_text_styled GXT 'fem_on' time 500 style 4

:DODGE_animload_1
wait 0
if
84EE: not  animation "STRIP" loaded
jf @DODGE_2
04ED: load_animation "STRIP" 
jump @DODGE_animload_1


:DODGE_2//loop after actor was found
wait 0 
if 
   Player.Defined($PLAYER_CHAR)
jf @DODGE_cleanup
if
8118:   not actor 1@ dead
jf @DODGE_cleanup
if
00F3:   actor 1@ near_actor $PLAYER_ACTOR radius 10.0 10.0 0 on_foot
jf @DODGE_cleanup
if 
   Actor.Animation(1@) == "FIGHTA_1"
jf @DODGE_3 
if 
0613: 11@ = actor 1@ animation "FIGHTA_1" time 
if and
  11@ > 0.0 
  0.06 > 11@
jf @DODGE_2
jump @DODGE_5

:DODGE_3 
if 
   Actor.Animation(1@) == "FIGHTA_2"
jf @DODGE_4 
if 
0613: 12@ = actor 1@ animation "FIGHTA_2" time 
if and
  12@ > 0.0 
  0.06 > 12@ 
jf @DODGE_2 
jump @DODGE_5

:DODGE_4 
if 
   Actor.Animation(1@) == "FIGHTA_3"
jf @DODGE_2
if 
0613: 13@ = actor 1@ animation "FIGHTA_3" time 
if and
  13@ > 0.0 
  0.06 > 13@
jf @DODGE_7      
jump @DODGE_5

:DODGE_5
if
00F3:   actor 1@ near_actor $PLAYER_ACTOR radius 1.7 1.7 0 on_foot 
jf @DODGE_2
015D: set_gamespeed 0.2
if 
0AB0:   key_pressed 52 // 4 key
jf @DODGE_2
00BA: show_text_styled GXT 'fem_ok' time 500 style 4 
0619: enable_actor $PLAYER_ACTOR collision_detection 0 
17@ = Actor.Angle(1@)
17@ += 180.0 
Actor.Angle($PLAYER_ACTOR) = 17@ 
0812: AS_actor $PLAYER_ACTOR perform_animation "strip_E" IFP_file "STRIP" 4.0 loopA 0 lockX 1 lockY 1 lockF 0 time -1 // versionB 
wait 500
015D: set_gamespeed 1.0
0619: enable_actor $PLAYER_ACTOR collision_detection 1
jump @DODGE_2

:DODGE_7 
if or
   Actor.Animation(1@) == "SPRINT_PANIC"
   Actor.Animation(1@) == "WOMAN_RUNPANIC" 
jf @DODGE_2 

:DODGE_cleanup
Actor.RemoveReferences(1@)
015D: set_gamespeed 1.0
00BA: show_text_styled GXT 'fem_off' time 500 style 4
jump @DODGE_1
I added text messages to see what happens
"ON" will be shown if an actor was found who does FIGHTIDLE and have weapon 0 or 1
"OK" will be shown after key_press 52 to let the player do animation

"OFF" will be shown if an actor was found but doesn't do FIGHTIDLE or doesn't have weapon 0 or 1 or isn't in range of 10.0 units or is dead
"OFF" shows if actor was found but can't pass the needed conditions, so the code goes to the cleanup and can search again for a random actor
  • GtaHellmodded likes this

GtaHellmodded
  • GtaHellmodded

    Coding

  • Members
  • Joined: 05 Jul 2013
  • None

#4

Posted 18 July 2014 - 01:13 AM Edited by GtaHellmodded, 18 July 2014 - 01:39 AM.

okay thank ZAZ it work, but it got some wrong is : i can do that animation once time in slow motion , and second time player don't do that animation and it still in slow motion !  :yawn:


ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union

#5

Posted 18 July 2014 - 01:30 PM

You asked for help with these words:
"ok, i got a problem about this script, i don't know but when i loading game done my game crash,
here this script"

I just made your script working in a propper way, means,
it's possible to run your kernel codes in the requested moment
015D: set_gamespeed 0.2
if 
0AB0:   key_pressed 52 
jf @DODGE_ 
0619: enable_actor $PLAYER_ACTOR collision_detection 0 
17@ = Actor.Angle(1@)
17@ += 180.0 
Actor.Angle($PLAYER_ACTOR) = 17@ 
0812: AS_actor $PLAYER_ACTOR perform_animation "DodgeR" IFP_file "SPIDER" 4.0 loopA 0 lockX 1 lockY 1 lockF 0 time -1 // versionB 
wait 500
015D: set_gamespeed 1.0
0619: enable_actor $PLAYER_ACTOR collision_detection 1
so find and correct the problem in this part

maybe place the slowmotion after the key_press

or maybe you want that the animation will be repeated
so let the animation loop, set loopA param to 1

i don't know what your plan is

GtaHellmodded
  • GtaHellmodded

    Coding

  • Members
  • Joined: 05 Jul 2013
  • None

#6

Posted 18 July 2014 - 01:42 PM

by the way thanks you verymuch ZAZ,i'll find it by myself 





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users