Problem description:
How to check the types of turfs placed near the other turf? I want to, say give some stones when the mine turf is placed near the hill turf and village turf.
ID:1857374
May 23 2015, 3:52 pm
|
|
In response to Adrian09_01
|
|
The link I provided to the reference explains how you should check the type.
|
In response to Adrian09_01
|
|
Adrian09_01 wrote:
how exactly I should check the type?and apply the action? I want to use for loop. orange is an area? |
In response to Adrian09_01
|
|
Yes, it's a list of turfs within x tiles of an object, excluding the center. You would include the center using the range() proc instead.
By "apply the action," I take it you mean creating the stones. Here's an example: // where 't' is a mine turf. You said you want to use a for() loop, so you are going to get something similar to this: // inside of the mine turf's creation proc... |
In response to Adrian09_01
|
|
I gave you enough information without giving you code you could copy/paste. Now it's up to you to do your part and fill in the blanks to achieve the system you want.
Show any code you may or may not be using and we'll go from there. If you don't know where to start, you need to check out the DM Guide. |
I have a working proc() inside of the Mine object, but I want it to work every 5 seconds. I get an error:
Dark Ages.dm:375:error: 1: value not allowed here and here are the trouble lines: mine It's my declaration of mine, I want the ticker to loop every 5 seconds, but I can't get it to work. work() is the proc that powers the mine. |
You can't place code like that inside the object's definition. You'll need to place code inside a proc, such as New().
|
From there, you would go on to check that the turf(s) involved are of the correct type before creating your stone objects. You would do this using the istype() proc.