Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   player.ani params (https://forums.graalonline.com/forums/showthread.php?t=134264709)

xAndrewx 10-04-2011 10:35 PM

player.ani params
 
Is there any way to set params using player.ani?

I've tried

PHP Code:

player.ani "idle, block.png";
//(I've tried it without the space inbetween idle,block.png) 

but this just outputs

File download: idle, block.png.gani not found

0PiX0 10-04-2011 10:41 PM

setani(ganiname,parameter(s));
TServerPlayer.setani(str, str)

xAndrewx 10-04-2011 10:46 PM

Yeah- but I don't want to use setani :[

(I would need to re-script most of the movement- i'm wondering if there is a solution)

fowlplay4 10-04-2011 10:46 PM

Quote:

Originally Posted by xAndrewx (Post 1670017)
(I would need to re-script most of the movement- i'm wondering if there is a solution)

Use attributes instead.

Crow 10-04-2011 10:47 PM

Quote:

Originally Posted by xAndrewx (Post 1670017)
Yeah- but I don't want to use setani :[

(I would need to re-script most of the movement- i'm wondering if there is a solution)

It's the preferred method. Assigning a string to player.ani (which is an object) is not the way you should do it. Do some search and replace on your movement and get used to setAni().

xAndrewx 10-04-2011 10:50 PM

boo his boo-

Not using attrs as they can be laggy on iOS device. /cry :(

I just wanted to use a param to save iOS file space (instead of creating so many different gani's when just replacing the image)

thanks though guys <3

ffcmike 10-04-2011 10:53 PM

Tried directly modifying player.aniparams?

fowlplay4 10-04-2011 11:01 PM

Quote:

Originally Posted by xAndrewx (Post 1670020)
Not using attrs as they can be laggy on iOS device. /cry :(

I don't see why it would be anymore laggy than storing a string in a parameter.

xAndrewx 10-04-2011 11:02 PM

player.aniparams - wouldn't work. :(
By the looks of it, I couldn't modify it either.

Apparently ATTRs can cause lag, I'm sure Stefan said this :[

Emera 10-04-2011 11:18 PM

/cry only works on iDevices foo

cbk1994 10-05-2011 12:09 AM

Quote:

Originally Posted by Crow (Post 1670019)
It's the preferred method. Assigning a string to player.ani (which is an object) is not the way you should do it. Do some search and replace on your movement and get used to setAni().

Based on what I've heard, it's not anymore. Tig told me that Stefan (or one of his disciples) said to set it directly on iPhone servers (Ol West, Kingdoms iPhone) as it's faster or something. I agree that it's weird, since player.ani is supposed to be an object.

Admins 10-05-2011 12:30 PM

The problem is that player.ani is different on client-side and server-side.
On server-side it's just a string, and you can do player.ani = "aniname,params"; although you can also access player.aniparams separately.
On client-side it's an object, but you can assign a string to it to make it work similar as on server-side. This is the as with "profile = " assignments. On client-side it doesn't accept "aniname,params" though, but we can add that.
Using setani is a safe bet for now.

Crow 10-05-2011 03:33 PM

Quote:

Originally Posted by cbk1994 (Post 1670028)
Based on what I've heard, it's not anymore. Tig told me that Stefan (or one of his disciples) said to set it directly on iPhone servers (Ol West, Kingdoms iPhone) as it's faster or something. I agree that it's weird, since player.ani is supposed to be an object.

That's strange as **** :/

ffcmike 10-05-2011 06:39 PM

Quote:

Originally Posted by cbk1994 (Post 1670028)
Stefan (or one of his disciples) said to set it directly on iPhone servers (Ol West, Kingdoms iPhone) as it's faster or something.

I find this weird as I'd imagine the difference in time between one such built-in function and assigning a variable to be somewhat negligible.
So if this really does make a significant difference, wouldn't it also be better to assign such variables as this.isblocking, this.visible and this.layer instead of using this.dontblock();, this.hide(); and this.drawunderplayer();?

xAndrewx 10-05-2011 07:41 PM

Quote:

Originally Posted by Stefan (Post 1670055)
The problem is that player.ani is different on client-side and server-side.
On server-side it's just a string, and you can do player.ani = "aniname,params"; although you can also access player.aniparams separately.
On client-side it's an object, but you can assign a string to it to make it work similar as on server-side. This is the as with "profile = " assignments. On client-side it doesn't accept "aniname,params" though, but we can add that.
Using setani is a safe bet for now.


That would be great- thank you <3

Admins 10-05-2011 09:57 PM

Quote:

Originally Posted by ffcmike (Post 1670065)
I find this weird as I'd imagine the difference in time between one such built-in function and assigning a variable to be somewhat negligible.
So if this really does make a significant difference, wouldn't it also be better to assign such variables as this.isblocking, this.visible and this.layer instead of using this.dontblock();, this.hide(); and this.drawunderplayer();?

These variables have been added to make it simplier to be able to see what the current value is. On Classic and Era iphone we use visible = true/false instead of show()/hide(), for dontblock and drawunderplayer it can sometimes be good to use the old version to make it work in the offline editor.

ffcmike 10-05-2011 10:12 PM

Quote:

Originally Posted by Stefan (Post 1670075)
These variables have been added to make it simplier to be able to see what the current value is. On Classic and Era iphone we use visible = true/false instead of show()/hide(), for dontblock and drawunderplayer it can sometimes be good to use the old version to make it work in the offline editor.

Something I've also been wondering about is whether or not it's more efficient to use these synchronised variables serverside instead of clientside where it makes sense?

xAndrewx 04-07-2013 08:37 AM

Wondering if player.ani will support params in the future - would cut down on a lot of ganis on Era as well as on Zone (both iOS)

Admins 04-08-2013 02:19 PM

Why cut down on ganis? You can use player.ani = "bla,bla" on server-side and setani on client-side to provide parameters.


All times are GMT +2. The time now is 07:46 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.