Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-24-2011, 10:06 PM
Nogross Nogross is offline
Registered User
Nogross's Avatar
Join Date: Feb 2011
Location: Germany
Posts: 23
Nogross is an unknown quantity at this point
Send a message via ICQ to Nogross
Question Bush Race Event proplem

First off, Hello.

I got a little proplem with my "Bushrace Event", I tryed to make a NPC which loops a if (condition), but it doesn't seem to work. It's the last part for my Event. So please help.

Nr.1
It checks in a loop if the player uses the gani "swim" but something doesn't seem to work. (*I can't find the failure , so please help me.)
PHP Code:
function onCreated()
{
setTimer(0.05);
}
function 
onTimeOut()
{
if (
player.ani == "swim,")
{
player.22;
player.12;
}
else
{
setTimer(1);
}

Nr.2
Not the same as above, but it also don't work. The proplem is the
if (player.ani..) doesn't work... Without the if (condition) it works perfectly.
PHP Code:
function onCreated()
{
setimg("block.png");
setshape(1,32,32);
drawunderplayer();
this.chat "Goal";
}
function 
onPlayerTouchsMe()
{
if (
player.ani == "carry,")
{
player.37.5;
player.22;
player.chat "Winner! (*" player.account ")";
hide();
}

Well, please help me. If it's a noob question I am srry but I can't find something usefull I need here on the forums.

Thanks anyway
NG
Reply With Quote
  #2  
Old 09-24-2011, 10:12 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
For the first, you don't need a comma in "swim," and you should either be doing it clientside or by looping through every player in the level. There is no "player" (or if it is, it's a random player, not every player in the level). I'd do it clientside with a 0.05 second timeout.

For the second, I suspect removing the comma will fix it. Otherwise, make sure that the ani they're touching with is indeed carry (and not carrywalk or carryidle or something—add an echo to test). Be sure to use player.communityname instead of player.account when displaying the winner.

Also, in the future please indent your code properly before asking for help on it. You can use this tool as a temporary fix, but you should normally be indenting code as you write it.
__________________
Reply With Quote
  #3  
Old 09-24-2011, 10:37 PM
Nogross Nogross is offline
Registered User
Nogross's Avatar
Join Date: Feb 2011
Location: Germany
Posts: 23
Nogross is an unknown quantity at this point
Send a message via ICQ to Nogross
Thanks cbk, I fixed all 2 proplems. And thanks also for the cool page. I use it now.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 03:58 PM.


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