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
This is an easy one :D i think
Author Message
kn4tseb
Master
**

Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0



Post: #1
This is an easy one :D i think
Guys hi again, i know you might have seen a lot of post from me in the last month xDD... im really really interested about solving some issues and learning about sphere.... this is what i want to do and this is the first time i try something like this:

there are some trees in the game with T_NORMAL Type set, so i want to use one of them really similar to t_tree using lumberjacking.

first at all i got the ID of the item (tree) and i modified the type from t_normal to t_tree_x
then i went to typedefs and added the new t_tree_x type

then i went to sphere_region and into the lumberjacking section i added this:
[REGIONRESOURCE mr_tree_x]
AMOUNT=2,5
REAP=i_log_x
REAPAMOUNT=20
SKILL=65.0,90.0
REGEN=60*60*10

[REGIONTYPE r_tree_x t_tree_x]
RESOURCES=80.0 mr_nothing
RESOURCES=20.0 mr_tree_x

later on i went to terrains at sphere_types.scp and added

[TYPEDEF t_tree_x]
TERRAIN = IDofTerrain

after that, opened the sphere_mapx.scp
and in the corresponding AREA i added r_tree_x to the events

so i suppose every needs are taken so i can start with the script
but i got surprised when i found two similar triggers i could use.
ItemTargon_Item and Targon_Item, couldnt understand the difference betweeen each other but lets say i use the second one.

so i need a little help with the beggining of the script
could it be something like this?

[Typedef T_EVENT_TREE_X]

ON=@TargON_Item
IF (<type> == t_weapon_axe) && (<argo.type> == t_tree_x) //
SERV.B <type> <argo>
say lalalallalalal
return 1
endif

is everything correct?
i know its not because when i tried it nothing happend Smile
but i know it will be easily fixed with you help.

Thank you very much!!!
(This post was last modified: 06-13-2014 02:32 AM by kn4tseb.)
06-13-2014 02:30 AM
Find all posts by this user Like Post Quote this message in a reply
kn4tseb
Master
**

Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0



Post: #2
RE: This is an easy one :D i think
Ok, im almost done but i need help to figure this: how do i get the baseid of a <src.targp>?

i didnt know forest type was ground so i need something like this.
most trees are multis so i figure it was a good idea to identify them with their baseid but i dont know how to get if i only have <src.targp>

IF (<type> == t_weapon_axe && STRMATCH(i_tree_x*,<SRC.TARGP.(need something to get the baseid here)>)

Thank you

Argument In/Out Description
ARGN1 I If a static item was targeted, the ID of the item.

i think i needed some more read xD

OK so i have <hval to get the hexnumber of the item but im still thinking about how to join it to the <src.targp> reference given by this trigger Confused
(This post was last modified: 06-13-2014 01:38 PM by kn4tseb.)
06-13-2014 01:22 PM
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: This is an easy one :D i think
I dont know if you will get the tree info or really the terrain (probably grass) but you can try SRC.TARGP.TYPE or SRC.TARGP.TERRAIN
06-13-2014 02:44 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: #4
RE: This is an easy one :D i think
I don't really get what do you want, but did you try @ResourceGather ?
06-13-2014 08:07 PM
Find all posts by this user Like Post Quote this message in a reply
kn4tseb
Master
**

Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0



Post: #5
RE: This is an easy one :D i think
yew tree has a t_normal type set by default, i want to gather a new resource from it, thats all
the resource would be i_log_yew and would be using an axe just exactly as a normal t_tree's taking lumberjacking skill, same anim, same sound, thats pretty much it
(This post was last modified: 06-14-2014 02:03 AM by kn4tseb.)
06-13-2014 11:58 PM
Find all posts by this user Like Post Quote this message in a reply
kn4tseb
Master
**

Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0



Post: #6
RE: This is an easy one :D i think
EDIT!
PHP Code:
ON=@TargON_ground
IF (<type> == t_weapon_axe)
   FOR 
x 4790 4797
      
IF (<argn1> == <dlocal.x>)
    
F_START_CHOPING_YEW
   
ENDFOR
ENDIF 

OKEY OKEY, it's done Smile now it works, thank you all !
(This post was last modified: 06-14-2014 03:53 AM by kn4tseb.)
06-14-2014 03:08 AM
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: #7
RE: This is an easy one :D i think
Is that code really working? You are missing one ENDIF inside the FOR loop, the for loop is not needed anyways:
Code:
ON=@TargOn_Ground
if (<type>==t_weapon_axe)
if ( (<argn1>>= 4790) || (<argn1><=4797) )
  f_start_choping_yew
endif
endif
06-14-2014 04:02 AM
Find all posts by this user Like Post Quote this message in a reply
kn4tseb
Master
**

Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0



Post: #8
RE: This is an easy one :D i think
PHP Code:
ON=@TargON_ground
IF (<type> == t_weapon_axe)
   FOR 
x 4790 4797
      
IF (<argn1> == <dlocal.x>)
       
F_START_CHOPING_YEW
      
ENDIF
   ENDFOR
ENDIF 

my bad at copy paste xD

ohhh you are right, not really needed but both should work right?
i like For 's loops xDD im trying to learn how to use them :>
(This post was last modified: 06-14-2014 05:01 AM by kn4tseb.)
06-14-2014 04:58 AM
Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #9
RE: This is an easy one :D i think
The search button is your friend....

http://forum.spherecommunity.net/Thread-...pe-of-tree

[Image: 2nis46r.jpg]
06-14-2014 05:33 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
kn4tseb
Master
**

Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0



Post: #10
RE: This is an easy one :D i think
WOW xddd believe me i use the search button like 100 times every day xd
06-14-2014 05:48 AM
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)