 |
Castle Paradox
|
View previous topic :: View next topic |
Author |
Message |
Mr B
Joined: 20 Mar 2003 Posts: 382
|
Posted: Fri May 05, 2006 3:01 pm Post subject: Strange Behaviour of "Read NPC" |
|
|
I've been using the "Read NPC()" command to get the palette of various NPCs. It seems to be malfunctioning for an NPC slot.
Code: | data := read NPC(NPC at spot(hero x(me), hero y(me)), NPCstat:palette)
show value(data)
if(data==hero_color) then ( set hero position(me, NPC x(target), NPC y(target)) ) |
The code is for a teleportation device -- if the palette of the teleport NPC is the same as the palette of the hero, it warps the hero to the location of the NPC with the ID# that is passed to the warp script.
When I run this code for NPC #12 (on map #1) it returns the number 1 -- when the NPC is not using that palette. I have tried it with both palette 3 and 4, and in both circumstances it returns a 1.
I have tried the same code with several different NPCs, and it doesn't have that problem. I have created an NPC in slot 14 with all the same characteristics as the problem NPC in slot 12 (same code called, same everything), and it works fine.
Have I stumbled upon some insidious bug? Am I just being dumb?
EDIT: I used a different NPC and went on. However, NPC 12 on map #2 has the same(ish?) problem, and it runs entirely different code. As far as I can tell, the only similarity it has with the previous problem is that it also uses the "read NPC()" command to retrieve palette info.
I would test to see what kind of data it is getting return (I suspect it is returning a 1 or somesuch), but I need to go to work. I'll test it when I get back.
MORE EDIT: I used "show value()" to show the value returned by "read NPC()" when looking for the palette. It does indeed return a 1 for the NPC in slot 12, but it returns the correct number (2) for an NPC in slot 13.
It's not as if I am running out of NPC slots or anything, but this seems weird enough to look into. It might be indicative of deeper errors. |
|
Back to top |
|
 |
Gizmog1 Don't Lurk In The Bushes!

Joined: 05 Mar 2003 Posts: 2257 Location: Lurking In The Bushes!
|
Posted: Sun May 07, 2006 7:40 am Post subject: |
|
|
Oh really?
(Jeez! These spam bots are getting smarter, but the porn is getting worser!)
That is a strange problem, and I'm not 100% sure what might cause it. Let me think a little bit, and maybe get back to you on what non-programming things it might be (I'm not ap rogrammer, so I can't look through the engine itself, but they probably ought to) |
|
Back to top |
|
 |
Mike Caron Technomancer

Joined: 26 Jul 2003 Posts: 889 Location: Why do you keep asking?
|
Posted: Sun May 07, 2006 6:42 pm Post subject: |
|
|
Is it *just* NPC 12? Or, do any others exhibit this behaviour? I just looked at that code the other day, and all seems well. Does the npc stat() return the right value if you change palettes on 13? _________________ I stand corrected. No rivers ran blood today. At least, none that were caused by us.
Final Fantasy Q
OHR Developer BLOG
Official OHRRPGCE Wiki and FAQ |
|
Back to top |
|
 |
Mr B
Joined: 20 Mar 2003 Posts: 382
|
Posted: Mon May 08, 2006 11:22 am Post subject: |
|
|
I don't know if it is only NPC 12, but neither 11 nor 13 did this, and I haven't had any problems (that I've noticed!) with any other NPCs -- of course, I haven't used all of the NPC IDs, nor does each NPC have a "NPC stat()" call that looks at palettes.
I'll try and make a test game for that this afternoon. |
|
Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|