kenobi13

Joined: 3rd Jun 2009
Posts: 881
Advanced harvesting system (UPDATED LINKS)
Info:
My advanced harvesting code. It contains taking hp code, so player can hurt when harvesting.
Usage:
Put tile type 14 on place where you want make harvesting spot.
Usage example:
Known problems:
Installation:
- Go to map.hpp and look for "enum TileSpec". Look there for "Unknown5" and replace it with "HarvestTree".
- Go to map.hpp and look for "bool Walkable(bool npc = false)". Look there for "case Chest:" under it put "case HarvestTree:".
- Go to map.hpp and look for "bool Walkable(bool npc = false)". Under the whole code for it put code from "bool Harvestable code" file (in dowload links). Example of good implementation of this code is in "bool Harvestable usage" file.
- Go to map.hpp and look for "bool Walkable(unsigned char x, unsigned char y, bool npc = false);". Under it put "bool Harvestable(unsigned char x, unsigned char y);".
- Go to map.cpp and look for the "bool Map::Walkable(unsigned char x, unsigned char y, bool npc)" function. Under it put code from "bool Map::Harvestable code" file (in dowload links). Example of good implementation of this code is in "bool Map::Harvestable usage" file.
- Go to map.cpp and look for the "void Map::Attack(Character *from, Direction direction)" function. Under the whole code "switch (from->direction)" put code from "Harvesting code" file. Example of good implementation of this code is in "Harvesting code usage" file.
- Go to world.hpp and look for "Config home_config;" line. Under it put "Config harvesting_config;".
- Go to world.cpp and look for "this->home_config.Read(this->config["HomeFile"]);" line. Under it put "this->harvesting_config.Read(this->config["HarvestingFile"]);"
- Compile your source.
- In config.ini file put somewhwere data from "config.ini values" file.
- In your data folder make file called harvesting.ini. Put there "harvesting.ini" file contents.
- Configure your harvesting.ini.
- Put tile spec 14 on map where you want harvest.
Download links:
Notes:
- Probably I will add an compiled version and ready source.
- If I'll be bored I'll make example map for harvesting.
15 years, 8 weeks ago
|
legend
Joined: 4th Apr 2009
Posts: 170
Re: Advanced harvesting system
i get
C:\Users\Whitesauce\Desktop\projeck back up\trunk\src\player.hpp||In member function 'void Map::Attack(Character*, Direction)':|
C:\Users\Whitesauce\Desktop\projeck back up\trunk\src\player.hpp|1364|error: 'class Map' has no member named 'Harvestable'|
||=== Build finished: 1 errors, 0 warnings ===|
15 years, 8 weeks ago
|
kenobi13

Joined: 3rd Jun 2009
Posts: 881
Re: Advanced harvesting system
Uhmmm, sorry, I forgot to add some code. I'l fix it today.
Code fixed
15 years, 8 weeks ago
|
legend
Joined: 4th Apr 2009
Posts: 170
Re: Advanced harvesting system (FIXED)
15 years, 8 weeks ago
|
Re: Advanced harvesting system (FIXED)
It won't seem to work for me. I keep getting the same error over and over:
C:\Documents and Settings\CJ\Desktop\trunk\src\player.hpp|1440|error: expected unqualified-id before '(' token|
15 years, 8 weeks ago
|
kenobi13

Joined: 3rd Jun 2009
Posts: 881
Re: Advanced harvesting system (FIXED)
Heartworm posted: (13th Mar 2010 01:58 am)
It won't seem to work for me. I keep getting the same error over and over:
C:\Documents and Settings\CJ\Desktop\trunk\src\player.hpp|1440|error: expected unqualified-id before '(' token|
The compileris pointing to wrong error location. I can't help you
15 years, 8 weeks ago
|
Re: Advanced harvesting system (FIXED)
I completely removed the harvesting code, and I still get the same error..
15 years, 8 weeks ago
|
epicnoob

Joined: 19th Feb 2010
Posts: 166
Re: Advanced harvesting system (FIXED)
The error means u either added another bracket or it needs 1 more
cuz ive gotten that error to either add another bracket or take 1 off c if that helps
---
Fate-Gaming/Forgotten Memories Owner.
15 years, 8 weeks ago
|
Beywolf
Joined: 24th Apr 2011
Posts: 226
Re: Advanced harvesting system (UPDATED LINKS)
Nice guide, its compiling now :D
It worked :D
Er but I may have misread something but I am to lazy to go back and check it ;o
Under
SCRIPT_REGISTER_ENUM_VALUE(Unknown4);
There is this:
SCRIPT_REGISTER_ENUM_VALUE(Unknown5);
But I think its suppose to be at this:
SCRIPT_REGISTER_ENUM_VALUE(HarvestTree);
Anyways, I think this is the most detailed guide i've ever seen. Also one of the firsts that worked for me with no errors except a simple one that was a easy fix. :D
13 years, 43 weeks ago
| | | | | | | | |