Coding

 Reply to this postStart new topic

Recieving current animation that character is playing

Astrocat
post Jul 9 2013, 06:12 PM
Post #1


The New Guy!

Posts: 2
Joined: 9-July 13



I'm new in this Cleo opcodes and developing.
I have searched the database of opcodes and couldn't find an opcode that loopes trought all of the animations and give me the correct one that the player is currently using.

All of the opcodes I have checked, requring the animation name. I need an opcode that loops trought ALL of the animations and gives me the correct animation that its currently playing.

Also if it's possible, to save the animation name to 1@ and make a loop that checks while you are playing if you changed the animation.
That means if the animation was WALK_IDLE changed to WALK_RUN it'd catch that insted of just ending the loop on one animation.
Go to the top of the page
 
+Quote Post
uokka
post Jul 10 2013, 01:59 AM
Post #2


Actually living entity

Posts: 143
From: Earth
Joined: 15-January 11



Dont know if such an anim-check-loop opcode exists. I think there is no need for such functionality in the game - animations are either just 'forced' to change to a specific one or if another specific one has finished, another starts.

If knowing what anims to modify I would use
0611:   actor $PLAYER_ACTOR performing_animation "CLIMB_idle"

or

CODE
IF AND
8611:   not actor $PLAYER_ACTOR performing_animation "CLIMB_jump"
8611:   not actor $PLAYER_ACTOR performing_animation "CLIMB_jump_B"
8611:   not actor $PLAYER_ACTOR performing_animation "CLIMB_jump2fall"
8611:   not actor $PLAYER_ACTOR performing_animation "CLIMB_Pull"
8611:   not actor $PLAYER_ACTOR performing_animation "CLIMB_Stand"
8611:   not actor $PLAYER_ACTOR performing_animation "CLIMB_Stand_finish"
THEN
    ...
END


There are lots of animations (not sure if a big loop might take longer than necessary). Maybe you can only check 'on-foot' anims via a few "IF" statements. I think Deji made a list that you can find somewhere on this forum.

This post has been edited by uokka: Jul 10 2013, 02:08 AM


--------------------
My english is just perfekt. I am only not sure, whether I it rightly utilize..
. . .
Go to the top of the page
 
+Quote Post
Opcode.eXe
post Jul 10 2013, 11:33 PM
Post #3


The New Guy!

Posts: 9
Joined: 14-April 13



QUOTE (Astrocat @ Jul 9 2013, 06:12 PM) *
I'm new in this Cleo opcodes and developing.
I have searched the database of opcodes and couldn't find an opcode that loopes trought all of the animations and give me the correct one that the player is currently using.

All of the opcodes I have checked, requring the animation name. I need an opcode that loops trought ALL of the animations and gives me the correct animation that its currently playing.

Also if it's possible, to save the animation name to 1@ and make a loop that checks while you are playing if you changed the animation.
That means if the animation was WALK_IDLE changed to WALK_RUN it'd catch that insted of just ending the loop on one animation.


There is no opcode to get the animation name and the file name.
But i think with some 1337 memory reading you can do it.
But.. i have a CLEO plugin by FYP (sampfunctions.cleo) wich has some opcodes to get the animation.
It only works in SAMP.

0B57: samp 1@ = player 0@ animation_id
0B58: samp get_animation_name_to 0@ file_to 1@ by_id 2@


This post has been edited by Opcode.eXe: Jul 10 2013, 11:35 PM
Go to the top of the page
 
+Quote Post
Astrocat
post Jul 12 2013, 09:58 AM
Post #4


The New Guy!

Posts: 2
Joined: 9-July 13



QUOTE (Opcode.eXe @ Jul 10 2013, 11:33 PM) *
There is no opcode to get the animation name and the file name.
But i think with some 1337 memory reading you can do it.
But.. i have a CLEO plugin by FYP (sampfunctions.cleo) wich has some opcodes to get the animation.
It only works in SAMP.

0B57: samp 1@ = player 0@ animation_id
0B58: samp get_animation_name_to 0@ file_to 1@ by_id 2@


I'm trying to use the FYP sampfucntions.cleo, however I try to code like the examples and all that it gives me are errors about SAMP.
Example:
QUOTE
Incorrect expression 0@ = SAMP.Base().
One of the variables has unknown type, or operands are incompatible.


or:
QUOTE
Unknown directive SAMP.Available().


I have included the RakNetDefines and searched trought the examples, seems like nothing works.
A little help please smile.gif?
Go to the top of the page
 
+Quote Post
toonskull
post Jul 14 2013, 12:13 AM
Post #5


The New Guy!

Posts: 2
Joined: 13-July 13



I wrote protohuman as kind of a joke. But here is the snippet that shows you how I used opcode 0611 to give CJ super speed. The way I found this was a listing of animations.

CODE
//Tap space bar for super speed
:protohuman_284
00D6: if
0611:   actor $PLAYER_ACTOR performing_animation "SPRINT_CIVI"
004D: jump_if_false @protohuman_393
0393: actor $PLAYER_ACTOR perform_animation "RUN_PLAYER" at 8.0 times_normal_rate
083D: get_actor $PLAYER_ACTOR velocity_in_direction_XYZ 2@ 3@ 4@
0013: 2@ *= 8.0
0013: 3@ *= 8.0
0013: 4@ *= 8.0
083C: set_actor $PLAYER_ACTOR velocity_in_direction_XYZ 2@ 3@ 4@
:protohuman_393


It is kind of funny how he can out race a car, however when he fell down at this rate of speed it would kill him. Sorry I couldn't be more help.
Go to the top of the page
 
+Quote Post
Opcode.eXe
post Jul 15 2013, 09:52 AM
Post #6


The New Guy!

Posts: 9
Joined: 14-April 13



Sorry the get player animation isnt working for me too.. Anyways its only for SAMP .. i dont know if you want to use it for singelplayer.
Also to install you need to replace every single file that comes with sampfuncs.
Go to the top of the page
 
+Quote Post
Reply to this postStart new topic

7 User(s) are reading this topic (7 Guests and 0 Anonymous Users)
0 Members: