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-11-2006, 09:18 PM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
Gani Problems

Ive been trying different methods of passing along params / information to ganis.. without much success I am afraid, so now I seek help from you guys.


Script:
PHP Code:
player.attr[19] = { {2040}, {510} };
player.attr[20] = "ml_hud.gani"

Gani:
PHP Code:
SCRIPT
function onCreated()
{
  
this.health = { player.attr[19][0][0], player.attr[19][0][1] };
  
this.mana = { player.attr[19][1][0], player.attr[19][1][1] };

  
setTimer(.05);
}

function 
onTimeOut()
{
  
showimg(1"@verdana@b@" this.account SPC "HP:" SPC this.health[0] @ "/" this.health[1SPC "MP:" SPC this.mana[0] @ "/" this.mana[1], 3y);
  
changeimgzoom(1.5);
}
SCRIPTEND 
That should show the text:

HP: 20/40 MP: 5/10

next to all players.. but it dont, it only show for the current player, the text:

HP: 0/0 MP: 0/0

is shown next to all other players.


Ive also tried to pass the params with same attribute as the gani, but then the gani wouldnt even work at all.

PHP Code:
  player.attr[20] = { "ml_hud.gani"param1param2etc..}; 
I tried to use both variants WITH and WITHOUT .gani, it didnt work -at all- without it.

Any suggestions?
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #2  
Old 10-12-2006, 03:03 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
Quote:
Originally Posted by xXziroXx View Post

Script:
PHP Code:
player.attr[19] = { {2040}, {510} };
player.attr[20] = "ml_hud.gani"

Gani:
PHP Code:
SCRIPT
function onCreated()
{
  
this.health = { player.attr[19][0][0], player.attr[19][0][1] };
  
this.mana = { player.attr[19][1][0], player.attr[19][1][1] };

  
setTimer(.05);
}

function 
onTimeOut()
{
  
showimg(1"@verdana@b@" this.account SPC "HP:" SPC this.health[0] @ "/" this.health[1SPC "MP:" SPC this.mana[0] @ "/" this.mana[1], 3y);
  
changeimgzoom(1.5);
}
SCRIPTEND 
That should show the text:

HP: 20/40 MP: 5/10

next to all players.. but it dont, it only show for the current player, the text:

HP: 0/0 MP: 0/0

is shown next to all other players.


Ive also tried to pass the params with same attribute as the gani, but then the gani wouldnt even work at all.

PHP Code:
  player.attr[20] = { "ml_hud.gani"param1param2etc..}; 
I tried to use both variants WITH and WITHOUT .gani, it didnt work -at all- without it.

Any suggestions?

hmm,
HTML Code:
this.health = { player.attr[19][0][0], player.attr[19][0][1] };
this.mana = { player.attr[19][1][0], player.attr[19][1][1] };
HTML Code:
player.attr[19] = { {20, 40}, {5, 10} };
-------------------------
you are trying to call it like if attr19 was:
HTML Code:
player.attr[19] = { { {20}, {40} }, { {5}, {10} } };
correct me if I am wrong
__________________
Reply With Quote
  #3  
Old 10-12-2006, 03:06 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
wait, I saw it was wrong because of "attr[19]" my bad :P

you could try to set it like to
PHP Code:
temp.attr player.attr[19];
temp.stuff temp.attr[0][1]; 
etc..

and you could try showtext instead of showimg
BTW; sorry for double post
__________________
Reply With Quote
  #4  
Old 10-12-2006, 10:47 PM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
Doesnt mather if you use showtext or showimg, only showimg works serversided to show text (yes, I know ganis are clientsided).

And Ive already tried doing that Chompy, and im suprised no one is able to help me..
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #5  
Old 10-13-2006, 12:10 AM
Raelyn Raelyn is offline
the Professional.
Raelyn's Avatar
Join Date: Sep 2003
Location: Zormite
Posts: 964
Raelyn will become famous soon enough
Quote:
Originally Posted by xXziroXx View Post
...?
Ziro, psst, you should help with my Gani problems.. The door on Aetherforge only opens clientside, if a player pulls it open, the other players still see it closed.
__________________
*Don't let the door hit you on the way out.*
Reply With Quote
  #6  
Old 10-15-2006, 02:56 PM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
*bumps* Anyone?
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #7  
Old 10-15-2006, 03:22 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 tried to use echo to see what player.attr[19] contains?
Reply With Quote
  #8  
Old 10-15-2006, 03:29 PM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
Quote:
Originally Posted by Stefan View Post
You tried to use echo to see what player.attr[19] contains?
Yes, and it shows exactly what I set it to. And if it was anything wrong in it, it wouldnt show the proper stats for the player himself - would it?
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #9  
Old 10-15-2006, 07:02 PM
contiga contiga is offline
Graal2001 Administration
contiga's Avatar
Join Date: Jul 2004
Location: Netherlands
Posts: 419
contiga is an unknown quantity at this point
Send a message via ICQ to contiga Send a message via AIM to contiga Send a message via MSN to contiga Send a message via Yahoo to contiga
It's very simple to fix..

use:

player.attr[20] = { "ml_hud.gani", param1, param2, etc..};

And do this:
PHP Code:
SCRIPT
function onCreated()
{
  
sleep0.05); // Dunno why, but it doesn't load params in the first 0.05 seconds, it's a bug.
  
this.health = { params0][ 0], params0][ 1]};
  
this.mana = { params1][ 0], params1][ 1]};

  
setTimer.05);
}

function 
onTimeOut()
{
  
showimg(1"@verdana@b@" this.account SPC "HP:" SPC this.health[0] @ "/" this.health[1SPC "MP:" SPC this.mana[0] @ "/" this.mana[1], 3y);
  
changeimgzoom(1.5);
}
SCRIPTEND 
__________________
AIM: Contiga122
MSN: [email protected]
Status:
Quote:
Originally Posted by unixmad View Post
I am also awake 3AM to help correct problems.
Quote:
Originally Posted by Bomy Island RC people
Daniel: HoudiniMan is a bad guy =p
*Bell: rofl. I first read that as houdini is a bad man. like the little kid that wants his mommy to keep her away from that boogie man
Daniel: xD
*Rufus: I wouldn't want my kids around him.
Reply With Quote
  #10  
Old 10-15-2006, 07:40 PM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
Ok, me and Contiga tried to get it to work, without any luck.

He tried to do a player.testvar, but then it went entirely the same for all players.

It doesnt work to send params with player.attr ganis, wich is kind of lame.

Shouldnt this work?:

PHP Code:
player.attr[#] = { "ganiname", param1, param2, etc}; 
Because it doesnt. You can only set a player attribute to:

PHP Code:
player.attr[#] = "ganiname"; 
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #11  
Old 10-15-2006, 09:24 PM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
attr[] can only hold a string, not an array, contrary to the popular belief.

On Zodiac, we have to use a second attr[] in the format of "maxhp hp maxmp mp" and then tokenize it.
Reply With Quote
  #12  
Old 10-18-2006, 07:39 PM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
Quote:
Originally Posted by Yen View Post
attr[] can only hold a string, not an array, contrary to the popular belief.

On Zodiac, we have to use a second attr[] in the format of "maxhp hp maxmp mp" and then tokenize it.
I'll try that once I can either:

A) Get Graal / RC to work on my friends Linux computer.
B) Get him to trade back to Windows
C) Get back home
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #13  
Old 10-18-2006, 11:50 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
The internal type of attr[] are strings, but you can assign arrays to it and if you assign it back to a normal variable it will be an array again.
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 02:31 AM.


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