The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Memories/Timers/Dialog Checkboxes/ What am I doing wrong?
Author Message
Reflex
Journeyman
*

Posts: 130
Likes Given: 0
Likes Received: 2 in 2 posts
Joined: Apr 2012
Reputation: 1



Post: #1
Memories/Timers/Dialog Checkboxes/ What am I doing wrong?
//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
//
(This post was last modified: 04-26-2012 06:06 PM by Reflex.)
04-26-2012 06:03 PM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #2
RE: Memories/Timers/Dialog Checkboxes/ What am I doing wrong?
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
(This post was last modified: 04-26-2012 08:58 PM by darksun84.)
04-26-2012 08:49 PM
Find all posts by this user Like Post Quote this message in a reply
RanXerox
Master
**

Posts: 550
Likes Given: 1
Likes Received: 12 in 9 posts
Joined: Dec 2010
Reputation: 19



Post: #3
RE: Memories/Timers/Dialog Checkboxes/ What am I doing wrong?
You can also use "CONT" in @Timer or perhaps "TOPOBJ" as long as the memory item is equipped on the character.
04-26-2012 10:33 PM
Find all posts by this user Like Post Quote this message in a reply
Khaos
Master
**

Posts: 595
Likes Given: 166
Likes Received: 83 in 51 posts
Joined: Mar 2012
Reputation: 11



Post: #4
RE: Memories/Timers/Dialog Checkboxes/ What am I doing wrong?
Cont and TopObj do work as RanXerox says. Don't forget you can ref<value> something Smile
04-29-2012 01:33 PM
Find all posts by this user Like Post Quote this message in a reply
Reflex
Journeyman
*

Posts: 130
Likes Given: 0
Likes Received: 2 in 2 posts
Joined: Apr 2012
Reputation: 1



Post: #5
RE: Memories/Timers/Dialog Checkboxes/ What am I doing wrong?
I always forget about ref! Learning 51a was the death of me ;p Thanks guys.
04-29-2012 02:51 PM
Find all posts by this user Like Post Quote this message in a reply
Khaos
Master
**

Posts: 595
Likes Given: 166
Likes Received: 83 in 51 posts
Joined: Mar 2012
Reputation: 11



Post: #6
RE: Memories/Timers/Dialog Checkboxes/ What am I doing wrong?
You are very welcome Reflex.
04-29-2012 03:50 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 2 Guest(s)