VS: Naive menu question

Esa Kivelä Esa.Kivela at ncrc.fi
Mon Jan 20 08:07:01 EST 2003


Greetings again from Finland:

I need some help:

I get follow error when main progeman call sunprogam and I don't figure out whats a problem...

please help.

here is a errors:

" * There was an Execution Error at 2:55:55 PM
Error description:  Handler: can't find handler
Object: card button id 8277 of card id 4067 of stack "C:/mud/MudWizad Editor ver. 0.1.rev"
--------------------
menoo
--------------------
Value: menoo

 * There was a Script Compile Error at 2:53:33 PM
Error description:  if: missing 'then'
Object: card button id 8277 of card id 4067 of stack "C:/mud/MudWizad Editor ver. 0.1.rev"
--------------------
if item 1 of the loc of cd button "weapon"" > item 1 of the rect of cd fld "drag&Drop" card "huone" and \
--------------------
Value:  > item 1 of the rect of cd fld "

And here is a progma of that button:

--CODE START----

on mouseUp
set cursor to watch

global lainis
global prossa
put numtochar(34) into lainis

--define object--
if cd fld "wname" is not empty then
put return & "object " & cd fld "wname" & ";" \
after last line of cd fld "objects" of card "huone"
end if
if cd fld "wname" is empty and\
cd fld "walias" is empty then
put "PUT WEAPON NAME AND ALIAS NAME FIRST!"
wait until the mouseClick
end if


-- make weapon--


put return & cd fld "wname" & "=clone_object(" & numtochar(34)\
& "obj/weapon" & numtochar(34) & ");" after last line of \
cd fld "weapon"

--weapons name--

put return & "call_other(" & cd fld "wname" & "," & lainis & "set_name"\
& lainis & "," & lainis & cd fld "wname" & lainis & ");"\
after last line of cd fld "weapon"

--weapons alias name--
put return & "call_other(" & cd fld "wname" & "," & lainis & "set_alias"\
& lainis & "," &lainis & cd fld "walias" & lainis & ");"\
after last line of cd fld "weapon"


--class for weapon--

put return & "call_other(" & cd fld "wname" & "," & lainis & "set_class"\
& lainis & "," & cd fld "wclass" & ");" after last line of cd fld "weapon"

--weight for weapon--

put return & "call_other(" & cd fld "wname" & "," & lainis & "set_weight"\
& lainis & "," & cd fld "weight" & ");"after last line of cd fld "weapon"

--value for weapon--

put return & "call_other(" & cd fld "wname" & "," & lainis & "set_value"\
& lainis & "," & cd fld "value" & ");"after last line of cd fld "weapon"

--Set read--
put return & "call_other(" & cd fld "wname" & "," & lainis & "set_read"\
& lainis & "," & lainis & cd fld "read" & "\n" & lainis & ");"\
after last line of cd fld "weapon"



long_desc

--set special hit fuction for weapon--

put return & "call_other(" & cd fld "wname" & "," & lainis & "set_hit_func"\
& lainis & "," & "this_object());" after last line of cd fld "weapon"

put return after last line of cd fld "weapon"


--Now check where that weapon should go??--

put return & cd fld "move1" after last line of cd fld "weapon"
put return & "}" after last line of cd fld "weapon"


--Special hit_func to weapon--

put return & "weapon_hit(attacker)" after last line of cd fld "weapon"
put return & "{" after last line of cd fld "weapon"
put return & "string alig;" after last line of cd fld "weapon"
put return & "if(call_other(attacker," &lainis & "id" & lainis\
& "," &lainis & cd fld "id" & lainis & ")){" after last line of cd fld "weapon"
put return & "write(" & lainis & cd fld "write" & "\n" & lainis\
& ");" after last line of cd fld "weapon"
put return & "return " & cd fld "exdmg" & ";" after last line of cd fld "weapon"
put return & "}" after last line of cd fld "weapon"
put return & "return 0;" after last line of cd fld "weapon"
put return & "}" after last line of cd fld "weapon"


------***LOPPUKOODI ELI IKKUNAN SULKEMISPROSESSI***--------------

lock screen
hide cd fld "wbg"
hide cd fld "winfo"
hide cd btn "make weapon"
hide cd fld "wname"
hide cd fld "wclass"
hide cd fld "weight"
hide cd fld "value"
hide cd fld "wlong"
hide cd fld "read"
hide cd btn id 401
hide cd fld "exdmg"
hide cd fld "id"
hide cd fld "write"
hide cd fld "walias"
show cd btn "kerran??"
show btn "weapon"
menoo
-- vilkaise

unlock screen

end mouseUp

--Long description---

on long_desc
  global lainis
  put numtochar(34) into lainis
   
  put return & "call_other(" & cd fld "wname" & ","\
      & lainis & "set_long" & lainis & "," after last line of cd fld "weapon"
   
  -- Put  lainis & line 1 of cd fld long & "\n" & lainis\
      --  after last line of cd fld "attributes"
   
  put empty into cd fld "wlong story"
   
  repeat with i=1 to number of lines of cd fld "wlong"
    Put return & "+ " & lainis & line i of cd fld wlong & "\n" & lainis \
        after last line of cd fld "wlong story"
  end repeat
   
  delete line 1 of cd fld "wlong story"
  delete char 1 of line 1 of cd fld "wlong story"
  -- delete char 2 of line 1 of cd fld "wlong story"
  put cd fld "wlong story" & ");" after last line of cd fld "weapon"
   
end long_desc




-----***ASEIDEN TSEKKAUS***--------------------------------------


on menoo
global lainis

---*** NðMð TULEVAT MONSULLE***----------------------------------------------------------------
if item 1 of the loc of cd button "kerran??" > item 1 of the rect of cd fld "drag&Drop" and \
item 1 of the loc of cd button "kerran??" < item 3 of the rect of cd fld "drag&Drop" and \
item 2 of the loc of cd button "kerran??" > item 2 of the rect of cd fld "drag&Drop" and \
item 2 of the loc of cd button "kerran??" < item 4 of the rect of cd fld "drag&Drop" then
put return & "move_object(" & cd fld "wname" & "," & cd fld "name" & "());" \
after last line of cd fld "weapon"
put return & "}" after last line of cd fld "weapon"
end if


if item 1 of the loc of cd button "weapon"" > item 1 of the rect of cd fld "drag&Drop" card "huone" and \
item 1 of the loc of cd button "weapon" < item 3 of the rect of cd fld "drag&Drop" and \
item 2 of the loc of cd button "weapon" > item 2 of the rect of cd fld "drag&Drop" and \
item 2 of the loc of cd button "weapon" < item 4 of the rect of cd fld "drag&Drop" then
put return & "move_object(" & cd fld "wname" & "," & cd fld "name" & "());" \
after last line of cd fld "weapon"
put return & "}" after last line of cd fld "weapon"
end if



---*** NðMð TULEVAT HUONEESEEN***----------------------------------------------------------------

if (item 1 of the loc of cd button "kerran??" < item 1 of the rect of cd fld "drag&Drop" or \
item 2 of the loc of cd button "kerran??" < item 2 of the rect of cd fld "drag&Drop" or \
item 2 of the loc of cd button "kerran??" > item 4 of the rect of cd fld "drag&Drop") and item 1 of the loc of cd btn "kerran??" < 516 then
put return & "move_object(" & cd fld "wname" & ", this_object());"\
after last line of cd fld "weapon"
end if


if (item 1 of the loc of cd button "weapon" < item 1 of the rect of cd fld "drag&Drop" or \
item 2 of the loc of cd button "weapon" < item 2 of the rect of cd fld "drag&Drop" or \
item 2 of the loc of cd button "weapon" > item 4 of the rect of cd fld "drag&Drop") and item 1 of the loc of cd btn "weapon" < 516 then
put return & "move_object(" & cd fld "wname" & ", this_object());"\
after last line of cd fld "weapon"
end if


end menoo



on vilkaise

  -- Armour piiloon jos huoneessa--
  if visible of cd fld "drag&drop" is false and \
      item 1 of the loc of cd btn "armour" < 168 and \
      item 2 of the loc of cd btn "armour" > 86 and \
      item 2 of the loc of cd btn "armour" < 362 then
    show cd btn "armour"
  end if
  if visible of cd fld "drag&drop" is false and \
      item 1 of the loc of cd btn "armour" > 33 and \
      item 1 of the loc of cd btn "armour" < 354 and \
      item 2 of the loc of cd btn "armour" > 86 and \
      item 2 of the loc of cd btn "armour" < 362 then
    show cd btn "armour"

  end if

  --piilottaa Monsterin kun nytt aseinfoa--
  if item 1 of the loc of cd btn id 427 > 33 and \
      item 1 of the loc of cd btn id 427 < 354 and \
      item 2 of the loc of cd btn id 427 > 86 and \
      item 2 of the loc of cd btn id 427 < 362 then
    show cd btn id 427
  end if


end vilkaise

----CODE END---

But what a heck that 


 * There was a Script Compile Error at 2:53:33 PM
Error description:  if: missing 'then'
Object: card button id 8277 of card id 4067 of stack "C:/mud/MudWizad Editor ver. 0.1.rev"
--------------------
if item 1 of the loc of cd button "weapon"" > item 1 of the rect of cd fld "drag&Drop" card "huone" and \
--------------------
Value:  > item 1 of the rect of cd fld "

means?????

Yours EsaK



More information about the use-livecode mailing list