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
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 786 - File: showthread.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/showthread.php 786 errorHandler->error






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with terrain type
Author Message
Dullais
Journeyman
*

Posts: 65
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Feb 2013
Reputation: 0



Post: #1
Problem with terrain type
Hello guys.
I decided that i don't like that mounts are spawned every time at the same points of map, so i decided to make my own function, that's spawns them randomly across the map, but i got some problem. Here is the function witch tells me if the random coordinates are good for spawn:
Code:
[FUNCTION spawn_mounts]
VAR.DEST=<EVAL.rand(1,5000)>,<EVAL.rand(1,4000)>

VAR.FALSE=0
IF !(STRCMP(<SERV.MAP(<VAR.DEST>,<SERV.MAP(<VAR.DEST>,0).TERRAIN.Z>).TYPE>, t_water))
VAR.FALSE=1
ELSE
ENDIF
IF !(STRCMP(<SERV.MAP(<VAR.DEST>,<SERV.MAP(<VAR.DEST>,0).TERRAIN.Z>).TYPE>, t_rock))
VAR.FALSE=1
ELSE
ENDIF
IF !(STRCMP(<SERV.MAP(<VAR.DEST>,<SERV.MAP(<VAR.DEST>,0).TERRAIN.Z>).REGION.FLAGS>, 00))
ELSE
VAR.FALSE=1
ENDIF


IF (<EVAL.<VAR.FALSE>> == 1)
SRC.SAY Can't
ELSE
SRC.SAY Can
ENDIF

SRC.GO <VAR.DEST>,<SERV.MAP(<VAR.DEST>,0).TERRAIN.Z>,0

My problem is that sometimes water terrain has a type of t_normal, and script thinks that there is good spot to spawn the creature, so that's it.
How do i make it work ?
(This post was last modified: 04-03-2013 12:23 AM by Dullais.)
04-03-2013 12:23 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
Problem with terrain type - Dullais - 04-03-2013 12:23 AM
RE: Problem with terrain type - Mordaunt - 04-03-2013, 12:29 AM
RE: Problem with terrain type - Dullais - 04-03-2013, 12:39 AM
RE: Problem with terrain type - Mordaunt - 04-03-2013, 12:44 AM
RE: Problem with terrain type - Dullais - 04-03-2013, 12:48 AM
RE: Problem with terrain type - Mordaunt - 04-03-2013, 12:52 AM
RE: Problem with terrain type - Dullais - 04-03-2013, 02:03 AM

Forum Jump:


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