Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   How to accss Default Attribs/Params VIA Scripts (https://forums.graalonline.com/forums/showthread.php?t=76580)

Switch 08-31-2007 03:09 AM

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.

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

Quote:

Originally Posted by Inverness (Post 1344845)
player.attr[index]

setani(ganiname, params);

That about sums it up.

Switch 08-31-2007 06:13 PM

Quote:

Originally Posted by Inverness (Post 1344845)
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

Quote:

Originally Posted by Switch (Post 1344953)
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

Quote:

Originally Posted by Stefan (Post 1344969)
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 (Post 1344971)
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

Quote:

Originally Posted by Switch (Post 1345018)
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

Quote:

Originally Posted by Chompy (Post 1345077)
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

Quote:

Originally Posted by zokemon (Post 1345188)
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

Quote:

Originally Posted by zokemon (Post 1345188)
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

Quote:

Originally Posted by Twinny (Post 1345257)
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

Quote:

Originally Posted by Kyranki (Post 1345260)
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
PHP Code:

replaceani a,b

But I see what you mean.


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

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