ID:172161
 
ok im alittle confused when it comes to sending a form to another mob in world like example setting the form reciever vars to match the Form sender vars just a example of how to do this would be cool doesnt even need have anything to do with this code here or maybe just how to clarify who each are the sender reciever


mob/verb/Clan_Invite(var/mob/M in world)
if(M.Clan=="Loner")
var/Form/Clan_Invite/f = new()
f.DisplayForm(M)
else
src<<"<font color=green>[M] is already in a Clan"
return
<The Form>
Form/Clan_Invite
form_window="window=Clan_Invite,size=310x310,titlebar=1,can_resize=0"
var
Accept
Accept_1="Yes"
Accept_2="No"
Initialize()
Accept="No"
HtmlLayout()
var/info= {"<table><body bgcolor=black>
<tr>
<tr><td><b><font color=white>Accept:<td>
[Accept_1]<font color=white>Yes<HR>
<tr><td><b><font color=white>Decline:<td>
[Accept_2]<font color=white>No<HR>
<tr><td>&nbsp;</td><td>
[submit][reset]<HR>
"}

return info
ProcessForm()
usr << browse(null,"window=Clan_Invite")
if(Accept=="Yes")
world<<"[usr] has accepted the invite"
return
if(Accept=="No")
return
<Bump> ok no one is helping me:( .All i want to know is how to define who the Form senders is and how to set a var to define who he is.So i can make the person that recieved the form vars match his any suggestions?
In response to Solee
As you've probably already noticed, the argument you send DisplayForm() is the reciever. Within the various Form procs, usr is the reciever. There is no built in way to tell who sent the form.

You'll have to provide a var within the form to track who sent the invitation and set the var before calling DisplayForm().

Form/Clan_Invite/var/tmp/mob/sender

...

if(M.Clan=="Loner")
var/Form/Clan_Invite/f = new()
f.sender = src
f.DisplayForm(M)
In response to Shadowdarke
Thank you Shadowdarke this has been troubling me for awhile. I was going about it all wrong i was thinking i had to set the form senders var in the actual verb that sends the form.Thanks for clearing this up and helping me learn about forms i love to use them they look so much better then inputs Thanks again

Solee