Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

Strange Behaviour of "Read NPC"

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
Mr B




Joined: 20 Mar 2003
Posts: 382

PostPosted: Fri May 05, 2006 3:01 pm    Post subject: Strange Behaviour of "Read NPC" Reply with quote

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
View user's profile Send private message
Gizmog1
Don't Lurk In The Bushes!




Joined: 05 Mar 2003
Posts: 2257
Location: Lurking In The Bushes!

PostPosted: Sun May 07, 2006 7:40 am    Post subject: Reply with quote

Oh really? Happy Happy Happy

(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
View user's profile Send private message Send e-mail AIM Address
Mike Caron
Technomancer




Joined: 26 Jul 2003
Posts: 889
Location: Why do you keep asking?

PostPosted: Sun May 07, 2006 6:42 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Mr B




Joined: 20 Mar 2003
Posts: 382

PostPosted: Mon May 08, 2006 11:22 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
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