Jump to content

CLEO3-0612: set_actor xx@ animation.


Recommended Posts

Hi! biggrin.gif

After about 100 mods for GTA-SA, including the Gundam and Misterix (with Zeb89)

for my new mod (Atlantis) I started to use some 'CLEO3.

 

So here's my problem: I gave an animation to a ped,

but remains firm as a pile of light...

user posted image

 

 

thread 'SPW_PD2':STARTwait 0 msifPlayer.Defined($PLAYER_CHAR)jf @STARTif 00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere -2490.0 1673.7 4.72 radius 100.0 100.0 50.0jf @STARTif$ACTIVEINTERIOR == 0jf @START0247: load_model #SWMOTR404ED: load_animation "COWER":ACTIONwait 500 ms009A: 2@ = create_actor_pedtype 4 model #SWMOTR4 at -2490.0 1673.7 4.720612: set_actor 2@ animation "COWER" paused 0 :ENDwait 0 ms004E: end_thread 

 

 

Remaining in the area, you can enlighten? smile.gif

Thank you! smile.gif

Edited by Automan
Link to comment
https://gtaforums.com/topic/383111-cleo3-0612-set_actor-xx-animation/
Share on other sites

spaceeinstein

When you load an animation, you load its file. "COWER" is in file "PED" which I think is already preloaded into the game. Here's an example

 

0605: actor 0@ perform_animation_sequence "COWER" IFP_file "PED" 4.0 loop 0 0 0 0 time -1

Thanks, but now the game crashed when I approached! smile.gif

 

 

:STARTwait 0 msifPlayer.Defined($PLAYER_CHAR)jf @STARTif 00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere -2490.0 1673.7 4.72 radius 100.0 100.0 50.0jf @STARTif$ACTIVEINTERIOR == 0jf @START0247: load_model #SWMOTR404ED: load_animation "COWER":ACTIONwait 500 ms009A: 2@ = create_actor_pedtype 4 model #SWMOTR4 at -2490.0 1673.7 4.720605: actor 2@ perform_animation_sequence "COWER" IFP_file "PED" 4.0 loop 0 0 0 0 time -1 :ENDwait 0 ms004E: end_thread 

 

Thanks! Now the game no crashes, but not there is still animation ... smile.gif

 

 

:STARTwait 0 msifPlayer.Defined($PLAYER_CHAR)jf @STARTif 00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere -2490.0 1673.7 4.72 radius 100.0 100.0 50.0jf @STARTif$ACTIVEINTERIOR == 0jf @START0247: load_model #SWMOTR4:ACTIONwait 500 ms009A: 2@ = create_actor_pedtype 4 model #SWMOTR4 at -2490.0 1673.7 4.720605: actor 2@ perform_animation_sequence "COWER" IFP_file "PED" 4.0 loop 0 0 0 0 time -1 :ENDwait 0 ms004E: end_thread

 

 

:STARTwait 0 ms077E: get_active_interior_to $ACTIVE_INTERIOR wait 150ifPlayer.Defined($PLAYER_CHAR)jf @STARTif00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere -2490.0 1673.7 4.72 radius 100.0 100.0 50.0jf @STARTif$ACTIVE_INTERIOR == 0jf @START0247: load_model #SWMOTR4:ACTIONwait 500 ms009A: 2@ = create_actor_pedtype 4 model #SWMOTR4 at -2490.0 1673.7 4.720605: actor 2@ perform_animation_sequence "COWER" IFP_file "PED" 4.0 loop 0 0 0 0 time -1:ENDwait 0 msjump @START

 

Works now?

Note: I have no Windows OS(again)

Edited by _VaNkAtA_
spaceeinstein

When you load a model you have to check if the model is loaded... Check the modding wiki for examples on how to create a ped.

 

:STARTwait 0 ms077E: get_active_interior_to $ACTIVE_INTERIOR wait 150ifPlayer.Defined($PLAYER_CHAR)jf @STARTif00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere -2490.0 1673.7 4.72 radius 100.0 100.0 50.0jf @STARTif$ACTIVE_INTERIOR == 0jf @START0247: load_model #SWMOTR4:ACTIONwait 500 ms009A: 2@ = create_actor_pedtype 4 model #SWMOTR4 at -2490.0 1673.7 4.720605: actor 2@ perform_animation_sequence "COWER" IFP_file "PED" 4.0 loop 0 0 0 0 time -1:ENDwait 0 msjump @START

 

Works now?

Note: I have no Windows OS(again)

The $ACTIVE_INTERIOR variable is already available without the get active interior thing

  • 2 weeks later...
spaceeinstein

Ok, I got this to work

 

 

{$CLEO}0000::STARTwait 0 msifPlayer.Defined($PLAYER_CHAR)jf @STARTif00FE:   actor $PLAYER_ACTOR sphere 1 in_sphere 54.3 782.38 1.47 radius 5.0 5.0 5.0jf @START077E: get_active_interior_to $ACTIVE_INTERIOR if$ACTIVE_INTERIOR == 0jf @START0247: load_model #SWMOTR4:ACTIONwait 0ifmodel.Available(#SWMOTR4)jf @ACTION009A: 0@ = create_actor_pedtype 4 model #SWMOTR4 at 54.3 782.38 1.470605: actor 0@ perform_animation_sequence "COWER" IFP_file "PED" 4.0 loop 1 0 0 0 time -1:END0A93: end_custom_thread

 

 

But one little bump and the animation is over. If you want to make him cower constantly no matter what, you have to check if the ped is using the cower animation.

Ok, I got this to work

 

 

{$CLEO}0000::STARTwait 0 msifPlayer.Defined($PLAYER_CHAR)jf @STARTif00FE:   actor $PLAYER_ACTOR sphere 1 in_sphere 54.3 782.38 1.47 radius 5.0 5.0 5.0jf @START077E: get_active_interior_to $ACTIVE_INTERIOR if$ACTIVE_INTERIOR == 0jf @START0247: load_model #SWMOTR4:ACTIONwait 0ifmodel.Available(#SWMOTR4)jf @ACTION009A: 0@ = create_actor_pedtype 4 model #SWMOTR4 at 54.3 782.38 1.470605: actor 0@ perform_animation_sequence "COWER" IFP_file "PED" 4.0 loop 1 0 0 0 time -1:END0A93: end_custom_thread

 

 

But one little bump and the animation is over. If you want to make him cower constantly no matter what, you have to check if the ped is using the cower animation.

yo cant you just use a loop with a check if hes doing cower or not?

Very good! biggrin.gif

This form of script:

 

{$CLEO}0000:(---)0A93: end_custom_thread

 

Instead of this:

 

{$VERSION 3.1.0027}{$CLEO .CS}thread 'name'(---)004E: end_thread 

 

has solved the problem with the peds:

user posted image

and between ped and sphere:

user posted image

 

But I do not remember where I saw the solution of this problem:

user posted image

when the player dies replaced ...

 

This repositioning of the camera does not work:

 

00A1: put_actor $PLAYER_ACTOR at 2027.1 996.5 10.820173: set_actor $PLAYER_ACTOR Z_angle_to -90.00001: wait 1000 ms015F: set_camera_position 2027.1 996.5 10.82 rotation 0.0 0.0 -90.0

 

There is another opcode better, or I who use this evil?...

spaceeinstein

The CJ spaghetti can be fixed if you prevent him from gaining/losing weight and muscle.

 

When you set_camera, you also have to point_camera.

You must use 0160 (point camera) or 0159 (camera on ped) if you want to change the current camera position because it seems that it's locked. Follow what spaceeinstein said and set the muscle\fat values to 0 or erase their opcodes.

I can not find opcode with muscle/fat...

 

With both the opcode the visual moves to 0 0 0 xyz and freezes...

 

00A1: put_actor $PLAYER_ACTOR at 2027.1 997.5 10.820173: set_actor $PLAYER_ACTOR Z_angle_to -90.00160: set_camera_point_at 2027.1 997.5 10.82 mode 2 

 

 

00A1: put_actor $PLAYER_ACTOR at 2027.1 997.5 10.820173: set_actor $PLAYER_ACTOR Z_angle_to -90.00159: camera_on_ped $PLAYER_ACTOR 15 2 

 

 

***

 

Problem solved with:

 

0373: set_camera_directly_behind_player

 

 

Now lacks only CJ Spaghetti! And if I do not want me, spaghetti! biggrin.gif

Edited by Automan

All opcodes and their values type or params number are stored in SB\data\sascm.ini. The muscle\fat weight is a stat value defined by an ID. You can find all stat values in Help->Contents->SCM Documentation->GTA SA->Statistics ID. What you need is to delete these opcodes from main.scm (if you use .cs files leave them).

 

062A: change_float_stat 23 to 50.0 062A: change_float_stat 21 to 200.0 

 

The first parameters mean respectively muscle and fat weight. If you don't want to delete them you can set their value to 0.0.

Thanks! wink.gif

I tried that, but the question remains:

 

{$CLEO}0000:$RADAR_1 = Marker.CreateIconWithoutSphere(42, -2806.5, 1847.8, 23.2)02A8: $RADAR_2 = create_marker 38 at 1500.0 1000.0 10.8302A8: $RADAR_3 = create_marker 40 at -2801.26 1942.52 21.002A8: $RADAR_4 = create_marker 16 at 16, 271.7 1859.3 8.8$RADAR_5 = Marker.CreateIconWithoutSphere(35, -2348.0, 1838.0, 9.5)062A: change_float_stat 23 to 0.0 062A: change_float_stat 21 to 0.0 0247: load_model #SOFYRIwait 500 ms09c7: change_player_model $PLAYER_CHAR #SOFYRI:END0A93: end_custom_thread

 

Back CJ 'spaghetti', instead dell'actor replaced...

If I try to put controls in the rerun replace, or crashes the game or the player is replaced continuously. sad.gif

I don't know. However you have to put 0248 (is_model_available) as a condition to check if the model is correctly loaded.

 

{$VERSION 3.1.0027}{$CLEO .cs}//-------------MAIN---------------thread 'MODEL' :MODEL_50001: wait 0 0247: load_model #SOFYRI 00D6: if 0248:  model #SOFYRI available 004D: jump_if_false @MODEL_5 09C7: change_player $PLAYER_CHAR model_to #SOFYRI 0A93: end_custom_thread 

 

If you can't resolve this annoying problem try to separate all model groups (1,2,...) with 3dsmax and then save them as some bodyparts (add them in player.img). In data\clothes.dat you can create new anim sets like gimpsuit and call them with 087B.

 

087B: set_player $PLAYER_CHAR clothes_texture "TEXTURE_NAME" model "MODEL_NAME" body_part 17 

 

Anyway, that code works correctly if you use a stripped .scm.

I tried to put an external command for reloaded the player, but the game stops:

 

 

{$CLEO}0000::LOADwait 0 ms0247: load_model #SOFYRI00D6: if 0248:  model #SOFYRI available 004D: jump_if_false @LOAD:STARTwait 500 ms09c7: change_player_model $PLAYER_CHAR #SOFYRI:CTRLwait 0 msIF00E1:   player 0 pressed_key 19 // look behindelse_jump @CTRLjump @START:END0A93: end_custom_thread

 

{$CLEO}0000::LOADwait 0 ms0247: load_model #SOFYRI00D6: if 0248:  model #SOFYRI available 004D: jump_if_false @LOAD:CTRLwait 0 msIF00E1:   player 0 pressed_key 19 // look behindelse_jump @CTRL:STARTwait 500 ms09c7: change_player_model $PLAYER_CHAR #SOFYRI0A93: end_custom_thread

 

{$CLEO}0000::LOADwait 0 ms0247: load_model #SOFYRI00D6: if 0248:  model #SOFYRI available 004D: jump_if_false @LOAD:CTRLwait 0 msIF00E1:   player 0 pressed_key 19 // look behindelse_jump @CTRL:STARTwait 500 ms09c7: change_player_model $PLAYER_CHAR #SOFYRI0A93: end_custom_thread

 

You've forgot one jump. smile.gif

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 0 User Currently Viewing
    0 members, 0 Anonymous, 0 Guests

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.