SRL Archive - Reflection Development

Im not sure if this will help


austin2162

2010-05-12 03:41:46

OK i was looking for reflection all day
i found it it was for simba i got simba
after playing around i got reflection to walk to the bank
then i wanted animations i look and they werent done so i deciede to
do it my self

this is for ismoving

function R_ismoving : boolean;
begin
result:= SmartGetFieldBoolean(0,hook_character_IsMoving);
end;

im not sure how well it comes up yet

tell me if it helps

edit;

break though got the animations working

function GetAnimation: Integer;
var
I : Integer;
begin
I := SmartGetFieldObject(0, hook_static_MyPlayer);
Result := SmartGetFieldInt(I, hook_character_Animation);
SmartFreeObject(I);
end;

this works i tested it

Baked0420

2010-05-12 07:48:11

Nice job, I could never do this because I don't get how to use the SmartGetField functions. If the reflection devs haven't done this yet I bet they'll be happy to see this, one less thing for them to update. Rep+

austin2162

2010-05-12 07:59:33

I have my script running great, and later am going to work on more reflection script stuff

Drakan

2010-05-12 08:42:56

We have all this in the reflection include ;) Thanks though, its good thinking.

austin2162

2010-05-12 09:01:30

What do you need?

Method

2010-05-12 10:03:42

Your 'IsMoving' function won't work because you're treating the field as a static field instead of an instance field of the Character/Mobile class. You'll need to do the same thing you did to get the animation to retrieve the value.

Also, IsMoving is a poor name to use especially since the field is an int that varies from 0-9 (from what I remember), not a boolean.

Drakan

2010-05-12 10:48:28

Plus its a bad function name because SRL already has a function called IsMoving ;) But yes method is right, however im not sure what the value ranges from. I'm going to check it out and get back to you.

Drakan

2010-05-12 11:50:30

K i updated the SVN. I added the beginnings of character.scar. getSpeed returns 0-3. 0 being not moving. 1-2 being walking, and 2-3 being running. It kind of varies but thats the general idea. Its just tiles/second i believe.

Baked0420

2010-05-12 14:57:29

I guess it's not the Open-Dev Svn, no new files and I think I remember hearing about a new SVN that only you and Benland (I think?) has access to update.

austin2162

2010-05-12 16:06:47

Could you pm me your script so I can study it

btw i use ismoving cause thats what it says in the hooks script and it was more less the idea
in other words wip

edit nvm i got it from svn i understand now
but the question still stands what still needs to be done

Method

2010-05-12 21:20:16

From: drags111
K i updated the SVN. I added the beginnings of character.scar. getSpeed returns 0-3. 0 being not moving. 1-2 being walking, and 2-3 being running. It kind of varies but thats the general idea. Its just tiles/second i believe.


I think it's actually the index of the current waypoint inside a character's waypoint arrays.