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-nmm7 (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-nmm7 (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-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Duel system
Author Message
an0n!m0use
Journeyman
*

Posts: 56
Likes Given: 16
Likes Received: 0 in 0 posts
Joined: Feb 2013
Reputation: 0



Post: #1
Duel system
Hi guys Bye

I have problem with my duel system ...

1)
PHP Code:
[ITEMDEF i_arena_first]
DEFNAME=i_arena_first
NAME
=Arena 1
ID
=0ed4
TYPE
=t_normal

On
=@Create
    ATTR
=attr_move_never|attr_static|attr_newbie
    
On
=@DClick
    
IF .....
    ELSE
        
SRC.SYSMESSAGE @38 Choose your opponent!
        
SRC.TARGETF f_select_opponent
        SERV
.NEWITEM i_duel_wait
        
NEW.EQUIP <SRC>
        NEW.
TIMER=5
    
ENDIF
    RETURN 
1

[ITEMDEF i_arena_second]
DEFNAME=i_arena_second
NAME
=Arena 1
ID
=0ed4
TYPE
=t_normal

On
=@Create
    ATTR
=attr_move_never|attr_static|attr_newbie
    

On
=@DClick
    
IF ......
    ELSE
        
SRC.SYSMESSAGE @38 Choose your opponent!
        
SRC.TARGETF f_select_opponent
        SERV
.NEWITEM i_duel_wait
        
NEW.EQUIP <SRC>
        NEW.
TIMER=5
    
ENDIF
    RETURN 
1


 
[FUNCTION f_select_opponent]
IF .....
ELSE
    
SERV.NEWITEM i_duel_memory
    
NEW.LINK <UID>
    
ARGO.EQUIP <NEW.UID// 15:47:ERROR: Undefined keyword 'ARGO.EQUIP'
    
NEW.TIMER=15
    SYSMESSAGE 
@55 You have choose <ARGO.NAMEto duel
ENDIF
RETURN 


ERROR:Its working, but sphere dont like that Rolleyes

2) About SERV.NEWITEM i_duel_memory
I have 5 stones and 5 different coordinates ... and i wonna make 1 func for all them
PHP Code:
[ITEMDEF i_duel_memory]
NAME=Duel Memory
ID
=i_memory
TYPE
=t_eq_script

On
=@Create 
    ATTR
=attr_newbie|attr_decay
    
On
=@Equip
    SDIALOG d_duel_arena_challenge
    
RETURN 1

On
=@Timer
    REMOVE
    
RETURN 1

[DIALOG d_duel_arena_challenge]
DTEXT BLA BLA 
BUTTON 210 210 1153 1154 1 0 2
BUTTON 250 210 1150 1151 1 0 1

[DIALOG d_duel_arena_challengee BUTTON]
On=0 1
 
.....
    
On=2
    SRC
.GO <DEF0.ARENA_1_1// 1st player
    
LINK.GO <DEF0.ARENA_1_2// 2nd player

[DEFNAME DEF_DUEL_CONFIG]
ARENA_1_1        1234,1234 // its coordinates for i_arena_first
ARENA_1_2     4321,4321

ARENA_2_1        5678
,5678 // its for i_arena_second
ARENA_2_2     8765,8765 
(This post was last modified: 03-21-2016 01:12 AM by an0n!m0use.)
03-21-2016 12:46 AM
Find all posts by this user Like Post Quote this message in a reply
rastrero
Master
**

Posts: 250
Likes Given: 41
Likes Received: 28 in 24 posts
Joined: Jan 2016
Reputation: 3



Post: #2
RE: Duel system
not enought info for helping you.

anyway.


ARGO.EQUIP <NEW> // 15:47:ERROR: Undefined keyword 'ARGO.EQUIP'
This error prob happens cos a invaed target. just an npc or an item.
U dont need to put <new.uid>, <new> is enought
03-21-2016 03:34 AM
Find all posts by this user Like Post Quote this message in a reply
an0n!m0use
Journeyman
*

Posts: 56
Likes Given: 16
Likes Received: 0 in 0 posts
Joined: Feb 2013
Reputation: 0



Post: #3
Information RE: Duel system
(03-21-2016 03:34 AM)rastrero Wrote:  not enought info for helping you.
Example: You have 2 stones - i_arena_first and i_arena_second
and one function for two stones: [FUNCTION f_select_opponent] and one [ITEMDEF i_duel_memory]
If [ITEMDEF i_arena_first] - first stone, first player go to ARENA_1_1 coordinates, and second to other ARENA_1_2 coordinates ...

If this [ITEMDEF i_arena_second] frst player go to ARENA_2_1 and second player go to ARENA_2_2

PHP Code:
[DEFNAME DEF_DUEL_CONFIG]
ARENA_1_1       1234,1234 // its coordinates for i_arena_first
ARENA_1_2         4321,4321

ARENA_2_1       5678
,5678 // its for i_arena_second
ARENA_2_2        8765,8765 


I wanna know, it's real using one function for a lot of duel stones ... or i need write for every stone individual function ....

Quote:ARGO.EQUIP <NEW> // 15:47:ERROR: Undefined keyword 'ARGO.EQUIP'
Thx, but problem not solved Sad
(This post was last modified: 03-21-2016 06:00 AM by an0n!m0use.)
03-21-2016 05:36 AM
Find all posts by this user Like Post Quote this message in a reply
rastrero
Master
**

Posts: 250
Likes Given: 41
Likes Received: 28 in 24 posts
Joined: Jan 2016
Reputation: 3



Post: #4
RE: Duel system
(03-21-2016 03:34 AM)rastrero Wrote:  ARGO.EQUIP <NEW> // 15:47:ERROR: Undefined keyword 'ARGO.EQUIP'
This error prob happens cos a invaed target. just an npc or an item.
U dont need to put <new.uid>, <new> is enought
This wasnt a fix. Just a note, dont put uid if it is not neccesary.

about your problem... Try to change to this

TRYSRC <argo> NEW.equip


About the other thing... hmm

You can make a for though all DUELSTONES using this.
"FORINSTANCES"
U need to check which stone is not in use. When find one, u got to use that stone for the duel and stop the loop.
03-23-2016 09:45 PM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes rastrero's post
an0n!m0use
Journeyman
*

Posts: 56
Likes Given: 16
Likes Received: 0 in 0 posts
Joined: Feb 2013
Reputation: 0



Post: #5
RE: Duel system
(03-23-2016 09:45 PM)rastrero Wrote:  TRYSRC <argo> NEW.equip
Perfect ! Thx !

Quote:You can make a for though all DUELSTONES using this.
"FORINSTANCES"
U need to check which stone is not in use. When find one, u got to use that stone for the duel and stop the loop.
I can not understand how it works Sad
Maybe some example or hint ? Rolleyes
03-24-2016 08:11 AM
Find all posts by this user Like Post Quote this message in a reply
rastrero
Master
**

Posts: 250
Likes Given: 41
Likes Received: 28 in 24 posts
Joined: Jan 2016
Reputation: 3



Post: #6
RE: Duel system
This is the example you are looking for.

Code:
[FUNCTION f_myfunction]
ref14=<seconduelist.uid>  //put here the uid pathof the second player,
FORINSTANCES i_duelstone
    if !<tag0.inuse>
       tag.inuse 1
       src.go <p>
       src.move 0 5
       ref14.go <p>
       ref14.move 0 -5
       return 1
    else
       local.stones +=1
       serv.log <uid> this stone is in use. <SRC.UID> player looking for a duelpit.
    endif
ENDFOR
src.sysmessage All rooms are in use.
serv.log  <SRC.UID> search done allduelpits in use TOTALSTONESsearched:<eval <local.stones>>
(This post was last modified: 03-25-2016 01:05 AM by rastrero.)
03-24-2016 12:44 PM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes rastrero's post
Post Reply 


Forum Jump:


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