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

Possible bug with ReadNPC command

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
Gizmog1
Don't Lurk In The Bushes!




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

PostPosted: Fri Jul 18, 2008 5:54 am    Post subject: Possible bug with ReadNPC command Reply with quote

I've been working on a script for my 8-Bit contest entry, and for certain reasons, I needed to use plotscripting to find out if the player is standing on a Step On npc. Long story short, my script didn't work, and tracing things down makes me think the problem is with the ReadNPC command itself, and not my script.

I've uploaded a demonstration, so everyone can play a long at home. http://www.castleparadox.com/gamelist-display.php?game=911
How I got game 911 exactly when I needed help, I may never know.



Code:
script,bugtest,begin
variable (Giz)
variable (Annoyed)
while (Giz==Annoyed)
do (
 #Checks to see if the Hero is standing on a Step-On NPC
 if (readnpc (NPCatSpot (HeroX(me),HeroY(me)),NPCstat:Activation)==2)
# then (UseNPC (NPCatSpot (HeroX(me),HeroY(me)))
# waitfortextbox)
 then (gameover)
 wait (1)
 )
end


If you run the game, you'll notice that as soon as you hit enter to leave the title screen, you're already back onto the title screen. If you go in the file, and change NPC 0's activation to use or touch, that doesn't happen. There are no instances of NPC 0 on the map.

It's for that reason that I think ReadNPC is returning as False, a constant for 0, and then reads NPC 0's status.

If you exchange the game over for the commented "UseNPC" code, nothing bad happens. UseNPC seems to be programmed correctly, and knows that there isn't an NPC at the player's location. Is it possible to make ReadNPC work the same way?

I think this is a problem with the engine but if it's just something wrong with my script, I'm sorry for wasting everyone's time.

(By the way, I've only tested this in Voxhumana, and July 14th's nightly. Same thing happens both places.)
Back to top
View user's profile Send private message Send e-mail AIM Address
msw188




Joined: 02 Jul 2003
Posts: 1041

PostPosted: Fri Jul 18, 2008 6:06 am    Post subject: Reply with quote

See bug 36. The culprit here seems to be NPC at Spot, which returns something (it can't return "nothing") that readNPC, which bounds its incoming arguments, views as a zero. The proper thing to do is most likely:

Code:
if(NPC at spot (herox(me), heroy(me)),then
 begin
  #All of your stuff
 end

_________________
My first completed OHR game, Tales of the New World:
http://castleparadox.com/gamelist-display.php?game=161

This website link is for my funk/rock band, Euphonic Brew:
www.euphonicbrew.com
Back to top
View user's profile Send private message Visit poster's website
Gizmog1
Don't Lurk In The Bushes!




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

PostPosted: Fri Jul 18, 2008 8:05 pm    Post subject: Reply with quote

Yeah, I think you're spot on there, MSW. Doesn't really matter now, my artist backed out, and my whole idea probably never would've worked anyway. Thanks for the advice
Back to top
View user's profile Send private message Send e-mail AIM Address
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