PDA

View Full Version : How to accss Default Attribs/Params VIA Scripts


Switch
08-31-2007, 03:09 AM
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.

Kyranki
08-31-2007, 03:34 AM
Depends on what you want to do and how you want to do it.

Inverness
08-31-2007, 04:21 AM
player.attr[index]

setani(ganiname, params);

Kyranki
08-31-2007, 04:50 AM
player.attr[index]

setani(ganiname, params);

That about sums it up.

Switch
08-31-2007, 06:13 PM
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??

Admins
08-31-2007, 10:11 PM
Graal is ignoring the default values, it's only used by GraalShop.exe

Inverness
08-31-2007, 10:13 PM
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.

Switch
09-01-2007, 03:47 AM
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.


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?

Chompy
09-01-2007, 01:46 PM
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..

Switch
09-01-2007, 05:15 PM
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 :D

zokemon
09-01-2007, 11:10 PM
Those are gs2 inverness. Only things that use ()'s in GS1 are if and with members such as onwall() and getplayer().

Inverness
09-01-2007, 11:33 PM
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.

Twinny
09-02-2007, 06:44 AM
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

Kyranki
09-02-2007, 07:16 AM
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.

Inverness
09-03-2007, 12:28 AM
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.

zokemon
09-03-2007, 09:32 PM
Well, I was just trying to point out that the GS1 version was
replaceani a,b;
But I see what you mean.