View Full Version : player.attr

10-24-2006, 07:35 PM
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!

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

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?"

10-26-2006, 10:40 PM
would be nice to have like

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

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

10-26-2006, 11:31 PM



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

10-27-2006, 03:20 PM
It was an suggestion :]

10-27-2006, 04:27 PM
I have updated my post, I forgot you get the gani parameters in onPlayerEnters(param1, param2 etc.) now.

10-27-2006, 06:59 PM
So I say...

function onWeaponfired() {
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?

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.

10-27-2006, 10:41 PM
I don't understand -- any chance of an example?

10-27-2006, 11:44 PM
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.