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 08-31-2007, 03:09 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
How to accss Default Attrs/Params VIA Scripts

The title says it all.

If I made a Gani with a player holding a beer as maybe Default Attr/Param 2, how would I access it to change it how I like in a script.
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.

Last edited by Switch; 08-31-2007 at 03:20 AM.. Reason: Better example
Reply With Quote
  #2  
Old 08-31-2007, 03:34 AM
Kyranki Kyranki is offline
Freelance Coder
Join Date: Aug 2007
Location: At the end of the rainbow, in the pot of gold.
Posts: 202
Kyranki is on a distinguished road
Send a message via AIM to Kyranki Send a message via MSN to Kyranki
Depends on what you want to do and how you want to do it.
__________________
Stan.
Reply With Quote
  #3  
Old 08-31-2007, 04:21 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
player.attr[index]

setani(ganiname, params);
__________________
Reply With Quote
  #4  
Old 08-31-2007, 04:50 AM
Kyranki Kyranki is offline
Freelance Coder
Join Date: Aug 2007
Location: At the end of the rainbow, in the pot of gold.
Posts: 202
Kyranki is on a distinguished road
Send a message via AIM to Kyranki Send a message via MSN to Kyranki
Quote:
Originally Posted by Inverness View Post
player.attr[index]

setani(ganiname, params);
That about sums it up.
__________________
Stan.
Reply With Quote
  #5  
Old 08-31-2007, 06:13 PM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Quote:
Originally Posted by Inverness View Post
player.attr[index]

setani(ganiname, params);
so player.attr[index] is for attrs, what about params? and also, how would I be able to set the default attr/param to another image via script and be able to replace maybe idle with the person holding a beer as idle, like the example at the begining of the thread??
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #6  
Old 08-31-2007, 10:11 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Graal is ignoring the default values, it's only used by GraalShop.exe
Reply With Quote
  #7  
Old 08-31-2007, 10:13 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by Switch View Post
so player.attr[index] is for attrs, what about params? and also, how would I be able to set the default attr/param to another image via script and be able to replace maybe idle with the person holding a beer as idle, like the example at the begining of the thread??
Params are sent with the setani()/setcharani() function like I said before.

replaceani(defaultani, newani); can be used to replace the default ganis with custom ones.

Ex: replaceani("idle", "mycustomidle");
Graal would use "mycustomidle" in place of the default idle animation from that point on, you would use replaceani("idle", "idle"); to change it back to normal.

By the way, I would like to know if there are GS2 versions of those.
__________________
Reply With Quote
  #8  
Old 09-01-2007, 03:47 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Quote:
Originally Posted by Stefan View Post
Graal is ignoring the default values, it's only used by GraalShop.exe
I know, I'm asking how to change that default attribute with what you want there.


Quote:
Originally Posted by Inverness View Post
Params are sent with the setani()/setcharani() function like I said before.

replaceani(defaultani, newani); can be used to replace the default ganis with custom ones.

Ex: replaceani("idle", "mycustomidle");
Graal would use "mycustomidle" in place of the default idle animation from that point on, you would use replaceani("idle", "idle"); to change it back to normal.
I know but how would you change the attr that you want to change and still replace the idle gani?
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #9  
Old 09-01-2007, 01:46 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by Switch View Post
I know, I'm asking how to change that default attribute with what you want there.



I know but how would you change the attr that you want to change and still replace the idle gani?
replaceani() the ani
then you can use player.attr[index] = "famous_image.png";

and the replaced default ani would use that attr..
__________________
Reply With Quote
  #10  
Old 09-01-2007, 05:15 PM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Quote:
Originally Posted by Chompy View Post
replaceani() the ani
then you can use player.attr[index] = "famous_image.png";

and the replaced default ani would use that attr..
YOU DA MAN!!

Thanks Chompy and Iverness
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #11  
Old 09-01-2007, 11:10 PM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Those are gs2 inverness. Only things that use ()'s in GS1 are if and with members such as onwall() and getplayer().
__________________
Do it with a DON!
Reply With Quote
  #12  
Old 09-01-2007, 11:33 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by zokemon View Post
Those are gs2 inverness. Only things that use ()'s in GS1 are if and with members such as onwall() and getplayer().
Not what I meant. setani() is a global global that only works for player, setcharani() only works for NPCs. I mean GS2 functions for setani() and replaceani() for TGaniObjects.
__________________
Reply With Quote
  #13  
Old 09-02-2007, 06:44 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Quote:
Originally Posted by zokemon View Post
Only things that use ()'s in GS1 are if and with members such as onwall() and getplayer().
I thought you could define your own functions in GS1...they use () :P
Reply With Quote
  #14  
Old 09-02-2007, 07:16 AM
Kyranki Kyranki is offline
Freelance Coder
Join Date: Aug 2007
Location: At the end of the rainbow, in the pot of gold.
Posts: 202
Kyranki is on a distinguished road
Send a message via AIM to Kyranki Send a message via MSN to Kyranki
Quote:
Originally Posted by Twinny View Post
I thought you could define your own functions in GS1...they use () :P
You can, I'm pretty sure Zero was just referring to the topic at hand.
__________________
Stan.
Reply With Quote
  #15  
Old 09-03-2007, 12:28 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by Kyranki View Post
You can, I'm pretty sure Zero was just referring to the topic at hand.
Obviously Twinny was just taking a stab at Zero's forgetfulness.
__________________
Reply With Quote
  #16  
Old 09-03-2007, 09:32 PM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Well, I was just trying to point out that the GS1 version was
PHP Code:
replaceani a,b
But I see what you mean.
__________________
Do it with a DON!
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 07:18 PM.


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