Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Stumped (https://forums.graalonline.com/forums/showthread.php?t=63664)

RavenofEarth 01-23-2006 06:17 AM

Stumped
 
I'm a bit stumped as to how to get gani's to show in one certain level, but when you enter another, the default gani's show...any suggestions?

Rick 01-23-2006 06:22 AM

ganis for what?

Explain more about what you're trying to do...

RavenofEarth 01-23-2006 06:24 AM

Basically, my overworld, when you enter the overworld levels "worldmap_" it is supposed to change your gani's to a specific gani. And when you leave off the overworld, it should change your gani's back to your default walk, idle, etc.

ZeLpH_MyStiK 01-23-2006 07:11 AM

check the level you're in, and then use replaceani?

RavenofEarth 01-23-2006 07:15 AM

This is what I have

NPC Code:
//#CLIENTSIDE
if (created || timeout) {
if (startswith(worldmap_,#L)) {
setani yen-mini-idle,;
replaceani idle,yen-mini-idle;
replaceani walk,yen-mini-walk;
replaceani sit,yen-mini-idle;
replaceani swim,yen-mini-idle;
replaceani sleep,yen-mini-idle;
replaceani sword,yen-mini-idle;
replaceani push,yen-mini-idle;
replaceani pull,yen-mini-idle;
replaceani lift,yen-mini-idle;
replaceani hurt,yen-mini-idle;
replaceani grab,yen-mini-idle;
}
}



And that sets the gani's when I enter that level, but if i exit to another level, I need the gani's to set back to the original idle, walk, etc.

napo_p2p 01-23-2006 07:25 AM

This should help without giving out the whole answer.

Let's say you changed the idle gani with replaceani. To set it back to default do:

PHP Code:

replaceani idle,idle


ZeLpH_MyStiK 01-23-2006 07:28 AM

The script is called on creation, thus the reason why it's changing (or it's rather an illusion) when you enter the level. You are using a timeout loop that you never defined so the if (timeout) part will never be called. Try using
if (created || playerenters)
instead.

RavenofEarth 01-23-2006 07:28 AM

That's not helping me, How do I set it when i leave that level. Do I have to put an NPC in every level outside of the worldmap_ that sets the gani's, but then wouldn't that interfere with NPC's? Isn't there a way that if (created || timeout) <insert the rest of that script above, then at the end some how impliment a "else -blah-"?

ZeLpH_MyStiK 01-23-2006 07:39 AM

Why are you using a timeout if you're not even setting the timeout? -.-
Check for
if (created || playerenters) {}
then check to see what level the player is in and replace with the respective ganis.

RavenofEarth 01-23-2006 07:43 AM

I changed it to the playerenters and such, but when I leave the world map, I am still using the gani that it made me use on the world map...

Raeiphon 01-23-2006 11:57 AM

Couldn't you replace timeout with timereverywhere?

Lance 01-23-2006 12:41 PM

Quote:

Originally Posted by Raeiphon
Couldn't you replace timeout with timereverywhere?

That's deprecated. Also, it wouldn't solve this problem if it was not deprecated. Please do not post bad advice.

Lance 01-23-2006 12:42 PM

Quote:

Originally Posted by RavenofEarth
I changed it to the playerenters and such, but when I leave the world map, I am still using the gani that it made me use on the world map...

Did you add a code block for resetting the animations? 'Cause it's kinda silly to expect it to happen without you specifying that it ought to.

ZeLpH_MyStiK 01-23-2006 12:53 PM

No where in your code does it say that it would reset the animation, so why would you expect it to? -.- Try using an elseif statement and resetting the animation below that.

Raeiphon 01-23-2006 04:01 PM

Quote:

Originally Posted by Lance
That's deprecated. Also, it wouldn't solve this problem if it was not deprecated. Please do not post bad advice.

I was asking.

And instead of double posting, ever heard of edit?

haunter 01-23-2006 04:27 PM

Quote:

Originally Posted by Raeiphon
And instead of double posting, ever heard of edit?

Ever heard of tree structure? Read the rules.

Rick 01-23-2006 05:17 PM

Quote:

Originally Posted by RavenofEarth
That's not helping me, How do I set it when i leave that level. Do I have to put an NPC in every level outside of the worldmap_ that sets the gani's, but then wouldn't that interfere with NPC's? Isn't there a way that if (created || timeout) <insert the rest of that script above, then at the end some how impliment a "else -blah-"?

HTML Code:

if (created || playerenters) { // This event is triggered every time a player enters a level.
  if (startswith(worldmap_,#L)) {
    /* player has entered a level that begins with worldmap_ */
  }
  else {
    /* player has entered a level that does not begin with worldmap_ */
  }
}

The block of code within an else (after an if statement) will be executed if that if statement is false.

RavenofEarth 01-23-2006 06:00 PM

:D See, I knew one thing, but I wasn't sure how it was to be set up. the elseif worked, appreciate it.

Lance 01-24-2006 12:06 AM

Quote:

Originally Posted by Raeiphon
I was asking.

And instead of double posting, ever heard of edit?

Ever heard of "read the forum rules" or "there are other types of view modes than linear"?

Well, I guess you have since Jordan already posted it. :)

Tip: don't tell a moderator how to post.


All times are GMT +2. The time now is 02:10 AM.

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