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
Farm system
Author Message
Kapa
Journeyman
*

Posts: 74
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Oct 2014
Reputation: 0



Post: #1
Farm system
Please tell me why this scp doesnt work. Doubl clicking sign gives no dialog, and after placing the farm server gives an eror :

ERROR:UID=0400176af, id=04782 'qww's Farm', Invalid code=2236 (Item flagged as decay but without timer set)
ERROR:'copper key' Bad Link to 0400176e9
ERROR:UID=0400176b7, id=0100e 'copper key', Invalid code=2205 (Mislinked item)
ERROR:'copper key' Bad Link to 0400176e9
ERROR:UID=0400176b9, id=0100e 'copper key', Invalid code=2205 (Mislinked item)



[ITEMDEF i_multi_farm33]
NAME=Farm 3x3
ID=i_gold
TYPE=t_multi
VALUE=5000
CATEGORY=Multis
SUBSECTION=Novos
DESCRIPTION=Farm 3x3
MULTIREGION=0,1,0,0
COMPONENT=088b -2 0 0 0
COMPONENT=088b -2 1 0 0
COMPONENT=088b -2 2 0 0
COMPONENT=088b 1 2 0 0
COMPONENT=088b 1 1 0 0
COMPONENT=088b 1 0 0 0
COMPONENT=i_fence_wood_2 -1 -1 0 0
COMPONENT=i_fence_wood_2 0 -1 0 0
COMPONENT=i_fence_wood_2 1 -1 0 0
COMPONENT=i_fence_wood_2 -1 2 0 0
COMPONENT=i_fence_wood_2 1 2 0 0
COMPONENT=031f7 -1 0 0 0
COMPONENT=031f7 0 0 0 0
COMPONENT=031f7 1 0 0 0
COMPONENT=031f7 -1 1 0 0
COMPONENT=031f7 -1 2 0 0
COMPONENT=031f7 0 1 0 0
COMPONENT=031f7 0 2 0 0
COMPONENT=031f7 1 1 0 0
COMPONENT=031f7 1 2 0 0
COMPONENT=i_gate_wood_3 0 2 0 0
COMPONENT=0bcf -1 3 0 0

ON=@create
fix
attr=attr_move_never|attr_static
src.tag0.jatenhofarms=<eval <src.tag0.jatenhofarms>+1>
src.newitem=i_porta_farm
src.new.p=<src.targp>
src.new.move 0,2,0
src.new.attr=attr_move_never|attr_static|attr_decay
src.new.tag.uiddodono=<src.uid>
src.new.name=<src.name>'s Farm
src.var.uiddaporta=<src.new.uid>
src.update
src.try uid.<src.var.uiddaporta>.tag.uiddafarm=<uid>
src.try uid.<src.var.uiddaporta>.link=<uid.<src.var.uiddaporta>.tag.uiddafarm>

on=@click
if (<src.isgm>)
message @07a1 <uid.<more1>.name> (<more1>)
else
return 1
endif

////////////////////////
[DIALOG d_farm]
200,200
src.closealldialogs
PAGE 1
resizepic 0 0 2600 330 330
resizepic 70 20 3500 170 40
dtext 100 27 0 Farm System
resizepic 30 70 3500 270 40
dtext 50 77 0 Dono:
dtext 90 77 2010 <uid.<uid.<region.uid>.more1>.name>
resizepic 30 120 3500 270 50
dtextentry 50 135 300 25 99 0 <name>
button 110 175 0ef 0f0 1 0 1
resizepic 30 220 3500 270 50
dtext 50 235 99 Redeed (<EVAL <UID.<REGION.UID>.VALUE>/10>)
button 110 275 0ef 0f0 1 0 2

[DIALOG d_farm BUTTON]
ON=1
IF !(<ISBADSTR <ARGTXT[0]>>)
NAME=<STRSUB 0 30 <ARGTXT[0]>>
ENDIF

ON=2
IF !(<SRC.TOTALGOLD> > <EVAL (<UID.<REGION.UID>.VALUE>/10)-1>) && !(<SRC.ISGM>)
src.sysmessage Insuficient funds.
SDIALOG d_farm 1
ELSE
src.consumegold <EVAL <UID.<REGION.UID>.VALUE>/10>
local.tmp=<obj>
obj=<uid.<region.uid>.more1>
obj.account.tag0.jatenhofarms -= 1
IF !(<OBJ.ACCOUNT.TAG0.JATENHOFARMS>)
obj.account.tag.jatenhofarms
ENDIF
obj=<local.tmp>
serv.newitem i_deed_farm<strsub -2 0 <UID.<REGION.UID>.BASEID>>
new.bounce
try uid.<REGION.UID>.f_remove_farm
ENDIF

[FUNCTION f_remove_farm]
LOCAL.TMP=<UID>
OBJ=<UID>
FORITEMS 15
IF (<REGION.UID>==<OBJ>) && (<UID>!=<OBJ>)
REMOVE
ENDIF
ENDFOR
OBJ.REMOVE
OBJ=<LOCAL.TMP>

[ITEMDEF i_farm_sign]
DEFNAME=i_farm_sign
//farm sign
NAME=Sign
ID=i_sign_brass
TYPE=T_SIGN_GUMP
FLIP=1
TDATA2=067
RESOURCES=2 I_BOARD, 1 i_ingot_iron


ON=@DClick
if <uid.<src.region.uid>.more1> || <src.isgm>
DIALOG d_farm
ELSE
return 1
endif


[ITEMDEF i_porta_farm]
ID=i_gem_diamond
TYPE=t_script
NAME=porta farm
CATEGORY=na
SUBSECTION=farm
DESCRIPTION=bbz

on=@create
ATTR=04090



[EOF]
10-24-2014 11:24 PM
Find all posts by this user Like Post Quote this message in a reply
azmanomer
Journeyman
*

Posts: 139
Likes Given: 4
Likes Received: 18 in 16 posts
Joined: Nov 2013
Reputation: 1



Post: #2
RE: Farm system
i think this is your problem about dialog
COMPONENT=0bcf -1 3 0 0 this should be
COMPONENT=i_farm_sign -1 3 0 0

also about Item flagged as decay but without timer set
[ITEMDEF i_porta_farm]
ID=i_gem_diamond
TYPE=t_script
NAME=porta farm
CATEGORY=na
SUBSECTION=farm
DESCRIPTION=bbz

on=@create
ATTR=090 ---> attr should be this or you should add timer blabla under attr

at last for copper keys
ON=@create
fix
attr=attr_move_never|attr_static
src.tag0.jatenhofarms=<eval <src.tag0.jatenhofarms>+1>
src.newitem=i_porta_farm
src.new.bounce
src.new.attr=attr_move_never|attr_static|attr_decay
src.new.tag.uiddodono=<src.uid>
src.new.name=<src.name>'s Farm
src.var.uiddaporta=<src.new.uid>
src.update
src.try uid.<src.var.uiddaporta>.tag.uiddafarm=<uid>
src.try uid.<src.var.uiddaporta>.link=<uid.<src.var.uiddaporta>.tag.uiddafarm>
10-25-2014 12:10 AM
Find all posts by this user Like Post Quote this message in a reply
Kapa
Journeyman
*

Posts: 74
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Oct 2014
Reputation: 0



Post: #3
RE: Farm system
Hi,
Thank you it did work, but i am still getting few more errors:

17:25:ERROR:(farm_system.scp,548)Can't resolve <ISBADSTR Ferma>
17:25:ERROR:(farm_system.scp,548)Undefined symbol ''
17:27:ERROR:(farm_system.scp,553)Can't resolve <SRC.TOTALGOLD>
17:27:ERROR:(farm_system.scp,553)Undefined symbol ''


[DIALOG d_farm BUTTON]
ON=1
IF !(<ISBADSTR <ARGTXT[0]>>) // line 548
NAME=<STRSUB 0 30 <ARGTXT[0]>>
ENDIF

ON=2
IF !(<SRC.TOTALGOLD> > <EVAL (<UID.<REGION.UID>.VALUE>/10)-1>) && !(<SRC.ISGM>) //line 553
src.sysmessage Insuficient funds.
SDIALOG d_farm 1
ELSE
src.consumegold <EVAL <UID.<REGION.UID>.VALUE>/10>
local.tmp=<obj>
obj=<uid.<region.uid>.more1>
obj.account.tag0.jatenhofarms -= 1
IF !(<OBJ.ACCOUNT.TAG0.JATENHOFARMS>)
obj.account.tag.jatenhofarms
ENDIF
obj=<local.tmp>
serv.newitem i_deed_farm<strsub -2 0 <UID.<REGION.UID>.BASEID>>
new.bounce
try uid.<REGION.UID>.f_remove_farm
ENDIF

[FUNCTION f_remove_farm]
LOCAL.TMP=<UID>
OBJ=<UID>
FORITEMS 15
IF (<REGION.UID>==<OBJ>) && (<UID>!=<OBJ>)
REMOVE
ENDIF
ENDFOR
OBJ.REMOVE
OBJ=<LOCAL.TMP>
10-27-2014 03:30 AM
Find all posts by this user Like Post Quote this message in a reply
azmanomer
Journeyman
*

Posts: 139
Likes Given: 4
Likes Received: 18 in 16 posts
Joined: Nov 2013
Reputation: 1



Post: #4
RE: Farm system
there should be a function like ISBADSTR and totalgold.Change <src.totalgold> to <src.gold> and for isbadstr function its probably checking the characthers inside the text you can make one on your own or just put that

[function isbadstr]
for 0 <eval strlen(<args>) -1>
if !(strmatch('[a-z]','<strsub <eval <local._for>> 1 <args>>'))
return 1
endif
endfor

this provide that just words can use nothing else no numbers no *,+- etc.
10-27-2014 03:51 AM
Find all posts by this user Like Post Quote this message in a reply
Kapa
Journeyman
*

Posts: 74
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Oct 2014
Reputation: 0



Post: #5
RE: Farm system
After restarting the server the farm is gone and i am getting this error:
Loading save/spherechars...
ERROR:'copper key' Bad Link to 040001491
ERROR:UID=040001457, id=0100e 'copper key', Invalid code=2205 (Mislinked item)
ERROR:'copper key' Bad Link to 040001491
ERROR:UID=040001459, id=0100e 'copper key', Invalid code=2205 (Mislinked item)
ERROR:'Sign' Bad Link to 040001491
ERROR:UID=04000145a, id=04687 'Sign', Invalid code=2205 (Mislinked item)
ERROR:'wooden gate' Bad Link to 040001491
ERROR:UID=04000145b, id=0866 'wooden gate', Invalid code=2205 (Mislinked item)
ERROR:'dirt' Bad Link to 040001491
ERROR:UID=04000145c, id=031f4 'dirt', Invalid code=2205 (Mislinked item)
ERROR:'dirt' Bad Link to 040001491
ERROR:UID=04000145d, id=031f4 'dirt', Invalid code=2205 (Mislinked item)
ERROR:'dirt' Bad Link to 040001491
ERROR:UID=04000145e, id=031f4 'dirt', Invalid code=2205 (Mislinked item)
ERROR:'dirt' Bad Link to 040001491
ERROR:UID=04000145f, id=031f4 'dirt', Invalid code=2205 (Mislinked item)
ERROR:'dirt' Bad Link to 040001491
ERROR:UID=040001460, id=031f4 'dirt', Invalid code=2205 (Mislinked item)
ERROR:'dirt' Bad Link to 040001491
ERROR:UID=040001461, id=031f4 'dirt', Invalid code=2205 (Mislinked item)
ERROR:'dirt' Bad Link to 040001491
ERROR:UID=040001462, id=031f4 'dirt', Invalid code=2205 (Mislinked item)
ERROR:'dirt' Bad Link to 040001491
ERROR:UID=040001463, id=031f4 'dirt', Invalid code=2205 (Mislinked item)
ERROR:'dirt' Bad Link to 040001491
ERROR:UID=040001464, id=031f4 'dirt', Invalid code=2205 (Mislinked item)
ERROR:'dirt' Bad Link to 040001491
ERROR:UID=040001465, id=031f4 'dirt', Invalid code=2205 (Mislinked item)
ERROR:'dirt' Bad Link to 040001491
ERROR:UID=040001466, id=031f4 'dirt', Invalid code=2205 (Mislinked item)
ERROR:'dirt' Bad Link to 040001491
ERROR:UID=040001467, id=031f4 'dirt', Invalid code=2205 (Mislinked item)
ERROR:'dirt' Bad Link to 040001491
ERROR:UID=040001468, id=031f4 'dirt', Invalid code=2205 (Mislinked item)
ERROR:'dirt' Bad Link to 040001491
ERROR:UID=040001469, id=031f4 'dirt', Invalid code=2205 (Mislinked item)
ERROR:'dirt' Bad Link to 040001491
ERROR:UID=04000146a, id=031f4 'dirt', Invalid code=2205 (Mislinked item)
ERROR:'dirt' Bad Link to 040001491
ERROR:UID=04000146b, id=031f4 'dirt', Invalid code=2205 (Mislinked item)
ERROR:'dirt' Bad Link to 040001491
ERROR:UID=04000146c, id=031f4 'dirt', Invalid code=2205 (Mislinked item)
ERROR:'dirt' Bad Link to 040001491
ERROR:UID=04000146d, id=031f4 'dirt', Invalid code=2205 (Mislinked item)
ERROR:'dirt' Bad Link to 040001491
ERROR:UID=04000146e, id=031f4 'dirt', Invalid code=2205 (Mislinked item)
ERROR:'dirt' Bad Link to 040001491
ERROR:UID=040001470, id=031f4 'dirt', Invalid code=2205 (Mislinked item)
ERROR:'dirt' Bad Link to 040001491
ERROR:UID=040001471, id=031f4 'dirt', Invalid code=2205 (Mislinked item)
ERROR:'dirt' Bad Link to 040001491
ERROR:UID=040001472, id=031f4 'dirt', Invalid code=2205 (Mislinked item)
ERROR:'dirt' Bad Link to 040001491
ERROR:UID=040001473, id=031f4 'dirt', Invalid code=2205 (Mislinked item)
ERROR:'dirt' Bad Link to 040001491
ERROR:UID=040001474, id=031f4 'dirt', Invalid code=2205 (Mislinked item)
ERROR:'dirt' Bad Link to 040001491
ERROR:UID=040001475, id=031f4 'dirt', Invalid code=2205 (Mislinked item)
ERROR:'wooden fence' Bad Link to 040001491
ERROR:UID=040001477, id=088a 'wooden fence', Invalid code=2205 (Mislinked item)
ERROR:'wooden fence' Bad Link to 040001491
ERROR:UID=040001478, id=088a 'wooden fence', Invalid code=2205 (Mislinked item)
ERROR:'wooden fence' Bad Link to 040001491
ERROR:UID=040001479, id=088a 'wooden fence', Invalid code=2205 (Mislinked item)
ERROR:'wooden fence' Bad Link to 040001491
ERROR:UID=04000147b, id=088a 'wooden fence', Invalid code=2205 (Mislinked item)
ERROR:'wooden fence' Bad Link to 040001491
ERROR:UID=04000147c, id=088a 'wooden fence', Invalid code=2205 (Mislinked item)
ERROR:'wooden fence' Bad Link to 040001491
ERROR:UID=04000147e, id=088a 'wooden fence', Invalid code=2205 (Mislinked item)
ERROR:'wooden fence' Bad Link to 040001491
ERROR:UID=04000147f, id=088a 'wooden fence', Invalid code=2205 (Mislinked item)
ERROR:'wooden fence' Bad Link to 040001491
ERROR:UID=040001481, id=088a 'wooden fence', Invalid code=2205 (Mislinked item)
ERROR:'wooden fence' Bad Link to 040001491
ERROR:UID=040001482, id=088a 'wooden fence', Invalid code=2205 (Mislinked item)
ERROR:'wooden fence' Bad Link to 040001491
ERROR:UID=040001484, id=088a 'wooden fence', Invalid code=2205 (Mislinked item)
ERROR:'wooden fence' Bad Link to 040001491
ERROR:UID=040001486, id=088a 'wooden fence', Invalid code=2205 (Mislinked item)
ERROR:'wooden fence' Bad Link to 040001491
ERROR:UID=040001487, id=088a 'wooden fence', Invalid code=2205 (Mislinked item)
ERROR:'wooden fence' Bad Link to 040001491
ERROR:UID=040001488, id=088a 'wooden fence', Invalid code=2205 (Mislinked item)
ERROR:'wooden fence' Bad Link to 040001491
ERROR:UID=040001489, id=088a 'wooden fence', Invalid code=2205 (Mislinked item)
ERROR:'wooden fence' Bad Link to 040001491
ERROR:UID=04000148a, id=088a 'wooden fence', Invalid code=2205 (Mislinked item)
ERROR:'wooden fence' Bad Link to 040001491
ERROR:UID=04000148b, id=088a 'wooden fence', Invalid code=2205 (Mislinked item)
ERROR:'wooden fence' Bad Link to 040001491
ERROR:UID=04000148c, id=088a 'wooden fence', Invalid code=2205 (Mislinked item)
ERROR:'wooden fence' Bad Link to 040001491
ERROR:UID=04000148d, id=088a 'wooden fence', Invalid code=2205 (Mislinked item)
ERROR:'wooden fence' Bad Link to 040001491
ERROR:UID=04000148f, id=088a 'wooden fence', Invalid code=2205 (Mislinked item)
ERROR:'qww's Farm' Bad Link to 040001491
ERROR:UID=040001490, id=04293 'qww's Farm', Invalid code=2205 (Mislinked item)
10-29-2014 07:14 PM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #6
RE: Farm system
ATTR=090 means attr_static (080) + attr_move_never (010), attr_static items MUST be saved with serv.savestatics since they are supossed to be a relatively untouched part of the world they have a different save type to gain some speed on normal saves.

I don't think you need attr_static since attr_move_never will not allow players to pick up items, you might want to remove it or add a serv.savestatics under [function f_onserver_save] (sphere_serv_triggers.scp)
10-29-2014 07:20 PM
Find all posts by this user Like Post Quote this message in a reply
Kapa
Journeyman
*

Posts: 74
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Oct 2014
Reputation: 0



Post: #7
RE: Farm system
Thank you

What attr i should use to make item invisible?

[ITEMDEF i_porta_farm]

ID=i_gem_diamond
TYPE=t_script
NAME=porta farm
CATEGORY=na
SUBSECTION=farm
DESCRIPTION=bbz

on=@create
ATTR=010
(This post was last modified: 10-29-2014 08:24 PM by Kapa.)
10-29-2014 08:13 PM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #8
RE: Farm system
If you open Sphere_defs.scp script you can see there all of existing attr_ flags and some more interesting things, attr_invis is what you need btw.
10-29-2014 08:32 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)