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
e_Carnivores - Making Carnivores hunt
Author Message
n1ghtwish
Apprentice
*

Posts: 40
Likes Given: 0
Likes Received: 28 in 8 posts
Joined: Jan 2016
Reputation: 0



Post: #2
RE: e_Carnivores - Making Carnivores hunt
Thank you for taking the time to post your first script!!!

I have not tested it but I do have a few suggestions

1) You don't need to use "I" as the default object... it works, but you can remove it and instead of "I.tag.blah = 123" you can simply do "tag.blah = 123"

2) VAR.HUNGER_RATE_DECAY_TIME = 120
Instead of storing your time in a GLOBAL variable, it is now common practice to store "setting" type variables in a DEFNAME block.

Example:

Code:
[DEFNAME hunger_settings]
// all your settings related to this system go here
HUNGER_RATE_DECAY_TIME = 120
SOME_OTHER_SETTING = 500

Then you access it later with "<DEF.HUNGER_RATE_DECAY_TIME>"

3) Do some research on adding a ZERO to TAGS, DEFS, VARS, etc...
example: <tag0.something>, <def0.something>
Might help with console error reduction Smile

4) Look into the "ISEVENT" property/function

5) "<dTAG.hunger_in_effect>" is essentially a shortcut for "<eval <I.TAG.hunger_in_effect>>", the "d" being placed in front of the TAG automatically returns said tag (or var or def or whatever) in decimal format, which is what EVAL does.

In your line "IF !(<eval <I.TAG.hunger_in_effect>>)" it is not necessarily required to evaluate the tag if you are simply checking to see if it exists.

--------------------------

Also, I appreciate your commenting on each block of the script... most don't do that and it will help others with installation and tailoring Smile

-NW
03-21-2018 03:11 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
RE: e_Carnivores - Making Carnivores hunt - n1ghtwish - 03-21-2018 03:11 AM

Forum Jump:


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