Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Gani System: Replacing Anis (https://forums.graalonline.com/forums/showthread.php?t=64216)

jake13jake 02-19-2006 07:00 AM

Gani System: Replacing Anis
 
Most people can agree that when scripting a movement system, the best time to change a player's animation is when initializing movement, or when stopped moving. Using a custom movement system, when I bulit the animation system, I kept in mind that I would want to have a means of replacing the player's ani. However, there was one factor I wasn't expecting. SETBACKTO.

Alright. So I have a list of global vars of anis used by the default movement system:
gani_ganiname = "ganiname"

In a first step to solve this problem, I created a list of global vars for the default values of these anis. the gani_ganiname is for replacing, the gani_ganiname_def is for storing the default value of that gani (even though it's well implied). However, I don't really know what my next step will be. perhaps take all of the gani_vars and replaceani(gani_name_def,gani_name)? There really ought to be a simpler way to do this -_-..

LOL, so I did that, and it didn't fix anything.

Idrox0 02-19-2006 07:09 AM

Is there anything wrong with, for example, upon the player pressing left, changing the dir to 1, and setting the gani to walk? And why would you want to replace any animations in the first place? I've made a movement system before. Just thought I'd say that before you started questioning my experience.

jake13jake 02-19-2006 07:26 AM

Quote:

Originally Posted by Idrox0
Is there anything wrong with, for example, upon the player pressing left, changing the dir to 1, and setting the gani to walk? And why would you want to replace any animations in the first place? I've made a movement system before. Just thought I'd say that before you started questioning my experience.

Why would you want to replace the animation?

Well, the two places I've used it:
1. replace idle with drunk idle
2. replace walk,idle,sit with the a similar gani that carries a lantern.

And believe me, I hired you before, but only as a trainee because your experience wasn't that great. I have authority of opinion on the grounds of your experience.

ZeLpH_MyStiK 02-19-2006 09:29 AM

Example:
PHP Code:

if (created) {
  
setstring this.def,idle,walk,sit,swim;  // define default/setbackto ganis
  
setstring this.new,idle_new,walk_new,sit_new,swim_new;  // define new custom ganis
  
timeout .05;  // initiate timeout
}
if (
timeout) {  // timeout event
  
this.index lindexof(#m,this.def);  // is current gani listed in the list of default ganis?
  
if (this.index >= 0setplayerprop #m,#I(this.new,this.index);  // if it is, set player gani to the corresponding gani in the list of new custom ganis
  
timeout .05;  // continue timeout



jake13jake 02-19-2006 01:41 PM

Quote:

Originally Posted by ZeLpH_MyStiK
Example:
PHP Code:

if (created) {
  
setstring this.def,idle,walk,sit,swim;  // define default/setbackto ganis
  
setstring this.new,idle_new,walk_new,sit_new,swim_new;  // define new custom ganis
  
timeout .05;  // initiate timeout
}
if (
timeout) {  // timeout event
  
this.index lindexof(#m,this.def);  // is current gani listed in the list of default ganis?
  
if (this.index >= 0setplayerprop #m,#I(this.new,this.index);  // if it is, set player gani to the corresponding gani in the list of new custom ganis
  
timeout .05;  // continue timeout



eugh, yea, the flaw with that as I was stating was that you have to override it.

ApothiX 02-20-2006 06:00 AM

Hrm, use a client. variable to store the gani they should be using, and just use client.gani_ganiname = "newgani"; to replace it?

jake13jake 02-20-2006 06:29 AM

Quote:

Originally Posted by ApothiX
Hrm, use a client. variable to store the gani they should be using, and just use client.gani_ganiname = "newgani"; to replace it?

I already have that. In fact, I'm using a non-prefixed clientside var for that. It's the setbackto part of ganis that's getting me.

ApothiX 02-20-2006 08:21 PM

Quote:

Originally Posted by jake13jake
I already have that. In fact, I'm using a non-prefixed clientside var for that. It's the setbackto part of ganis that's getting me.

I don't really understand what you are having a problem with :x Shouldn't the setbackto in the gani 'set back to' the right gani anyway?

jake13jake 02-20-2006 09:06 PM

Quote:

Originally Posted by ApothiX
I don't really understand what you are having a problem with :x Shouldn't the setbackto in the gani 'set back to' the right gani anyway?

It sets back to the default gani, not the default gani that's meant to replace it. I don't know if the built in replaceani would pick it up either.


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

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