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

Debugging help pwease! 0.0

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




Joined: 20 Jun 2009
Posts: 123
Location: My Own Little World

PostPosted: Mon Aug 24, 2009 12:55 pm    Post subject: Debugging help pwease! 0.0 Reply with quote

this is on a sort of related note to my last topic on help. im working on my zelda game, and i am removing the OHR battle system, and actually restarting the entire thing. I am trying to make the sword scipt. It keeps saying it expected top level declaration but found end. i do often mess up the number of paranthesis, but i have looked over it multiple times and cant find the problem. Here's the script:
Code:
include, plotscr.hsd
include, Zelda.hsi

global variable, begin
1, AB
2, CD
3, EF
4, GH
end

Plotscript, items, begin

#sword
if (key is pressed (44))

then (

suspend player

set hero picture (0,1)

AB:=NPC at spot (herofrontx,herofronty)

create NPC (99,herofrontx,herofronty)

wait(5)

destroy NPC (99)

if (get NPC ID (AB)==1)

then (destroy NPC (AB))

set hero picture (0,0)

resume player

)





#bomb
if ( Key is pressed(48) ) then ,begin

Create Npc (98,hero X (0),hero y (0))

Wait (30)

change NPC ID (98,97)

Wait (5)

change NPC ID (97,96)

AB:=NPC at spot (NPC X (96)+1, NPC y (96))

CD:=NPC at spot (NPC X (96)--1, NPC y (96))

EF:=NPC at spot (NPC X (96), NPC y (96)+1)

GH:=NPC at spot (NPC X (96), NPC y (96)--1)



If (  get NPC ID (AB) == 1 ) then ( destroy npc (AB) )
If (  get NPC ID (CD) == 1 ) then ( destroy npc (CD) )
If (  get NPC ID (EF) == 1 ) then ( destroy npc (EF) )
If (  get NPC ID (GH) == 1 ) then ( destroy npc (GH) )

If
((
  (hero x (0) <= NPC X (96)+1
  and
  hero x (0) >= (NPC X (96))--1)
)
and
(
  (hero y (0) <= NPC Y (96)+1
  and
  hero Y (0) >= (NPC Y (96))--1)
))
then

(set hero stat (0,0,get hero stat (hero:link,0)--1)
fade screen out (63,0,0)
fade screen in )

wait (3)
destroy npc (96) )

end, end


script, herofrontx, begin
if (hero direction(0)==up)
then (exit returning (hero x))
if (hero direction(0)==down)
then (exit returning (hero x))
if (hero direction(0)==left)
then (exit returning (hero x--1)
if (hero direction(0)==right)
then (exit returning (hero x+1)
end

script, herofronty, begin
if (hero direction(0)==up)
then (exit returning (hero y--1))
if (hero direction(0)==down)
then (exit returning (hero y+1))
if (hero direction(0)==left)
then (exit returning (hero y)
if (hero direction(0)==right)
then (exit returning (hero y)
end

_________________
Resident Evil RPG Demo

http://www.castleparadox.com/gamelist-display.php?game=963

Legend Of Zelda: Reptilian Warlord Demo

http://www.castleparadox.com/gamelist-display.php?game=961
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Spoon Weaver




Joined: 18 Nov 2008
Posts: 421
Location: @home

PostPosted: Mon Aug 24, 2009 2:05 pm    Post subject: Reply with quote

Simple.

You have 2 end's

Code:

end, end


script, herofrontx, begin



Remove one of them and that error message should go away.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
binoal




Joined: 20 Jun 2009
Posts: 123
Location: My Own Little World

PostPosted: Mon Aug 24, 2009 6:20 pm    Post subject: Reply with quote

but it needs the two ends. One is the end of the bomb portion of the script, one is the end of the entire items plotscript. and i havent modified the bomb part of the script, and that was working before i put in the sword part
_________________
Resident Evil RPG Demo

http://www.castleparadox.com/gamelist-display.php?game=963

Legend Of Zelda: Reptilian Warlord Demo

http://www.castleparadox.com/gamelist-display.php?game=961
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
msw188




Joined: 02 Jul 2003
Posts: 1041

PostPosted: Mon Aug 24, 2009 6:40 pm    Post subject: Reply with quote

I think Spoonweaver's in the right area, but the problem is why do you have the second end parenthesis in the line right before:

Code:
destroy npc (96) )


The 'then' block from right before has concluded, and you have the two end's right after to take care of that script. I'm pretty sure that that's the problem.
_________________
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
Spoon Weaver




Joined: 18 Nov 2008
Posts: 421
Location: @home

PostPosted: Mon Aug 24, 2009 7:18 pm    Post subject: Reply with quote

The problem went deeper still. I picked through it, edited it some, and got this version to compile. you're welcome

Code:

include, plotscr.hsd


global variable, begin
1, AB
2, CD
3, EF
4, GH
end

Plotscript, items, begin

#sword
if (key is pressed (44)) then (

suspend player

set hero picture (0,1)

AB:=NPC at spot (herofrontx,herofronty)

create NPC (99,herofrontx,herofronty)

wait(5)

destroy NPC (99)

if (get NPC ID (AB)==1) then (destroy NPC (AB))

set hero picture (0,0)

resume player

)





#bomb
if ( Key is pressed(48) ) then ,begin

Create Npc ( 98,hero X (0),hero y (0) )

Wait (30)

change NPC ID (98,97)

Wait (5)

change NPC ID (97,96)

AB:=NPC at spot (NPC X (96)+1, NPC y (96)  )

CD:=NPC at spot (NPC X (96)--1, NPC y (96) )

EF:=NPC at spot (NPC X (96), NPC y (96)+1  )

GH:=NPC at spot (NPC X (96), NPC y (96)--1 )



If (  get NPC ID (AB) == 1 ) then ( destroy npc (AB) )
If (  get NPC ID (CD) == 1 ) then ( destroy npc (CD) )
If (  get NPC ID (EF) == 1 ) then ( destroy npc (EF) )
If (  get NPC ID (GH) == 1 ) then ( destroy npc (GH) )

If (
( (hero x (0) <= NPC X (96)+1) and ( hero x (0) >= (NPC X (96))--1 ) ) and ( (hero y (0) <= NPC Y (96)+1) and ( hero Y (0) >= (NPC Y (96)--1 ) ) )
) then (
set hero stat ( 0,0,get hero stat (hero:link,0)--1 )
fade screen out (63,0,0)
fade screen in
)

wait (3)
destroy npc (96)

end,end


script, herofrontx, begin
if (hero direction(0)==up)
then (exit returning (hero x))
if (hero direction(0)==down)
then (exit returning (hero x))
if (hero direction(0)==left)
then (exit returning (hero x--1))
if (hero direction(0)==right)
then (exit returning (hero x+1))
end

script, herofronty, begin
if (hero direction(0)==up)
then (exit returning (hero y--1))
if (hero direction(0)==down)
then (exit returning (hero y+1))
if (hero direction(0)==left)
then (exit returning (hero y))
if (hero direction(0)==right)
then (exit returning (hero y))
end


script, debug, begin
end



There was a problem with the part :

Code:

If (
( (hero x (0) <= NPC X (96)+1) and ( hero x (0) >= (NPC X (96))--1 ) ) and ( (hero y (0) <= NPC Y (96)+1) and ( hero Y (0) >= (NPC Y (96)--1 ) ) )


which I fixed, also I added a debug script to make sure the last script had it's ( 's closed. Guess it wasn't that simple after all. Hope it's in working order now.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
binoal




Joined: 20 Jun 2009
Posts: 123
Location: My Own Little World

PostPosted: Tue Aug 25, 2009 9:53 am    Post subject: Reply with quote

haha wow, thanks! theres a few minor changes still to be made to the script, but other than that, i should be ready to make the other items!
_________________
Resident Evil RPG Demo

http://www.castleparadox.com/gamelist-display.php?game=963

Legend Of Zelda: Reptilian Warlord Demo

http://www.castleparadox.com/gamelist-display.php?game=961
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
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