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:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
no == ?
Author Message
x77x
Master
**

Posts: 488
Likes Given: 0
Likes Received: 15 in 15 posts
Joined: Mar 2012
Reputation: -4



Post: #1
no == ?
PROBLEM#1
Code:
[events e_army_soldier]
ON=@NPCLookAtChar//TO INTERACT WITH NPCS
IF (<SRC.TAG0.MILITARY>)
    IF !(<SRC.TAG.ARMYNUMBER>==<TAG.ARMYNUMBER>)
    ATTACK <SRC>
    ELIF (<SRC.FLAGS>&statf_criminal) || (<SRC.KILLS> >= 3 ) || (<SRC.KARMA> <= -2000 )//ATTACK MILITARY CRIMINALS
    Say Beat it military criminal!
    ATTACK <SRC>
    ELIF (<SRC.MEMORYFINDTYPE.0400.LINK>>040004010)//ATTACK every PLAYER made guild
    ATTACK <SRC>
    ENDIF
ELSEIF (<SRC.FLAGS>&statf_criminal) || (<SRC.KILLS> >= 3 ) || (<SRC.KARMA> <= -2000 )//ATTACK CIVILIAN CRIMINALS
    Say Beat it civilian criminal!
    ATTACK <SRC>
ENDIF

ON=@GetHit
IF (<SRC.TAG0.MILITARY>)
    IF (<SRC.TAG.ARMYNUMBER>==<TAG.ARMYNUMBER>)
    src.criminal 1
    ENDIF
ENDIF

ON=@NotoSend//2 ALLY 5 ENEMY 6 RED    
IF (<SRC.TAG0.MILITARY>)
    IF !(<SRC.TAG.ARMYNUMBER>==<TAG.ARMYNUMBER>)
    ARGN1=5
    ELIF (<SRC.TAG.ARMYNUMBER>==<TAG.ARMYNUMBER>)
    ARGN1=2
    ENDIF
ENDIF

ERRORS

16:01:ERROR:(3kuo_E_ARMYLIFE_NPCS.scp,6)Undefined symbol ''
16:01:ERROR:(3kuo_E_ARMYLIFE_NPCS.scp,21)Undefined symbol '' ['==040004000)']
16:01:ERROR:(3kuo_E_ARMYLIFE_NPCS.scp,28)Undefined symbol '' ['==040004000)']

PROBLEM #2
Code:
ON=0 Sun Quan [Wu]
TAG.ARMY wu
COLOR color_wu
LINK 01fda
MORE 32
SERV.ALLCLIENTS SYSMESSAGE @021 <NAME> is now controlled by Sun Quan [Wu]
foritems 200
    if (<type>==t_spawn_char)
        if (<isevent.t_<tag.cityname>>) || (<isevent.t_<tag.cityname>_BOSS1>) || (<isevent.t_<tag.cityname>_BOSS2>) || (<isevent.t_<tag.cityname>_BOSS3>)
            stop
            start//timer=2
        endif
    endif
endfor
SERV.ALLCLIENTS f_city_change <uid>

ERROR

16:00:ERROR:(sphere_items_townstones.scp,78)Undefined symbol 't_' ['t_']
16:00:ERROR:(sphere_items_townstones.scp,78)Undefined symbol 't__BOSS1' ['t__BOSS1']
16:00:ERROR:(sphere_items_townstones.scp,78)Undefined symbol 't__BOSS2' ['t__BOSS2']
16:00:ERROR:(sphere_items_townstones.scp,78)Undefined symbol 't__BOSS3' ['t__BOSS3']

Dragons of Time 2000-2020
http://dragonsoftime.com
(This post was last modified: 09-27-2016 06:10 AM by x77x.)
09-27-2016 06:06 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: no == ?
if <SRC.TAG.ARMYNUMBER> --> if <SRC.TAG0.ARMYNUMBER>


(<SRC.MEMORYFINDTYPE.0400.LINK> > 040004010) //why not if <guild> ??




////2 problem
if (<isevent.t_<tag.cityname>>) || (<isevent.t_<tag.cityname>_BOSS1>) || (<isevent.t_<tag.cityname>_BOSS2>) || (<isevent.t_<tag.cityname>_BOSS3>)

are u sure tag.cityname have a value?
(This post was last modified: 09-27-2016 07:59 AM by rastrero.)
09-27-2016 07:55 AM
Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #3
RE: no == ?
you must debug the code to check tag values, because probably these tags are empty

quick example: lets suppose that you have an TAG.City="minoc", so you expect an event 'e_<TAG.City>_city' will be 'e_minoc_city'. But if for some reason the TAG.City is empty, the event name will be e_[nothing here]_city --> e__city

that's exactly whats happening on your code. An easy way to find these problems is debbuging the values, making it display the tag value somewhere (SAY, SYSMESSAGE, SERV.B, etc) just to make it easy to check if values are correct, like this:
Code:
SERV.B SRC.TAG.ArmyNumber: <SRC.TAG.ARMYNUMBER> / TAG.ArmyNumber: <TAG.ARMYNUMBER>
this will make everything readable and easy to check if there's something wrong on this next line:
Code:
IF !(<SRC.TAG.ARMYNUMBER>==<TAG.ARMYNUMBER>)
09-27-2016 10:17 AM
Find all posts by this user Like Post Quote this message in a reply
x77x
Master
**

Posts: 488
Likes Given: 0
Likes Received: 15 in 15 posts
Joined: Mar 2012
Reputation: -4



Post: #4
RE: no == ?
Code:
[MENU TOWNCONTROL]
WHO OWNS THIS TOWN?
ON=0 Cao Cao [Wei]
TAG.ARMY wei
COLOR color_wei
LINK 01ffd
MORE 3//COLOR FOR WARMAP
SERV.ALLCLIENTS SYSMESSAGE @04 <NAME> is now controlled by Cao Cao [Wei]
foritems 200
    if (<type>==t_spawn_char)
        if (<isevent.t_<tag.cityname>>) || (<isevent.t_<tag.cityname>_BOSS1>) || (<isevent.t_<tag.cityname>_BOSS2>) || (<isevent.t_<tag.cityname>_BOSS3>)
            stop
            start//timer=2
        endif
    endif
endfor
SERV.ALLCLIENTS f_city_change <uid>
//




Code:
[TYPEDEF t_xuchang]
ON=@Timer
tag.cityname xuchang
IF (STRMATCH("*infantry_light_c","<more1>")==1)
tag.spawn=infantry_light_c
ELIF (STRMATCH("*infantry_light_f","<more1>")==1)
tag.spawn=infantry_light_f
ELIF (STRMATCH("*infantry_archer","<more1>")==1)
tag.spawn=infantry_archer
ELIF (STRMATCH("*infantry_ambush_f","<more1>")==1)
tag.spawn=infantry_ambush_f
ELIF (STRMATCH("*infantry_ambush_a","<more1>")==1)
tag.spawn=infantry_ambush_a
ELIF (STRMATCH("*infantry_heavy","<more1>")==1)
tag.spawn=infantry_heavy
ELIF (STRMATCH("*infantry_elite","<more1>")==1)
tag.spawn=infantry_elite
ELIF (STRMATCH("*infantry_commander","<more1>")==1)
tag.spawn=infantry_commander
ELIF (STRMATCH("*calvary_light","<more1>")==1)
tag.spawn=calvary_light
ELIF (STRMATCH("*calvary_heavy","<more1>")==1)
tag.spawn=calvary_heavy
ELIF (STRMATCH("*calvary_elite","<more1>")==1)
tag.spawn=calvary_elite
ELIF (STRMATCH("*calvary_commander","<more1>")==1)
tag.spawn=calvary_commander
ELIF (STRMATCH("*elite_guard","<more1>")==1)
tag.spawn=elite_guard
ELIF (STRMATCH("*general","<more1>")==1)
tag.spawn=general
ENDIF
//
REF1=<UID.040004100.LINK>
IF (<REF1>==01ffd)//townstone owner is cao cao lord of wei
    color=color_wei
    tag.army wei
    more=c_wei_<tag.spawn>
ELSEIF (<REF1>==01fda)//sunquan
    color=color_wu
    tag.army wu
    more=c_wu_<tag.spawn>
ELSEIF (<REF1>==01fd1)//liubei
    color=color_shu
    tag.army shu
    more=c_shu_<tag.spawn>
ELSEIF (<REF1>==01fd5)//yuanshao
    color=color_ys
    tag.army ys
    more=c_ys_<tag.spawn>
ELSEIF (<REF1>==01fc5)//lubu
    color=color_lb
    tag.army lb
    more=c_lb_<tag.spawn>
ELSEIF (<REF1>==01ff7)//zhangjiao
    color=color_yt
    tag.army yt
    more=c_yt_<tag.spawn>
ELSEIF (<REF1>==01fdc)//menghuo
    color=color_mh
    tag.army mh
    more=c_mh_<tag.spawn>
ENDIF

Code:
[TYPEDEF t_xuchang_boss1]
ON=@Timer
tag.cityname xuchang
REF1=<UID.040004100.LINK>
IF (<REF1>==01ffd)//townstone owner is cao cao lord of wei
    color=color_wei
    tag.army wei
    more1=wei_xuchang_BOSS1
ELSEIF (<REF1>==01fda)//sunquan
    color=color_wu
    tag.army wu
    more1=wu_xuchang_BOSS1
ELSEIF (<REF1>==01fd1)//liubei
    tag.army shu
    color=color_shu
    more1=shu_xuchang_BOSS1
ELSEIF (<REF1>==01fd5)//yuanshao
    color=color_ys
    tag.army ys
    more1=ys_xuchang_BOSS1
ELSEIF (<REF1>==01fc5)//lubu
    color=color_lb
    tag.army lb
    more1=lb_xuchang_BOSS1
ELSEIF (<REF1>==01ff7)//zhangjiao
    color=color_yt
    tag.army yt
    more1=yt_xuchang_BOSS1
ELSEIF (<REF1>==01fdc)//menghuo
    color=color_mh
    tag.army mh
    more1=mh_xuchang_BOSS1
ENDIF

[TYPEDEF t_xuchang_boss2]
ON=@Timer
tag.cityname xuchang
REF1=<UID.040004100.LINK>
IF (<REF1>==01ffd)//caocao
    color=color_wei
    tag.army wei
    more1=wei_xuchang_BOSS2
ELSEIF (<REF1>==01fda)//sunquan
    color=color_wu
    tag.army wu
    more1=wu_xuchang_BOSS2
ELSEIF (<REF1>==01fd1)//liubei
    tag.army shu
    color=color_shu
    more1=shu_xuchang_BOSS2
ELSEIF (<REF1>==01fd5)//yuanshao
    color=color_ys
    tag.army ys
    more1=ys_xuchang_BOSS2
ELSEIF (<REF1>==01fc5)//lubu
    color=color_lb
    tag.army lb
    more1=lb_xuchang_BOSS2
ELSEIF (<REF1>==01ff7)//zhangjiao
    color=color_yt
    tag.army yt
    more1=yt_xuchang_BOSS2
ELSEIF (<REF1>==01fdc)//menghuo
    color=color_mh
    tag.army mh
    more1=mh_xuchang_BOSS2
ENDIF

[TYPEDEF t_xuchang_boss3]
ON=@Timer
tag.cityname xuchang
REF1=<UID.040004100.LINK>
IF (<REF1>==01ffd)//caocao
    color=color_wei
    tag.army wei
    more1=wei_xuchang_BOSS3
ELSEIF (<REF1>==01fda)//sunquan
    color=color_wu
    tag.army wu
    more1=wu_xuchang_BOSS3
ELSEIF (<REF1>==01fd1)//liubei
    tag.army shu
    color=color_shu
    more1=shu_xuchang_BOSS3
ELSEIF (<REF1>==01fd5)//yuanshao
    color=color_ys
    tag.army ys
    more1=ys_xuchang_BOSS3
ELSEIF (<REF1>==01fc5)//lubu
    color=color_lb
    tag.army lb
    more1=lb_xuchang_BOSS3
ELSEIF (<REF1>==01ff7)//zhangjiao
    color=color_yt
    tag.army yt
    more1=yt_xuchang_BOSS3
ELSEIF (<REF1>==01fdc)//menghuo
    color=color_mh
    tag.army mh
    more1=mh_xuchang_BOSS3
ENDIF

the spawns changes depending on who owns the town

Dragons of Time 2000-2020
http://dragonsoftime.com
(This post was last modified: 09-28-2016 06:37 AM by x77x.)
09-28-2016 06:11 AM
Find all posts by this user Like Post Quote this message in a reply
Kanibal
Master
**

Posts: 255
Likes Given: 6
Likes Received: 30 in 28 posts
Joined: Jun 2012
Reputation: 0



Post: #5
RE: no == ?
I need some valerian tablets after this code Cry

Grandmaster Localhost Admin
09-28-2016 09:29 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Kanibal's post
x77x
Master
**

Posts: 488
Likes Given: 0
Likes Received: 15 in 15 posts
Joined: Mar 2012
Reputation: -4



Post: #6
RE: no == ?
PROBLEM#2

your right, there are spawns with no event tags.
i deleted them and it went away, so.....

how can i get it to do nothing when it finds one with no tag?


Code:
[MENU TOWNCONTROL]
WHO OWNS THIS TOWN?
ON=0 Cao Cao [Wei]
TAG.ARMY wei
COLOR color_wei
LINK 01ffd
MORE 3//COLOR FOR WARMAP
SERV.ALLCLIENTS SYSMESSAGE @04 <NAME> is now controlled by Cao Cao [Wei]
foritems 200
    if (<type>==t_spawn_char)
        if (<isevent.t_<tag.cityname>>) || (<isevent.t_<tag.cityname>_BOSS1>) || (<isevent.t_<tag.cityname>_BOSS2>) || (<isevent.t_<tag.cityname>_BOSS3>)
            stop
            start//timer=2
        endif
    endif
endfor
SERV.ALLCLIENTS f_city_change <uid>

ELSE
RETURN 0
?

Dragons of Time 2000-2020
http://dragonsoftime.com
(This post was last modified: 10-03-2016 07:08 AM by x77x.)
10-02-2016 05:09 AM
Find all posts by this user Like Post Quote this message in a reply
n1ghtwish
Apprentice
*

Posts: 40
Likes Given: 0
Likes Received: 28 in 8 posts
Joined: Jan 2016
Reputation: 0



Post: #7
RE: no == ?
Code:
foritems 200
   if (!<isempty <tag.whatever>>) // if tag.whatever exists
        ... do stuff here .....
   endif
   // if no tag.whatever, do nothing
endfor

You could also do this...

Code:
if (!<isnum <tag0.whatever>>)

If the tag does not exist, tag0.whatever will translate to 0, making the isnum statement true, but since we don't want it to be a number (we want it to be text, which means the tag has something stored), we use the NOT operator to make the statement false.

If it's not a number, it's a string.

Right?
(This post was last modified: 10-02-2016 06:42 PM by n1ghtwish.)
10-02-2016 06:33 PM
Find all posts by this user Like Post Quote this message in a reply
x77x
Master
**

Posts: 488
Likes Given: 0
Likes Received: 15 in 15 posts
Joined: Mar 2012
Reputation: -4



Post: #8
RE: no == ?
yes its looking for a spawn tagged with an event (text string)
t_xuchang, t_xuchang_boss1, t_xuchang_boss2, t_xuchang_boss3
anything else, do nothing

Dragons of Time 2000-2020
http://dragonsoftime.com
(This post was last modified: 10-03-2016 07:07 AM by x77x.)
10-03-2016 07:02 AM
Find all posts by this user Like Post Quote this message in a reply
x77x
Master
**

Posts: 488
Likes Given: 0
Likes Received: 15 in 15 posts
Joined: Mar 2012
Reputation: -4



Post: #9
RE: no == ?
i tried something like...
Code:
[MENU TOWNCONTROL]
WHO OWNS THIS TOWN?
ON=0 Cao Cao [Wei]
TAG.ARMY wei
COLOR color_wei
LINK 01ffd
MORE 3//COLOR FOR WARMAP
SERV.ALLCLIENTS SYSMESSAGE @04 <NAME> is now controlled by Cao Cao [Wei]
foritems 200
    if (<type>==t_spawn_char)
        if (<isevent.t_<tag.cityname>>) || (<isevent.t_<tag.cityname>_BOSS1>) || (<isevent.t_<tag.cityname>_BOSS2>) || (<isevent.t_<tag.cityname>_BOSS3>)
            stop
            start//timer=2
        endif
        if !(<isevent.t_<tag.cityname>>) || !(<isevent.t_<tag.cityname>_BOSS1>) || !(<isevent.t_<tag.cityname>_BOSS2>) || !(<isevent.t_<tag.cityname>_BOSS3>)
say no!
return 0//return 1
    endif
endfor
SERV.ALLCLIENTS f_city_change <uid>

but that dont work

Dragons of Time 2000-2020
http://dragonsoftime.com
10-06-2016 09:13 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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