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

More scripting woes

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
Meatballsub
Divine Bovine




Joined: 16 Jun 2003
Posts: 437
Location: Northwest Georgia

PostPosted: Fri Jul 18, 2008 9:34 pm    Post subject: More scripting woes Reply with quote

Here is my latest problem:

Code:
script,construction,begin
if (check equipment (0,5) == (15)) then (
if (inventory (35) == (3)) then (
show textbox (101)
wait for textbox
delete item (35,3)
alter npc (1,NPCStat:picture,30)
alter npc (2,NPCStat:picture,30)
alter npc (3,NPCStat:picture,30)))
else (
show textbox (99)
wait for textbox)
end


The script is set to an on-touch npc and doesn't seem to do anything at all. If you don't have the right items or equipment, it does nothing. If you do have the right equipment and items, it still does nothing. Any ideas?
_________________
MOCBJ Software - My Games
The Hamster Wheel - OHRRPGCE Information Database
Back to top
View user's profile Send private message Visit poster's website
msw188




Joined: 02 Jul 2003
Posts: 1041

PostPosted: Sat Jul 19, 2008 5:34 am    Post subject: Reply with quote

So it is as if the script is never being run? Is your touch NPC surrounded by walls? I'm not sure if you can trigger a touch NPC through a wall. Additionally, I would recommend using the item:name format for any kind of item checking, because I'm pretty sure there are some number offsets involved with items.

There is a logical problem here as well. Right now you have, in pseudoscript,

Code:
if(A),then
 begin
  if(B),then
   begin
    #funfunfun
   end
 end
else
 begin


Where the else is clearly only attached to A. That is to say, the else block will only run if A is false; if A were true and B were false, the else block would not occur. The best way to do this is probably with "and":

Code:
if( eq==item:name , and , inv(item:name)==3),then
 begin
  funfunfun
 end
else
 begin
  textbox
 end


Also, are you sure you don't want the inventory count to allow >=3?
_________________
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
Meatballsub
Divine Bovine




Joined: 16 Jun 2003
Posts: 437
Location: Northwest Georgia

PostPosted: Sun Jul 20, 2008 1:30 am    Post subject: Reply with quote

That fixed my problem, thanks Happy
_________________
MOCBJ Software - My Games
The Hamster Wheel - OHRRPGCE Information Database
Back to top
View user's profile Send private message Visit poster's website
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