![]() |
Baddy bugged on gmap
3 Attachment(s)
I made a baddy(ala zora's in Zelda), and it works fine in regular levels, but once it's put on gmap it completely bugs out. It doesn't show at all, it doesn't echo anything if I put an echo in it, and I can't figure out what's wrong with it. Here's the code, I'll attach the image as well for anyone who wants to mess with it hands on. What I want is it to randomly pop up in the level it originates in, not around the gmap.
Grrr... apparently I'll have to attach the script as well because the forums are being dumb! |
Hmmm eventually use onPlayerEnters() instead of onCreated()
|
Quote:
Because gmaps kinda run all scripts at once and if you have onCreated it will appear once |
Well, I changed that and it didn't help anything. This shows up in F2:
GraalScript: Loop limit exceeded in script of (in level vs_world-a3.nw at pos (35, 32)) And still not showing anything, and not executing the scripts. |
havent looked at the script but did your try that % thing?
|
Could easier with a onwater2() ;o
|
Do something like this to prevent endless loop:
PHP Code:
|
Quote:
|
Quote:
oh, and at onwater2: !onwater2(this.x - 1, this.y - 1, 64, 64) |
Hmm, Stefan's method doesn't actually force the NPC to spawn in water.
It works... but it'll spawn on land and such. So it's obvious the problem is the loop limit, although I dunno why it doesn't work on gmap's when it works fine on .nw's |
Hm, I generally prefer baddies to be serverside, because it makes it more like a true MMO, and less like a single player game where other players happen to be there, but still, nice work. But, unfortunately I believe this.level will return the gmap name, you'd have to script it to figure out the level name based on the x/y on the GMAP, which I believe the default profiles in Graal do when you look at your own profile. There's probably a few ways you could do it.
|
I was going to do it serverside, but there's too many complications with that. Also, shootball() doesn't work serverside, and I can't use projectiles for that(I originally did, but they disappeared on wall collision, defeating the purpose of this baddy).
And I've deducted that it's the loop causing the problem(see above post), because when the loop was removed, it works fine... except of course it spawns on land because it's not checking for water. |
I think I've finally 'fixed' the problem. Instead of finding water every time it warps, I'm simply going to have a 256 loop when it's created, and check every 4x4 square, and if it's water, add it to an array, and when it's time to warp, pick it's position from the array.
EDIT: seems this is not working... PHP Code:
|
| All times are GMT +2. The time now is 08:29 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.