Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Gani Construction (https://forums.graalonline.com/forums/forumdisplay.php?f=50)
-   -   Manipulating gani frame lengths? (https://forums.graalonline.com/forums/showthread.php?t=134259338)

Jiroxys7 05-29-2010 02:12 PM

Manipulating gani frame lengths?
 
I'm wondering if it's possible to use a gani script or something to manipulate the frame length of a gani. For example, lets say we have a gani with 6 frames that all go for .1 seconds each. we would use this gani script along with a wnpc to calculate a few factors that affect the speed of the gani, perhaps bringing it down to .5 seconds per frame. or even something like .62 seconds per frame.

is there any way to do this? it would be immensely useful to me.

fowlplay4 05-29-2010 04:14 PM

It doesn't look like there's anything in /scripthelp that would suggest there is. I can see this being useful in situations like a speed debuff, so when your player is slowed down so is their walking animation to reflect that.

adam 05-29-2010 04:18 PM

http://forums.graalonline.com/forums...73&postcount=1

fowlplay4 05-29-2010 04:56 PM

Quote:

Originally Posted by adam (Post 1579258)

So there is..

My rough implementation:

PHP Code:

//#CLIENTSIDE

function onCreated() {
  
onSetAni2("sword"060.1"sword1.png");
}

/*
    gani - Animation to draw
    frame - Frame to draw
    frames - The amount of frames to draw
    framelength - Time to draw each frame
    param - Optional animation param
*/

function onSetAni2(ganiframeframesframelengthparam) {
  
// Draw Frame
  
setani(format("%s[%i]"ganiframe), param);
  
// Increment Frame
  
frame++;
  
// Make sure animation isn't done
  
if (frame != frames) {
    
// Schedule drawing of next frame
    
this.scheduleevent(framelength"SetAni2"aniframeframesframelenghtparam);
  }



Jiroxys7 05-29-2010 07:37 PM

Man, i'm having some serious bad luck with scripting or something lately. My movement system project bombed since it was doing something weird and wouldnt let up after a few days of trying to figure out what was causing it. And maybe related but i cant incorporate that system you posted either. I eventually got to the point where i dropped the custom movement system, and put your code in a seperate npc. played around with it (yes, i fixed the typo) and still no luck. it wasnt updating anything at all. not even with a simple timeout script. i eventually turned THAT into

PHP Code:

//#CLIENTSIDE 
function onTimeout(){
  
player.chat "!";

setTimer(0.05); 

and yet my player.chat does not equal "!"; so then i thought, maybe some other script is updating my chat that i somehow forgot to delete, and changed it to player.x += 1; no luck. i think im starting to lose it cuz this makes no sense at all. i ended up rechecking about 4-5 times that i actually added that timeout loop npc to myself AND that the script was free of errors (yes, that simple, few lines of code). @_@


Maybe I'm just burned out from the past few hours, but i think i'm going to have to hire a scripter. do either of you know any trustworthy ones out there who might be willing to script for me and who arent, you know, like ultra-shady or anything?

fowlplay4 05-29-2010 08:04 PM

Quote:

Originally Posted by Jiroxys7 (Post 1579277)
Man, i'm having some serious bad luck with scripting or something lately. My movement system project bombed since it was doing something weird and wouldnt let up after a few days of trying to figure out what was causing it. And maybe related but i cant incorporate that system you posted either. I eventually got to the point where i dropped the custom movement system, and put your code in a seperate npc. played around with it (yes, i fixed the typo) and still no luck. it wasnt updating anything at all. not even with a simple timeout script. i eventually turned THAT into

PHP Code:

//#CLIENTSIDE 
function onTimeout(){
  
player.chat "!";

setTimer(0.05); 

and yet my player.chat does not equal "!"; so then i thought, maybe some other script is updating my chat that i somehow forgot to delete, and changed it to player.x += 1; no luck. i think im starting to lose it cuz this makes no sense at all. i ended up rechecking about 4-5 times that i actually added that timeout loop npc to myself AND that the script was free of errors (yes, that simple, few lines of code). @_@

i think i'm going to have to hire a scripter. because this is driving me nuts x_x does anyone know any trustworthy ones out there who might be willing to script for me and who arent, you know, like ultra-shady or anything? :/

You have code outside of functions which is never good. Here's a proper version:

PHP Code:

//#CLIENTSIDE
function onCreated() {
  
// Begin Loopiing
  
setTimer(0.05);
}

function 
onTimeout() {
  
// Do something..
  
player.chat player.chat+1;
  
// Continue Looping
  
setTimer(0.05);


You should keep loops like that to the absolute minimum, and try to develop things based on events (onPlayerChats, onPlayerEnters, etc.) instead.

The code I provided, if you want to use that function (onSetAni2) in other scripts you just have to paste it in the script you want to use it.

If you need scripting help feel free to ask the GDT, the scripter to everything else ratio there is pretty high. Keep in mind as long as you aren't script begging you should be able to get a lot of help from the NPC Scripting section.

DrakilorP2P 05-29-2010 08:49 PM

Quote:

Originally Posted by Jiroxys7 (Post 1579277)
PHP Code:

//#CLIENTSIDE 
function onTimeout(){
  
player.chat "!";

setTimer(0.05); 


There's a bug with Graal where //#CLIENTSIDE will not work if there are spaces to the right of it; I think your script has one.

Jiroxys7 05-29-2010 09:07 PM

It's odd. that didnt do anything either. i also just tried
PHP Code:

//#CLIENTSIDE function onPlayerenters(){
player.chat "Hello";


still with no luck. i think something may be broken because either I just completely forgot the basics of scripting, or.. it's anyone's guess.

Hm..



edit: thanks drakilor 0-0


All times are GMT +2. The time now is 11:23 PM.

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