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
refering item from pos or similar.
Author Message
kn4tseb
Master
**

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



Post: #1
refering item from pos or similar.
Hey guys, i need some help with a script and hardcoded behavior with mining


when dclicking a t_weapon_mace_pick on t_rock ground the worldgem_bit appears

i need to know how to make a reference to that worldgem when appearing.

for example.

Code:
ON=@Targon_Ground
IF (<type> == t_weapon_mace_pick
   IF <serv.itemdef.<argn1>.type> == t_rock
   // after x ticks, worldgem appears with random data (more1, etc,)
  // somehow i could use foritems 0 in src.targp to acquire that information without altering hardcoded behavior
  // i need to know if it's possible
  ENDIF
ENDIF

Thank you very much.
(This post was last modified: 07-17-2014 05:04 AM by kn4tseb.)
07-17-2014 05:01 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: #2
RE: refering item from pos or similar.
You can use resource events like @ResourceTest / @ResourceFound / @ResourceGather

Code:
[REGIONRESOURCE mr_fish1]
REAP=i_fish_big_1
...

ON=@ResourceFound
SRC.SAY I found this worldgem bit: <ARGO.NAME>
07-17-2014 07:20 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Coruja's post
kn4tseb
Master
**

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



Post: #3
RE: refering item from pos or similar.
gonna take a look, thanks ;>

how can this be made as a global event for a regiontype? so i dont have to add the script under every regionresource ??
(This post was last modified: 07-17-2014 08:32 AM by kn4tseb.)
07-17-2014 07:37 AM
Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #4
RE: refering item from pos or similar.

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
07-17-2014 08:37 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: #5
RE: refering item from pos or similar.
Jesus, didnt know that trigger even exists, ty very much Wink
07-17-2014 08:47 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: #6
RE: refering item from pos or similar.
How can i check if the player is inside a dungeon or not, because i see different minable regions rocks, r_default_rock and r_dungeon at sphere_regions.scp, would src.region.underground check this? if src is the player inside the region?

Thanks!

EDIT: Well for the moment used: strmatch(*r_dungeon*,<src.region.events>) // but would be nice to know whats the "underground" setting for ^^
(This post was last modified: 07-17-2014 02:21 PM by kn4tseb.)
07-17-2014 10:39 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: refering item from pos or similar.
Buildings, caves ... Everything with a roof over you.
07-17-2014 04:19 PM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes XuN's post
kn4tseb
Master
**

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



Post: #8
RE: refering item from pos or similar.
understood Wink

one more thing, which trigger would recommend me if i want to found a resource but i dont want to gather it?, i want the worldgem_bit item to be created, with its respective resource (more1) and amounts but i dont know how to prevent the player from collecting/gathering... return 1 on resourceFound would work even if amount is set to 0 but i dont know how to prevent sphere to send the message, "There's nothing here to mine for."

To be more accurate, what i'm tying to do is the Prospector's tool
(This post was last modified: 07-18-2014 05:44 AM by kn4tseb.)
07-18-2014 03:21 AM
Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #9
RE: refering item from pos or similar.
(07-17-2014 08:37 AM)Extreme Wrote:  http://wiki.sphere.torfo.org/index.php/@...ourceFound

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
07-18-2014 05:25 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: #10
RE: refering item from pos or similar.
ehhehhe i tried with that one but i cannot prevent the item to be gathered, and if i return 1 i receive the message: "There's nothing here to mine for."
i'd have everything i need if i prevent that sphere message from being shown.

Ty tho Smile
07-18-2014 05:59 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)