SphereCommunity
Memories/Timers/Dialog Checkboxes/ What am I doing wrong? - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: Memories/Timers/Dialog Checkboxes/ What am I doing wrong? (/Thread-Memories-Timers-Dialog-Checkboxes-What-am-I-doing-wrong)



Memories/Timers/Dialog Checkboxes/ What am I doing wrong? - Reflex - 04-26-2012 06:03 PM

//Trying to create a stuck menu option via dialog and checkbox and button and have it send u to certain locations depending if your blue or red. Having problems having my stuck memory tell the characters where to go.

//Please anyone who responds please explain yourself so I can learn.

//Errors cant resolve <src.kills>
//Errors undefinded symbol''
//errors undefined keyboard go
Code:
[PLEVEL 1]
help

[FUNCTION help]
DIALOG d_help_menu

[ITEMDEF i_memory_stuck]
ID=i_memory
name=i_memory_stuck
weight=0
type=t_eq_script
LAYER=layer_special

on=@create
    ATTR=attr_decay
    TIMER=600

ON=@Equip
TIMER=60
SRC.NOMOVES 600
src.sysmessage You are now waiting to be teleported.

on=@timer // HERE IS WHERE IM CONFUSED HOW DO I specify the character it is on ?
If (<src.kills> >= 5 )
src.say stuck timer needs to start here and send u randomly to a location. You chose Town!
DORAND 3
src.go Buccaneer's Den
src.go serpent's hold
src.go papua
src.say src
link.say link
say say
ENDDO
//RETURN 1
Else
DORAND 7
src.go britain
src.go minoc
src.go vesper
src.go trinsic
src.go moonglow
src.go yew
src.go delucia
ENDDO
Endif
remove
return 1


[DIALOG d_stuck_proceed]
0,0
page 0
resizepic 40 47 9200 318 203
resizepic 108 55 9200 178 24
dtext 118 55 0593 Proceed to Stuck Option
dhtmlgump 54 81 291 133 1 1 You are about to use the stuck option and will be unable to move.  This will make you vulnerable to attacks for no less than 1 minute of game

time. To proceed, click Okay.
button 214 220 247 248 1 0 1
button 283 221 241 243 1 0 0
Group 0
checkbox 50 223 208 209 0 2
dtext 70 221 1153 Town
checkbox 111 223 208 209 0 3
dtext 133 221 1153 Shrine
src.ctag.stuck = 1

[DIALOG d_stuck_proceed button]
ON=0 // cancel
src.sysmessage You have chosen to not use the stuck menu.

ON=1 // Okay
//src.nomoves 600
//src.say nomoves function has now been triggered.
Local.stuckcheck = 0
FOR 2 3
If <ARGCHK[<Local._for>]>
Local.stuckcheck += 1
Endif
ENDFOR
If <Local.stuckcheck> > <Src.Ctag.stuck>
Src.Sysmessage @34,,1 You have picked more than 1 option! Either Pick a Town or a Shrine!
Return 1
Endif
If <Local.stuckcheck> < <Src.Ctag.stuck>
Src.Sysmessage @34,,1 You have must choose either a town or a shrine to be teleported to!
Return 1
Endif

//IF HAS A MEMORY
if <ARGCHK[<Local._for>]> && <src.restest i_memory_stuck>
src.sysmessage you are currently using stuck option
endif

FOR 2
If <ARGCHK[<Local._for>]> //&& (<src.kills> >= 5 )
//src.say stuck timer needs to start here and send u randomly to a location. You chose Town!
serv.newitem i_memory_stuck
new.equip
//DORAND 3
//src.go Buccaneer's Den
//src.go serpent's hold
//src.go papua
//ENDDO
//RETURN 1
//Else
//DORAND 7
//src.go britain
//src.go minoc
//src.go vesper
//src.go trinsic
//src.go moonglow
//src.go yew
//src.go delucia
//RETURN 1
//ENDDO
Endif
ENDFOR
RETURN 1

FOR 3
If <ARGCHK[<Local._for>]>
src.say stuck timer needs to start here and send u randomly to a location. you chose Shrine!
DORAND 2
//4215,563,41 , 1729,3528,3, 1601,2489,9, 2491,3930, 1301,639,16, 3354,299,9, 4273,3702
src.go Duel Pits
ENDDO
return 1
//Src.<Local._for> = 1000
Endif
ENDFOR
//



RE: Memories/Timers/Dialog Checkboxes/ What am I doing wrong? - darksun84 - 04-26-2012 08:49 PM

As written in the wiki , There is no SRC in an @Timer event. , instead you have to use link.

So you put link = <src> in the @equip trigger ,and in the @timer trigger, you put link.kills etc .


Like this
Code:
ON=@Equip
TIMER=60
link=<src> // the item is now linked to the character , and you can access all character's propriertes and functions with link
SRC.NOMOVES 600
src.sysmessage You are now waiting to be teleported.

on=@timer
If (<link.kills> >= 5 )
link.say stuck timer needs to start here and send u randomly to a location. You chose Town!
DORAND 3
link.go Buccaneer's Den
link.go serpent's hold
link.go papua
link.say link
say say
ENDDO
//RETURN 1
Else
DORAND 7
link.go britain
link.go minoc
link.go vesper
link.go trinsic
link.go moonglow
link.go yew
link.go delucia
ENDDO
Endif
remove
return 1



RE: Memories/Timers/Dialog Checkboxes/ What am I doing wrong? - RanXerox - 04-26-2012 10:33 PM

You can also use "CONT" in @Timer or perhaps "TOPOBJ" as long as the memory item is equipped on the character.


RE: Memories/Timers/Dialog Checkboxes/ What am I doing wrong? - Khaos - 04-29-2012 01:33 PM

Cont and TopObj do work as RanXerox says. Don't forget you can ref<value> something Smile


RE: Memories/Timers/Dialog Checkboxes/ What am I doing wrong? - Reflex - 04-29-2012 02:51 PM

I always forget about ref! Learning 51a was the death of me ;p Thanks guys.


RE: Memories/Timers/Dialog Checkboxes/ What am I doing wrong? - Khaos - 04-29-2012 03:50 PM

You are very welcome Reflex.