Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Bug Report (https://forums.graalonline.com/forums/forumdisplay.php?f=193)
-   -   setani params not compatible with GS2 (https://forums.graalonline.com/forums/showthread.php?t=134267842)

Jiroxys7 02-04-2013 05:31 AM

setani params not compatible with GS2
 
Edit: *showani

As mentioned in this thread:
http://forums.graalonline.com/forums...ad.php?t=58557

I was having this issue recently. Pulling my hair out because I could not for the life of me get my ani (shown with showani, if it matters) to acknowledge params sent to it until I changed "function onCreated()" to "if(created)"

That's an 8 year-old thread x_x

DustyPorViva 02-04-2013 05:58 AM

Your post lacks some important info... like the script in question.

Jiroxys7 02-04-2013 06:07 AM

Quote:

Originally Posted by DustyPorViva (Post 1713162)
Your post lacks some important info... like the script in question.

It's pretty much exactly what it says on the tin.

If you do showani(200,player.x,player.y,player.dir,"myani"," superkewlparam");

...Then in the gani doing: player.chat = param[0]; or whatever inside a "function onCreated()", it will always return null unless you do it in an "if (created) statement instead.

Crow 02-04-2013 11:57 AM

Try:
PHP Code:

showani(200,player.x,player.y,player.dir,"myani,superkewlparam"); 

showani() only accepts five arguments, of which only the last one is a string.

Jiroxys7 02-04-2013 06:03 PM

Quote:

Originally Posted by Crow (Post 1713165)
Try:
PHP Code:

showani(200,player.x,player.y,player.dir,"myani,superkewlparam"); 

showani() only accepts five arguments, of which only the last one is a string.

Not true. Otherwise it wouldn't have worked even with "if(created)".

Crow 02-04-2013 06:15 PM

Quote:

Originally Posted by Jiroxys7 (Post 1713171)
Not true. Otherwise it wouldn't have worked even with "if(created)".

Quote:

Script help for 'showani':
TServerNPC.showani(int, float, float, int, str) - returns object
Give what I said a shot. Does it work?

Admins 02-04-2013 09:49 PM

It's a special "hack" to access gani parameters inside gani scripts: if you use if (playerenters) and such then you can access the gani parameters via params[]

Jiroxys7 02-05-2013 12:38 AM

Quote:

Originally Posted by Crow (Post 1713172)
Give what I said a shot. Does it work?

Didn't work for me :s
Edit: I feel like ganis are being very fickle. I've been trying to debug them using player.chat = whatever, and half the time it simply doesn't work. No apparent rhyme or reason considering that It'll do this even if the updated gani is identical to a version I had a few moments ago where it worked. At the time of posting, your suggestion didn't work. There were no syntax errors, and it definitely wasn't my imagination. It simply did not work. And now for no apparent reason your method of passing params is suddenly working.

Quote:

Originally Posted by Stefan (Post 1713180)
It's a special "hack" to access gani parameters inside gani scripts: if you use if (playerenters) and such then you can access the gani parameters via params[]

While we're on the topic, would there be any way to do something like this?

PHP Code:

SCRIPT
if (created){
  
onTimeout();
}
function 
onTimeout()

  
thiso.tu player.findweapon("WeaponName").GetCharge(); //<-- This
  
setTimer(.1);
}
SCRIPTEND 

Using just "findweapon("$Titan Blade").GetCharge();" works fine on your end if you're the one that's using it. It gets a value that changes the gani's colors over time as you hold a key down. Except for everyone else, it looks for WeaponName on THEIR account, which usually won't exist. Plus it's not likely that they're just going to happen to be holding the same key that's needed. Causing it not to change color on their end.

Stuff like player.x, player.y, and player.account will all accurately recognize the player that invoked the gani. But would it be possible for us to do more with that player? Or will I have to resort to a more hackish approach and send this value as it's own param and rapidly re-apply the animation over and over in order to achieve this?

Crow 02-05-2013 12:44 PM

Your best bet for fetching data inside a gani:
  • If you only need data of the player viewing the gani, use client.vars.
  • If you need data of the player the gani is attached to (or which the player is "using", for that matter) use player.attr[].

cbk1994 02-05-2013 01:27 PM

Also, typically use playerenters and not created.

Admins 02-11-2013 11:16 AM

Also one comment about shown: if you provide more parameters than necessary then it's adding them comma-separated to the last parameter, so it can be used to provide gani parameters.


All times are GMT +2. The time now is 03:47 PM.

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