Graal Forums  

Go Back   Graal Forums > Development Forums > Gani Construction
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-29-2010, 02:12 PM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
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.
__________________
MY POSTS ARE PRONE TO EDITS!
Reply With Quote
  #2  
Old 05-29-2010, 04:14 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
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.
__________________
Quote:
Reply With Quote
  #3  
Old 05-29-2010, 04:18 PM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura aboutadam has a spectacular aura about
Send a message via AIM to adam
http://forums.graalonline.com/forums...73&postcount=1
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
Reply With Quote
  #4  
Old 05-29-2010, 04:56 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
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);
  }

__________________
Quote:
Reply With Quote
  #5  
Old 05-29-2010, 07:37 PM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
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?
__________________
MY POSTS ARE PRONE TO EDITS!

Last edited by Jiroxys7; 05-29-2010 at 08:00 PM..
Reply With Quote
  #6  
Old 05-29-2010, 08:04 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by Jiroxys7 View Post
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 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.
__________________
Quote:
Reply With Quote
  #7  
Old 05-29-2010, 08:49 PM
DrakilorP2P DrakilorP2P is offline
Registered User
DrakilorP2P's Avatar
Join Date: Apr 2006
Posts: 755
DrakilorP2P is just really niceDrakilorP2P is just really nice
Quote:
Originally Posted by Jiroxys7 View Post
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.
Reply With Quote
  #8  
Old 05-29-2010, 09:07 PM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
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
__________________
MY POSTS ARE PRONE TO EDITS!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 10:31 PM.


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