im having problems why when i try to call the Auction() when the hud object is clicked does it tell me the Auction() proc is undefined??
here is the code i am trying to get to work (theres more but the rest works just this bit also if theres any other problems that anyone can see please point them out for me :) )
obj
hud
Auction
layer = MOB_LAYER + 1
icon = 'Hud.dmi'
main icon_state = "Auction"
Click()
Auction()
New(client/C)
screen_loc = "1,1"
C.screen+=src
mob
proc
Auction()
var/AucChoice = input("What do you wish to do?","Start Auction","Stop Auction","Make A Bid","Cancel")
if(AucChoice == "Start Auction")
AuctionStart()
if(AucChoice == "Stop Auction")
AuctionStop()
if(AucChoice == "Make A Bid")
AuctionBid()
if(AucChoice == "Cancel")
return ..
ID:262076
Aug 12 2004, 6:59 am
|
|
In response to Loduwijk
|
|
oops my fault its cause i was using nandrews demo for help and wasnt really concentrating buuuuutttt it still says its undefined so still not fixed :(
|
In response to Hellgate_uk
|
|
Hellgate_uk wrote:
oops my fault its cause i was using nandrews demo for help and wasnt really concentrating buuuuutttt it still says its undefined so still not fixed :( It probably needs to be hud/proc/Auction...you need to have proc defined somewhere for the hud version of the method. |
In response to Deadron
|
|
ok so i thought rationally about my problem after what Deadron said and came up with this
obj hud Auction layer = MOB_LAYER + 1 icon = 'Hud.dmi' icon_state = "Auction" Click() call(/mob/proc/Auction()) New(client/C) screen_loc = "1,1" C.screen+=src but now i get this clients.dm:9:error: expected syntax: call([Object,]Proc)(Args) is there somthing im missing (well i know there is :P but its what im missing is the probl;em as i dont know what it is) (ti message sted after realising how dumb i was not to read the help file on Dream Make :P) |
In response to Hellgate_uk
|
|
my above problem has still not yet been answerd so if somone could answer that it would be greatly appreciated but i have another problem (i used teh same post as not to clutter up the forums) well here it is:
recently i have been thinking up ways of making a non messy attack system (ie one that isnt attached to every mob definition otherwise id be left with a extremly long attack system) and have stumbled across a problem that i cant find an answer to. The problem is that when i use the code stated below it does not just walk to mobs but turfs and objects aswell is there somthing i am missing out????? client Dblclick(M as mob) walk_to(mob, M) also i know that later on in this system i am going to need my above question answerd (about proc calling)so please anyone that can help please do :) |
In response to Hellgate_uk
|
|
Unfortunately, using "as type" doesn't guarantee that that variable/argument will actually be that type...
It is only for the compiler's sake... You declare M as a mob, and the compiler won't give you fits when you try to use it in your proc to access mob vars, procs, etc... But at runtime, that "as mob" does essentially nothing... So, if you want that to work for only mobs, then you need to add a check to make sure that M is indeed a mob... DblClick(mob/M as mob) |
In response to Hellgate_uk
|
|
Yes, you forgot the second set of parenthesi.
call(/mob/proc/Auction)()
The second set of parenthesi for call takes arguments to be passed to the called function. I suggest you just call the function yourself instead of calling another function. usr.Auction() That would have it looking like this: obj |
...to this.
You had Click and New indented too far, and why did you have the word main in there?