I posted earlyer on how I could get the form to wait so I simply made another proc to do it.
proc/Check_Form()
if(usr:Done==1)
New_Map_File(usr:fx,usr:fy,usr:fz,usr:FileName,usr:name)
else
spawn(30) Check_Form()
and then in the ProcessForm() proc added one line code to the end saying usr:Done=1 so it would stop the loop.
And the obj I click too get the form is bellow.
obj/newfile
name="Make New File"
icon='newfile.dmi'
Click(src)
var/Form/New_Map/frm = new()
frm:DisplayForm()
world << "[usr:fx],[usr:fy],[usr:fz],[usr:FileName]."
world << "[usr:name]."
Check_Form()
Now the fallowing runtime error is what I get after I fill out the form and it processes.
runtime error: type mismatch
proc name: New Map File (/proc/New_Map_File)
usr: Green Lime (/mob/pc)
src: null
call stack:
New Map File("10", "10", "1", "Test.dmp", "Green Lime")
Check Form()
Check Form()
If any one is woundering this is what the New_Map_File proc code looks like.
proc/New_Map_File(var/x,var/y,var/z,var/FileName,var/Host)
var/x_string,y_string,z_string,mapfile
var/counter=0
for(x=x;x>0;x--)
x_string="[x_string]a"
for(y=y;y>0;y--)
y_string={"[x_string]
[y_string]"}
for(z=z;z>0;z--)
counter+=1
z_string={"(1,1,[counter])={"
[y_string]
" }
[z_string]"}
mapfile={""a" = (/turf,/area)
[z_string]"}
world << "[counter]."
world << "[x_string],[y_string],[z_string]."
world << "[mapfile]."
world << "[usr:fx],[usr:fy],[usr:fz],[usr:FileName]."
text2file(mapfile,FileName)
// var/savefile/F = new/savefile(FileName)
world << "[Host] has made the file [FileName]."
Thats every thing except the form and I dont think its the form part but just in case I will leave it up at the bottom of this post. So please help I dont have any clue Why or What this error means or how to fix it. So im stuck please help thanks :).
Form/New_Map
form_window="New_Map"
var
mapx
mapy
mapz
fName
ProcessForm()
usr:fx = mapx
usr:fy = mapy
usr:fz = mapz
usr:FileName = fName
usr:Done = 1
HtmlLayout() return \
{"
<{center><{b>New Map<{/b><{/center><{br>
Maps max x: [mapx]
Maps max y: [mapy]
Maps max z: [mapz]
Enter File Name:
[fName]
[submit]"}
ID:261650
![]() Nov 18 2002, 11:40 am
|
|
![]() Nov 18 2002, 11:47 am
|
|
You know that ProccessForm() is called when the player clicks the submit button, so why are you using Check_Form()? Just replace Done=1 in ProcccessForm() with a call to your New_Map_File(usr:fx,usr:fy,usr:fz,usr:FileName,usr:name) proc. Not that this will fix your current error, though.
|
Xooxer wrote:
You know that ProccessForm() is called when the player clicks the submit button, so why are you using Check_Form()? Just replace Done=1 in ProcccessForm() with a call to your New_Map_File(usr:fx,usr:fy,usr:fz,usr:FileName,usr:name) proc. Not that this will fix your current error, though. I all ready tryed this before and go this current error. runtime error: type mismatch proc name: New Map File (/proc/New_Map_File) usr: Green Lime (/mob/pc) src: null call stack: New Map File("10", "10", "1", "Test.dmp", "Green Lime") /Form/New_Map (/Form/New_Map): ProcessForm() /Form/New_Map (/Form/New_Map): StopWaiting() /Form/New_Map (/Form/New_Map): Topic("src=%5B0x21000000%5D&mapx=10&m...", /list (/list)) Which I have no idea what it means you? hehhe :) I just thought somthing Could the error becoming from where the obj is clicked. This such, I click the obj in my stat panel. The following code bellow does this. var/obj/newfile/f = new var/obj/openfile/o = new var/obj/savefile/s = new var/obj/editfile/e = new Stat() statpanel("Main Menu") stat(,f) stat(,o) stat(,s) stat(,e) |
You're doing yourself a vast disservice on two counts, here:
|
Your problem might be that you're passing strings into New_Map_File() instead of numbers, but I forget if it puts quotes around numbers when giving errors or not.
|
Lummox JR wrote:
You're doing yourself a vast disservice on two counts, here:
How do I do this? Please explain Lummox JR |
If you get an error with using : instead of ., then you hnaven't defined that var for mob/. It has to be defined under mob/, not mob/whatever/. Also, put #define DEBUG in your code for the debugging info.
|
Garthor wrote:
If you get an error with using : instead of ., then you hnaven't defined that var for mob/. It has to be defined under mob/, not mob/whatever/. Also, put #define DEBUG in your code for the debugging info. Well I just read the artical on ByondScape about the usr and src. So I think I undertand the diffrence between the . and : operators. Thanks Lummox JR. About the debug thingy thanks too Garthor. I think Im just going to start this whole new map file thingy over again and just use input() procs for now. Then after im complete with the whole program I may update it to HTML interface. Thanks for all your help though. |