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 10-24-2006, 07:35 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
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!
__________________
Reply With Quote
  #2  
Old 10-24-2006, 11:05 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
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

Last edited by Admins; 10-27-2006 at 04:27 PM..
Reply With Quote
  #3  
Old 10-26-2006, 10:27 PM
_Z3phyr_ _Z3phyr_ is offline
Banned
Join Date: Sep 2003
Location: Louisiane
Posts: 390
_Z3phyr_ is an unknown quantity at this point
Can this work for replaceani() as well? I've had people be like "okay I can replace the ganis... but what about params?"
Reply With Quote
  #4  
Old 10-26-2006, 10:40 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
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); 
__________________
Reply With Quote
  #5  
Old 10-26-2006, 11:31 PM
_Z3phyr_ _Z3phyr_ is offline
Banned
Join Date: Sep 2003
Location: Louisiane
Posts: 390
_Z3phyr_ is an unknown quantity at this point
replaceaniparams()?
...



...


BRILLIANT!





edit -- oh wait that's not a command nvm
Reply With Quote
  #6  
Old 10-27-2006, 03:20 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
It was an suggestion :]
__________________
Reply With Quote
  #7  
Old 10-27-2006, 04:27 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
I have updated my post, I forgot you get the gani parameters in onPlayerEnters(param1, param2 etc.) now.
Reply With Quote
  #8  
Old 10-27-2006, 06:59 PM
_Z3phyr_ _Z3phyr_ is offline
Banned
Join Date: Sep 2003
Location: Louisiane
Posts: 390
_Z3phyr_ is an unknown quantity at this point
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?
Reply With Quote
  #9  
Old 10-27-2006, 07:39 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
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.
Reply With Quote
  #10  
Old 10-27-2006, 10:41 PM
_Z3phyr_ _Z3phyr_ is offline
Banned
Join Date: Sep 2003
Location: Louisiane
Posts: 390
_Z3phyr_ is an unknown quantity at this point
I don't understand -- any chance of an example?
Reply With Quote
  #11  
Old 10-27-2006, 11:44 PM
Riot Riot is offline
Delteria Management
Join Date: Nov 2003
Location: Seminole County, Florida
Posts: 280
Riot is on a distinguished road
Quote:
Originally Posted by _Z3phyr_ View Post
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.
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 04:42 AM.


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