Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-19-2006, 07:00 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
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.
Reply With Quote
  #2  
Old 02-19-2006, 07:09 AM
Idrox0 Idrox0 is offline
Registered User
Join Date: Oct 2003
Posts: 66
Idrox0 is on a distinguished road
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.
__________________
Reply With Quote
  #3  
Old 02-19-2006, 07:26 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
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.

Last edited by jake13jake; 02-19-2006 at 07:40 AM..
Reply With Quote
  #4  
Old 02-19-2006, 09:29 AM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to 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

__________________
Reply With Quote
  #5  
Old 02-19-2006, 01:41 PM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
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.
Reply With Quote
  #6  
Old 02-20-2006, 06:00 AM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Hrm, use a client. variable to store the gani they should be using, and just use client.gani_ganiname = "newgani"; to replace it?
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #7  
Old 02-20-2006, 06:29 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
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.
Reply With Quote
  #8  
Old 02-20-2006, 08:21 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
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?
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #9  
Old 02-20-2006, 09:06 PM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
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.
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 On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 06:42 PM.


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