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 02-06-2007, 07:15 AM
ZeekTheMan2 ZeekTheMan2 is offline
Zeek Is The Man
ZeekTheMan2's Avatar
Join Date: Feb 2006
Location: Ohio
Posts: 12
ZeekTheMan2 is on a distinguished road
Send a message via AIM to ZeekTheMan2
Help

Can somebody help me with this why is its hiding everything accept the names of the players?

PHP Code:
Function onCreated()
{
 
onTimeout();
}
function 
onTimeout(){
 
showstats(1024);
}
setTimer(0.05); 
Reply With Quote
  #2  
Old 02-06-2007, 07:45 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Showstats
PHP Code:
1      ASD
2     Icons 
(for rupeesbombsarrows)
4     Rupees count
8     Bombs count
0x10     Arrows count
0x20     Hearts
0x40     Alignment 
(apbar
0x80     Magic points 
(mpbar
0x100     Minimap 
(you can only hide ityou can't show it when the player pressed Alt+3)
0x200     Inventory NPCs
0x400     Players
0x800     Right-click on players opens their profile
allstats     All of the previously stated stats flags enabled 
Also, what's the point of having show stats in a timeout?

PHP Code:
//#CLIENTSIDE
function onCreated()
{
  
showstats(allstats 0x80 0x40);

Reply With Quote
  #3  
Old 02-07-2007, 10:56 AM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
I recommend doing it inside a //onPlayerEnters()// to make sure that it stays that way.
Reply With Quote
  #4  
Old 02-08-2007, 05:23 PM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
So just add...

PHP Code:
function onPlayerEnters()
{
  
onCreated();


...to the bottom.
Reply With Quote
  #5  
Old 02-08-2007, 05:28 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Quote:
Originally Posted by Gambet View Post
So just add...

PHP Code:
function onPlayerEnters()
{
  
onCreated();


...to the bottom.
This would be more efficient.
HTML Code:
function onCreated()
{
  this.onPlayerEnters();
}
function onPlayerEnters()
{
   showStats(1024);
}
Reply With Quote
  #6  
Old 02-08-2007, 05:56 PM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
I don't see how there's a difference, both functions are called regardless.
Reply With Quote
  #7  
Old 02-08-2007, 06:27 PM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
Yeah but onCreated() is only called once. onPlayerEnters is called every time a player enters the level so it gets called more.
__________________

Coming soon (Hopefully:P)
Reply With Quote
  #8  
Old 02-08-2007, 06:32 PM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Quote:
Originally Posted by JkWhoSaysNi View Post
Yeah but onCreated() is only called once. onPlayerEnters is called every time a player enters the level so it gets called more.

Doesn't matter though, since when you enter it will call onCreated if you make it call onCreated when you enter either way, thus allowing you to set it up in the onCreated instead of the onPlayerEnters.
Reply With Quote
  #9  
Old 02-08-2007, 07:59 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
If you don't understand, that's your own fault. We're correct.
Reply With Quote
  #10  
Old 02-08-2007, 08:16 PM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Quote:
Originally Posted by Chandler View Post
If you don't understand, that's your own fault. We're correct.

If you can't explain it, then it's the same as not understanding.
Reply With Quote
  #11  
Old 02-08-2007, 08:18 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Quote:
Originally Posted by Gambet View Post
If you can't explain it, then it's the same as not understanding.
What isn't there to understand?
As far as I can see it, "JkWhoSaysNi" explained it.
Reply With Quote
  #12  
Old 02-08-2007, 08:41 PM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
Quote:
Originally Posted by Gambet View Post
If you can't explain it, then it's the same as not understanding.


Ok, consider:

a:
PHP Code:
function onPlayerEnters()
{
  
onCreated();

b:
PHP Code:
function onCreated()
{
  
onPlayerEnters();


Now, if a player enters the level with

a: onPlayerEnters() gets called and onCreated() gets called then the rest of the script gets executed

b: onPlayerEnters() gets called and the rest of the script executes.

Since onPlayerEnters will get called more than onCreated() b is the most efficient.

I don't think i can explain it any clearer than that.
__________________

Coming soon (Hopefully:P)
Reply With Quote
  #13  
Old 02-08-2007, 09:23 PM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
You're both wrong. You should only need to call showstats once. If it doesn't stay as you set it, there's another script interfering.

And it's good practice to not call onCreated().
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote
  #14  
Old 02-08-2007, 09:32 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Quote:
Originally Posted by Tolnaftate2004 View Post
You're both wrong. You should only need to call showstats once. If it doesn't stay as you set it, there's another script interfering.

And it's good practice to not call onCreated().
I assure you, try this on a playerworld
Reply With Quote
  #15  
Old 02-08-2007, 10:45 PM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
Quote:
Originally Posted by Chandler View Post
I assure you, try this on a playerworld
Works on Zenkou fine.
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote
  #16  
Old 02-08-2007, 10:46 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Quote:
Originally Posted by Tolnaftate2004 View Post
Works on Zenkou fine.
Custom health / death? Doesn't involve "player.hearts"?
Reply With Quote
  #17  
Old 02-08-2007, 10:55 PM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
Quote:
Originally Posted by Chandler View Post
Custom health / death? Doesn't involve "player.hearts"?
I tried it without the custom health and I still have no problem.
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote
  #18  
Old 02-08-2007, 10:59 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Quote:
Originally Posted by Tolnaftate2004 View Post
I tried it without the custom health and I still have no problem.
Weird. I tried doing something similar on V$:Conflict, it appeared on odd occasions. May have been another NPC as you've said.
Thanks for clearing that up
Reply With Quote
  #19  
Old 02-08-2007, 11:01 PM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
Quote:
Originally Posted by Chandler View Post
Weird. I tried doing something similar on V$:Conflict, it appeared on odd occasions. May have been another NPC as you've said.
Thanks for clearing that up
I know what you're talking about though, that sometimes a GUI will flash when the player's hurt...
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote
  #20  
Old 02-09-2007, 01:22 AM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
Quote:
Originally Posted by Tolnaftate2004 View Post
You're both wrong. You should only need to call showstats once. If it doesn't stay as you set it, there's another script interfering.

Yes, as someone might put in a level to show different stats. Which is why you need it onPlayerEnters. It's the same with custom tilesets, in theory you should be able to just set them once but if a level changes it, it'll never get changed back if you just do it on onCreated().
__________________

Coming soon (Hopefully:P)
Reply With Quote
  #21  
Old 02-12-2007, 03:20 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
You're all nerds
PHP Code:
//#CLIENTSIDE
function onCreated()
{
  
showStats1024 );
}
function 
onPlayerEnters()
{
  
showStats1024 );

Oww that was hard ... Took over 2 seconds to write!
__________________
Reply With Quote
  #22  
Old 02-12-2007, 04:18 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 cbkbud View Post
You're all nerds
PHP Code:
//#CLIENTSIDE
function onCreated()
{
  
showStats1024 );
}
function 
onPlayerEnters()
{
  
showStats1024 );

Oww that was hard ... Took over 2 seconds to write!
Wait, why you reply to a thread where the thread starter has got the answer,
and you start your post with.. "You're all nerds"..

You didn't need to put that first line in your post..

And, it is not needed to use two showstats, its fine to have it in on of the functions..
__________________
Reply With Quote
  #23  
Old 02-13-2007, 03:51 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Chompy View Post
Wait, why you reply to a thread where the thread starter has got the answer,
and you start your post with.. "You're all nerds"..

You didn't need to put that first line in your post..

And, it is not needed to use two showstats, its fine to have it in on of the functions..
I put two because people were arguing about what place to put it. If you put it in both, it solves the problem
__________________
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 12:14 AM.


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