 |
Castle Paradox
|
View previous topic :: View next topic |
Author |
Message |
Meatballsub Divine Bovine

Joined: 16 Jun 2003 Posts: 437 Location: Northwest Georgia
|
Posted: Fri Jul 18, 2008 9:34 pm Post subject: More scripting woes |
|
|
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 |
|
 |
msw188
Joined: 02 Jul 2003 Posts: 1041
|
Posted: Sat Jul 19, 2008 5:34 am Post subject: |
|
|
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 |
|
 |
Meatballsub Divine Bovine

Joined: 16 Jun 2003 Posts: 437 Location: Northwest Georgia
|
|
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
|