Author | Message | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ![]() I havent released anything in awhile so Id like to share the basic housing system ive been working on. Theres no npc furniture,no interchangeable gfx very basic system, that can be improved on! This was compiled in a rev 189, do not attempt to put this in 205 + revs unless you are familiar with the new features and can modify to fit! In character.cpp in the load function find `partner`, add `house`, `house_usage`, a little bit lower find this->hp = GetRow<int>(row, "hp"); and add below scroll down a little bit and find bool Character::ValidName(std::string name) add above it https://tehsausage.com/paste/character-cpp-housing if you dont have a petsystem remove anything that says this->PetTransfer(); or add your pet spawn/respawn in its place. scoll down find these functions bool Character::InRange(Character *other) bool Character::InRange(NPC *other) bool Character::InRange(Map_Item *other) and replace all three with this https://tehsausage.com/paste/house-inrange scroll down and find void Character::Save() find `partner` = '$', add `house` = '#', `house_usage` = '#', a little bit lower find this->partner.c_str(), add this->house, this->house_usage, Done in character.cpp go to world.cpp find void world_timed_save(void *world_void) and add above void world_house(void *world_void) scroll down a bit find this->home_config.Read(this->config["HomeFile"]); and add below this->house_config.Read(this->config["HouseFile"]); scroll down a bit and find TimeEvent *event = new TimeEvent(world_spawn_npcs, this, 1.0, Timer::FOREVER); scroll down a find void World::Rehash()and this->home_config.Read(this->config["HomeFile"]); and add this below this->house_config.Read(static_cast<std::string>(this->config["HouseFile"])); done in world.cppgo to character.hpp find int exp; add int house; int house_usage; find void Warp(short map, unsigned char x, unsigned char y, WarpAnimation animation = WARP_ANIMATION_NONE); add below done in character.hpp go to Item.cpp and find if (this->player->character->HasItem(id)) https://tehsausage.com/paste/item-cpp-house-key done now go to talk.cpp to add pay rent command https://tehsausage.com/paste/talk-cpp-pay-rent done now go to your config.ini and config.local.ini and find ## HomeFile (string) ## House File (string) scroll down and find ## MISC ## add below ## HousePayment (number) done now go to your data folder and create a house.ini and add these contents https://tehsausage.com/paste/house-ini done in your data folder now to setup your database create 2 new tables Name house Type INT Length/Set 11 Default 0 check off Not Null Name house_usage Type INT Length/Set 11 Default 0 check off Not Null done in the database. With your pub editor create a potion with icon 250 "key gfx" for each different house match the new item id to the id in your house.ini EX: newitem id 703 will warp you to house = 192 check house.ini also make these house keys are lore! Make new maps for these houses and set the map id up in house ini dont have doors untested if someone walks in warp in warp out with the house key click like a potion. Rent this amount will be removed after 30 minutes, if you dont have this amount the landlord hounds you for the next 30 minutes than removes your key. I think thats it hope I remembered everything!
|
| ![]() this looks really nice! i will try it out soon :) --- Skype: izumibluuh I sincerely apologize for my posts from when I was 12.
|
| ![]() Yes, soon as your on line the timer starts when it reaches 30 minutes it checks for the rent money! I was thinking like 30 minutes = 30 days that can be adjusted!
|
| ![]() Also for decoration i got idea that you put an object in a spot, then #building on/off, if on u hit the chair eg, it will change :o idk if its possible --- Skype: izumibluuh I sincerely apologize for my posts from when I was 12.
|
| ![]() iSnow posted: (31st May 2011 09:12 pm)Ive never got in to changing the gfx of a map this way,its most likely possible but I dont have the slightest clue! I was thinking somthing like upgrades more expensive key gets better house/modified map!
|
| ![]() insomniac posted: (31st May 2011 09:17 pm)iSnow posted: (31st May 2011 09:12 pm)Ive never got in to changing the gfx of a map this way,its most likely possible but I dont have the slightest clue! I was thinking somthing like upgrades more expensive key gets better house/modified map! Yeah my idea is that if #building on the player can hit an object and it swaps till the player find something he or she likes. (I think Refresh() is a good thing to add to refresh the map or something) --- Skype: izumibluuh I sincerely apologize for my posts from when I was 12.
|
| ![]() iSnow posted: (31st May 2011 09:21 pm)Any idea how to go about that?insomniac posted: (31st May 2011 09:17 pm)iSnow posted: (31st May 2011 09:12 pm)Ive never got in to changing the gfx of a map this way,its most likely possible but I dont have the slightest clue! I was thinking somthing like upgrades more expensive key gets better house/modified map!
|
| ![]() insomniac posted: (31st May 2011 09:24 pm)iSnow posted: (31st May 2011 09:21 pm)Any idea how to go about that?insomniac posted: (31st May 2011 09:17 pm)iSnow posted: (31st May 2011 09:12 pm)Ive never got in to changing the gfx of a map this way,its most likely possible but I dont have the slightest clue! I was thinking somthing like upgrades more expensive key gets better house/modified map! Nope XD but Rena had something on her server to get her clothes equipment changed --- Skype: izumibluuh I sincerely apologize for my posts from when I was 12.
|
| ![]() iSnow posted: (31st May 2011 09:29 pm)Ill look around a bit and see if i can find anything!insomniac posted: (31st May 2011 09:24 pm)iSnow posted: (31st May 2011 09:21 pm)Any idea how to go about that?insomniac posted: (31st May 2011 09:17 pm)iSnow posted: (31st May 2011 09:12 pm)Ive never got in to changing the gfx of a map this way,its most likely possible but I dont have the slightest clue! I was thinking somthing like upgrades more expensive key gets better house/modified map!
|
| ![]() Rena used # commands to change the players' items. it just goes up a list. #armor would give me a armor, and save it in the database, refresh the character. If i did #armor again, it would give me the next armor that she put, and save it to the database, refresh the character. It's nothing to do
with GFX. --- Create your own destiny, don't let someone else do it for you.
|
| ![]() Yeah good call AustinB I think this will be a little more intense than switching armors and storing id's + refreshing, but similar in a over all scale. Would need something like a set of gfx stored in a config that can be i swapped EX:dresser, cabinet, table! chair, stool, bench! Instance maps for each player that would be tough thats why I think simple house upgrades would be nice same house base, 1basic house map, 2house with a couple more things, 3bomb house best stuff. etc
|
| ![]() insomniac posted: (31st May 2011 11:50 pm) Yeah thats a smart idea too xD After what i saw at your server --- Skype: izumibluuh I sincerely apologize for my posts from when I was 12.
|
| ![]() This is why I left it bland so people can really do what they want with it. This should be simple EX: say instead of gfx swapping I make #upgrade command to view the houses before you buy the key, would also have to link the houses alt maps in the house.ini
|
| ![]()
--- Andrewbob - I would be on the fucking copter of rofls Programmer, Web Developer, and Graphics Designer
|
| ![]() Wildsurvival posted: (1st Jun 2011 12:29 am) It's 30 mins? Either way you can edit --- Skype: izumibluuh I sincerely apologize for my posts from when I was 12. |