CLEO Help 0AB1: call_scm_func (Help)

CLEO related
Status
Not open for further replies.

Spix

Well-known member
Joined
Sep 23, 2013
Messages
353
Reaction score
1
Hello UGBASE!
I always avoided to script with "call" functions, but now i feel i have time to learn and i tried but it does not work. Can anyone correct me and tell me how i can fix it.

Best Wishes Spexx!

06AC: 13@ = actor $PLAYER_ACTOR movement_speed 
0AB1: call_scm_func @runninganim 4 13@ 0.0 1 255   

:Runninganim 
if 0019:  13@ > 11@
then
0B56: set_game_key 1@ state 20@   
end
0AB2: ret 0
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,502
Solutions
1
Reaction score
247
Location
( ͡° ͜ʖ ͡°)
Ill show you one example:
Code:
WHILE TRUE
WAIT 0
    if
    0AB0: KEY_PRESSED 88 // X
    THEN
        25@ = 100
        0AB1: call_cm_func @SetActorHealth 2 $PLAYER_ACTOR AMOUNT 25@
    END
END

:SetActorHealth
The first variable becomes 0@
second 1@
third 2@
fourth 3@
...
The first passed variable is $PLAYER_ACTOR and it becomes 0@
The second passed variable is 25@ and it becomes 1@

0223: set_actor 0@ health_to 1@
0AB2: ret 0


06AC: 13@ = actor $PLAYER_ACTOR movement_speed 
0AB1: call_scm_func @runninganim 4 13@ 0.0 1 255 

:Runninganim
13@ IS NOW 0@
0.0 IS NOW 1@
1 IS NOW 2@
255 IS NOW 3@

if
0019:  0@ > 1@
then
0B56: set_game_key 2@ state 3@ 
end
0AB2: ret 0
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
276
http://ugbase.eu/tutorials/0ab1-call_scm_function/
There's a very good and simple to understand tutorial for this, look it over.
 

Spix

Well-known member
Joined
Sep 23, 2013
Messages
353
Reaction score
1
springfield link said:
http://ugbase.eu/tutorials/0ab1-call_scm_function/
There's a very good and simple to understand tutorial for this, look it over.
Opcode.eXe link said:
Ill show you one example:
Code:
WHILE TRUE
WAIT 0
    if
    0AB0: KEY_PRESSED 88 // X
    THEN
        25@ = 100
        0AB1: call_cm_func @SetActorHealth 2 $PLAYER_ACTOR AMOUNT 25@
    END
END

:SetActorHealth
The first variable becomes 0@
second 1@
third 2@
fourth 3@
...
The first passed variable is $PLAYER_ACTOR and it becomes 0@
The second passed variable is 25@ and it becomes 1@

0223: set_actor 0@ health_to 1@
0AB2: ret 0


06AC: 13@ = actor $PLAYER_ACTOR movement_speed 
0AB1: call_scm_func @runninganim 4 13@ 0.0 1 255 

:Runninganim
13@ IS NOW 0@
0.0 IS NOW 1@
1 IS NOW 2@
255 IS NOW 3@

if
0019:  0@ > 1@
then
0B56: set_game_key 2@ state 3@ 
end
0AB2: ret 0



Thanks alot guys im very thankful for the help!
 
Status
Not open for further replies.
Top