SphereCommunity

Full Version: Housing misnomer
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello friends.
I am from Turkey but do not get a response from the Turkish site.
I want to get help from you.

[House.scp] I'm writing
tebel when I click to change the name, do not change.

[dialog d_evismidegis]
0,0
nomove
noclose
resizepic 0 0 3500 450 140
gumppic 10 10 100
dtextentry 165 10 195 35 044 1 ?
button 360 10 4024 4025 1 0 27

[dialog d_evismidegis button]
on 27
SRC.SYSMESSAGE @666 Evinizin yeni ismi kontrol ediliyor..
SRC.PROMPTCONSOLE f_change_house_name

[FUNCTION f_change_house_name]
if (<TARG.TYPE>==t_sign_gump)
if !(<isempty <ARGS>>)
if STRMATCH("[a-z]*","<ARGS>")
src.SYSMESSAGE @1152 Evinizin ismi degisti.
TARG.NAME=<ARGS>
TARG.RESENDTOOLTIP
else
src.sysmessage @38 Gecersiz isim.!
endif
It should work like this.

Code:
[dialog d_evismidegis]
0,0
nomove
noclose
page 0
resizepic 0 0 3500 450 140
gumppic 10 10 100
dtextentry 165 10 195 35 044 1 ? // Put a Number instead of ?
button 360 10 4024 4025 1 0 27

[dialog d_evismidegis button]
on=27
// Change all the "?" to the Number of your dtextentry !
// i just coppied the sysmessages, so i'm not sure if they are in the correct place. I don't speak turkish
if (<type>==t_sign_gump) // shouldn't be needed, if you call the dialog via sdialog from the housegump
    if !<argtxt[?]> // Nothing is written into the dialog
        src.sysmessage @1152 the house-name can't be changed into "nothing"
        return 1
    endif
        if ( strregex([^A-Za-z0-9\s]+,<argtxt[?]>) != 1 ) // Allows only letters and numbers, nothing else. Remove 0-9 if you only want letters
            name=<argtxt[?]>
            src.sysmessage @1152 Evinizin ismi degisti.
            resendtooltip
        else
            src.sysmessage @32,,1 Gecersiz isim.!
        endif
   return 0
endif
Not knowing the importance of Turkish
Console error:
21:08: ERROR: (sphere_item_deco_signs.scp,633)Can't resolve <type>
21:08: ERROR: (sphere_item_deco_signs.scp,633)Undefined symbol ''

I wrote the following
Code:
[ITEMDEF 0bd1]
//brass sign
DEFNAME=i_sign_brass
TYPE=T_SIGN_GUMP
TDATA2=064
FLIP=1
RESOURCES=2 I_BOARD, 1 i_ingot_iron
CATEGORY=Decoration - Signs
SUBSECTION=Blank
DESCRIPTION=Brass Blank
DUPELIST=0bd2


on=@create
attr=attr_move_never

on=@Click
message @0481 Evin sahibi : <uid.<src.targ.more2>.name>
return 1

on=@Dclick
src.dialog d_evtabelasi
return 1

[dialog d_evtabelasi]
110,35
nomove
noclose
resizepic 0 0 3500 450 440
gumppic 10 10 100
button 150 10 4006 4007 1 0 1
dtext 195 10 1152 Evin ismini degistir
button 150 30 4006 4007 1 0 2
dtext 195 30 41 Tabelayi degistir
button 150 50 4006 4007 1 0 3
dtext 195 50 494 Evin durumu
button 150 70 4006 4007 1 0 4
dtext 195 70 5 Ayarlar
button 150 90 4006 4007 1 0 5
dtext 195 90 1152 Owner Ayarları
button 10 390 4005 4007 1 0 6
dtext 45 390 1152 Evden yasakla
button 10 410 4005 4007 1 0 7
dtext 45 410 1152 Yasak Kaldır
button 250 390 4005 4007 1 0 8
dtext 285 390 1152 Banka ac
button 250 410 4005 4007 1 0 9
dtext 285 410 1152 Kapat
dtext 45 115 494 Bu ev <src.targ.tag0.builton> tarihinde <uid.<src.targ.more2>.name>
dtext 45 150 494 tarafindan kurulmustur.
dtext 45 185 494 Tum playerlar sadece 1 ev kurabilir
dtext 45 220 494 Evler icine :
dtext 45 255 494 Dost & Ortak & Sahip 1 strongbox koyabilir.
dtext 45 290 0 Guvenli esya sayisi :
dtext 310 290 1152 <ddef.global_secure_storage>
else
dtext 310 290 1152 <dsrc.targ.tag0.storage_limit>
endif
dtext 45 325 0 Sabit esya sayisi :
dtext 310 325 1152 <dsrc.targ.tag0.locked_items>
dtext 45 360 0 Kilitli esya sayisi :
dtext 310 360 1152 <dsrc.targ.tag0.secure_cont>


[dialog d_evtabelasi button]
on 1
src.sysmessage @1152 Evinizin yeni ismi ne olsun?
src.dialog d_evisimdegis

[dialog d_evisimdegis]
0,0
nomove
noclose
resizepic 0 0 3500 450 140
gumppic 10 10 100
dtextentry 165 10 195 35 044 1 ?
button 360 10 4024 4025 1 0 27

[dialog d_evisimdegis button]
on 27
if (<type>==t_sign_gump)
    if !<argtxt[?]>
        src.sysmessage @38 isim yazmalisiniz.!
        return 1
    endif
        if ( strregex([^A-Za-z0-9\s]+,<argtxt[?]>) != 1 )
            name=<argtxt[?]>
            src.sysmessage @1152 Evinizin ismi degisti.
            resendtooltip
        else
            src.sysmessage @38 Gecersiz isim.!
        endif
   return 0
endif
I also
sphere_item_deco_signs
I'm organizing.
Or this my fault?
"House.scp" Should I create?
The important part was sdialog instead of src.dialog. This way the sign is the object, which calls the dialog.
Code:
[ITEMDEF 0bd1]
//brass sign
DEFNAME=i_sign_brass
TYPE=T_SIGN_GUMP
TDATA2=064
FLIP=1
RESOURCES=2 I_BOARD, 1 i_ingot_iron
DUPELIST=0bd2

CATEGORY=Decoration - Signs
SUBSECTION=Blank
DESCRIPTION=Brass Blank

on=@create
    attr=attr_move_never

on=@Click
    message @0481 Evin sahibi : <name>
    return 1

on=@Dclick
    sdialog d_evtabelasi
    return 1

[dialog d_evtabelasi]
110,35
nomove
noclose
resizepic 0 0 3500 450 440
gumppic 10 10 100
button 150 10 4006 4007 1 0 1
dtext 195 10 1152 Evin ismini degistir
button 150 30 4006 4007 1 0 2
dtext 195 30 41 Tabelayi degistir
button 150 50 4006 4007 1 0 3
dtext 195 50 494 Evin durumu
button 150 70 4006 4007 1 0 4
dtext 195 70 5 Ayarlar
button 150 90 4006 4007 1 0 5
dtext 195 90 1152 Owner Ayarlari
button 10 390 4005 4007 1 0 6
dtext 45 390 1152 Evden yasakla
button 10 410 4005 4007 1 0 7
dtext 45 410 1152 Yasak Kaldir
button 250 390 4005 4007 1 0 8
dtext 285 390 1152 Banka ac
button 250 410 4005 4007 1 0 9
dtext 285 410 1152 Kapat
dtext 45 115 494 Bu ev <src.targ.tag0.builton> tarihinde <uid.<src.targ.more2>.name>
dtext 45 150 494 tarafindan kurulmustur.
dtext 45 185 494 Tum playerlar sadece 1 ev kurabilir
dtext 45 220 494 Evler icine :
dtext 45 255 494 Dost & Ortak & Sahip 1 strongbox koyabilir.
dtext 45 290 0 Guvenli esya sayisi :
dtext 310 290 1152 <ddef.global_secure_storage>
else
dtext 310 290 1152 <dsrc.targ.tag0.storage_limit>
endif
dtext 45 325 0 Sabit esya sayisi :
dtext 310 325 1152 <dsrc.targ.tag0.locked_items>
dtext 45 360 0 Kilitli esya sayisi :
dtext 310 360 1152 <dsrc.targ.tag0.secure_cont>


[dialog d_evtabelasi button]
on 1
    src.sysmessage @1152 Evinizin yeni ismi ne olsun?
    sdialog d_evisimdegis

[dialog d_evisimdegis]
0,0
nomove
noclose
resizepic 0 0 3500 450 140
gumppic 10 10 100
dtextentry 165 10 195 35 044 1 ?
button 360 10 4024 4025 1 0 27

[dialog d_evisimdegis button]
on 27
    if <isempty <argtxt[1]>> || (strlen(<argtxt[1]>) < 3) // A Restriction to the length of the name?
        src.sysmessage @38 isim yazmalisiniz.!
        return 1
    endif
        if ( strregex([^A-Za-z0-9\s]+,<argtxt[1]>) != 1 )
            name=<argtxt[1]>
            src.sysmessage @1152 Evinizin ismi degisti.
            resendtooltip
        else
            src.sysmessage @38 Gecersiz isim.!
        endif
   return 0
[EOF]
Thank you very much.


So in this DTEXT code,
Home of the date of installation
and
How will write the name of the owner of the house?

Code:
dtext 45 115 494 Bu ev <src.targ.tag0.builton> tarihinde <uid.<src.targ.more2>.name>
The house owner
Code:
co_owner
I dare say.?
dtext 45 115 494 Bu ev <tag0.builton> tarihinde <name>

also change every "dsrc.targ.tag0." into "dtag0."

I don't know how the co_owner is stored in your system. If you store it as a tag , then you could checkit with :

dtext 45 115 494 <uid.<tag0.co_owner>.name>
Code:
<tag0.buiton>
and
Code:
<uid.<tag0.co_owner>.name>
can not be.
Maybe you need to use them somewhere else.
Thanks for your help.
I'll search
Reference URL's