Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   player.attr (https://forums.graalonline.com/forums/showthread.php?t=69632)

xAndrewx 10-24-2006 07:35 PM

player.attr
 
Is anyone else having problems with this?
I'm trying to make it display a gani next to the player, so I used player.attr, it show's the gani, however it won't attach any other params to it.

Can player.attr be classed as an array? If not, does anyone have any suggestion's on how to pass a message on to the gani?

It's basically going to be for a damage display feature.
Thanks, in advance!

Admins 10-24-2006 11:05 PM

You can use gani parameters like for normal ganis,
player.attr[1] = "my.gani,param1,param2";
To access those use "function onPlayerEnters(param1,param2)" in the gani script.
Another solution is to set another attr and access it from the script

_Z3phyr_ 10-26-2006 10:27 PM

Can this work for replaceani() as well? I've had people be like "okay I can replace the ganis... but what about params?"

Chompy 10-26-2006 10:40 PM

would be nice to have like

PHP Code:

replaceaniparams({"foo""chest.wav""Hey!"}, {"bar""jump.wav""Howdy?"});
  
//  { gani, attr/param, attr/param },  { gani, attr/param, attr/param }
or

temp.arr1 = {"foo""chest.wav""Hey!"};  //  { gani, attr/param, attr/param }
temp.arr2 = {"bar""jump.wav""Howdy?"};// { gani, attr/param, attr/param }
replaceaniparams(temp.arr1temp.arr2); 


_Z3phyr_ 10-26-2006 11:31 PM

replaceaniparams()?
...



...


BRILLIANT!
http://img85.imageshack.us/img85/7664/brilliantwo0.jpg




edit -- oh wait that's not a command nvm

Chompy 10-27-2006 03:20 PM

It was an suggestion :]

Admins 10-27-2006 04:27 PM

I have updated my post, I forgot you get the gani parameters in onPlayerEnters(param1, param2 etc.) now.

_Z3phyr_ 10-27-2006 06:59 PM

So I say...

PHP Code:

function onWeaponfired() {
  
replaceani("idle","newidle");
  
onPlayerenters("newidleparam1","newidleparam2");
}
function 
onPlayerenters(param1,param2) {
  
//... ummm... wait a second...


Do I not need to specify the actual action of replacing gani params and just say "onPlayerenters(param1,param2);" or what?

Admins 10-27-2006 07:39 PM

You cannnot pass gani parameters to animations which are automatically started (replaceani), you need to use other attr[] to store values. The onPlayerEnters would need to be in the gani script otherwise only yourself would see the effect.

_Z3phyr_ 10-27-2006 10:41 PM

I don't understand -- any chance of an example?

Riot 10-27-2006 11:44 PM

Quote:

Originally Posted by _Z3phyr_ (Post 1236758)
I don't understand -- any chance of an example?

I think he means this:

Previously, when you used a gani-script you had to use if (playerenters) because of onPlayerEnters replacing parameters. You can now use onPlayerEnters and get the desired effects.

This is only for gani-scripts, so the sample you posted wouldn't do anything.


All times are GMT +2. The time now is 09:19 AM.

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