BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Age of Conan Archive => BeBot Hyborian modules => Topic started by: madrulf on July 17, 2008, 08:19:47 pm

Title: City Management Module
Post by: madrulf on July 17, 2008, 08:19:47 pm
This is a city building and resource management module. The benefit of using it is to allow members to track your guild's progress towards a complete city without requiring them to learn how to play an architect.

member commands:

!city - shows the current status of the city

!city help - some details on resource requirements of different tiers of buildings

admin commands:

!build next - prepares to build the next building in the city sequence, ie. Temple I follows Trade Post I

!build confirm - must follow a build command within 30 seconds (prevents accidents)

!build wall <wall name> - couldnt find an easier way to do this as you can have multiple of each and not in order, use full names with tier, ie. Gate I, Gate III, Corner Tower II

!build bank <material> <quantity> - use this to manage your stock of building materials, gathered materials must be in increments of 10, can use either gathered or refined names, ie. !build bank Ornate Facade 10 is the same as !build bank Electrum 100

!build config <walls> <curved> <staired> <gate> <tower> <ending> <corner>  - use this to define how many of each wall type you have in your city, as it varies by plot (defaults to Lacheish East). Maybe in a future revision I'll include the numbers in the script so you dont have to define it yourself.

Other options can be set through the bot's settings and colors menus, under the tag City.

download:

The current revision is attached to this post. You'll have to log in to download it.

things to be added:

1. Making '!build' a simplified '!city' command that includes links to build and confirm to reduce typing.
2. Cron task guild spam for remaining materials.
3. Battlekeeps? I don't know anything about them. Same plans as the player cities or something different?

version history

1.0 - first release
1.1 - seperated build and resource management from city command to set permissions seperately
1.2 - added help, fixed bank for facades, added colors and settings options
1.3 - added city location to settings and removed !build config; coins have been added to requirements, use !build bank coins <amount in silver> to add to bank
1.4 - bug fix

All feedback is appreciated.

screenshot
(http://ikonoclasm.com/citydetails.jpg)
Title: Re: City Management Module
Post by: kaeus on July 17, 2008, 08:52:41 pm
This looks awesome.  Cant wait to try it out!
Title: Re: City Management Module
Post by: kelmino on July 17, 2008, 11:18:24 pm
ooo very nice, def something I'll be playing with this weekend.  what type of permissions are needed to add/edit this?
Title: Re: City Management Module
Post by: madrulf on July 18, 2008, 03:24:05 am
To be honest, since I put all of the administration commands like building and setting resources under the same command, I wasn't sure if I could use the standard permissions system for it. By default, members can check the !city and !city help commands, which let you see the status of the city and in next revision should have some guides included. The build and set subcommands require ADMIN rights on the bot. I figured that only ranking members of the city can place buildings anyhow so it should be appropriate. Thanks for asking about permissions though, as I realized I'm not checking permissions on the config subcommand to set the number of walls for your city plot. I'll probably seperate the building commands from info commands next revision to make this simpler.

I thought of a few other things that should be added, like a quick way to set up the module for your city, rather than typing !city build next, !city build confirm a dozen+ times.

I'll see what I can crank out tonight and edit my first post to explain how the module works.
Title: Re: City Management Module
Post by: erynys on July 18, 2008, 07:38:54 pm
Hi,

Works great all but "Ornate Facade" and "Grand Facade"  ???

I receive Error: Unknown building material every time I try to add those.

Any ideas?
Title: Re: City Management Module
Post by: madrulf on July 18, 2008, 07:50:27 pm
Yeah, I caught that bug last night. Will be fixed in this next release. Working on getting the help part into the script right now and then I'll post a new version with instructions in my first post.
Title: Re: City Management Module
Post by: Noer on July 18, 2008, 09:38:19 pm
Thats a very nice module madrulf. I'll put that in the next revision of the bot.
Title: Re: City Management Module
Post by: madrulf on July 18, 2008, 11:23:57 pm
Almost done with my last edits. Just need to remove my hardcoded bot name from everywhere ;)
Title: Re: City Management Module
Post by: elvyne on July 18, 2008, 11:40:29 pm
looking forward to it :)
Title: Re: City Management Module
Post by: durroch on July 19, 2008, 10:50:47 am
Thank you very much!  My guild's Resources Officer thanks you too :).

She had a request though.
Quote
[Guild] Vesper: I want to be able to enter the costs of each building and have the bot list the amount we still need to complete the city. Like with resources, but then for coin
[Guild] Vesper: and the coin we have in the guildbank...it's exactly the same thing as resources.

Can that be done?
Title: Re: City Management Module
Post by: cyberkov on July 20, 2008, 01:25:53 am
Wow! This module is great :D

Only one thing: Got a headache by reading the code through the lack of comments and the extensive use of arrays ;)

I started a translation to german, which works perfectly if you set $userefined = true; Think that was intended and works like a charm now :D

keep up the good work! Think I'll build my drupal module to show the needed ressources on our homepage upon this.
Title: Re: City Management Module
Post by: madrulf on July 20, 2008, 03:00:29 am
durroch: Sure, I can add the gold/silver coin costs to the requirements. I'll add it to my to-do list.

cyberkov: Haha, I've never been good at writing comments. I usually re-write complete sections after the logic doesnt make sense to me anymore. If there's considerable interest, I'll work on seperating the strings from the script so that we could have it in multiple languages.

The whole module just started with something that I wanted for my city. The end result was something that was considerably complete and figured sharing was my way of repaying Noer and the BeBot team for their time and contributions to the AO/AoC community.
Title: Re: City Management Module
Post by: durroch on July 20, 2008, 11:16:00 am
Thanks Madrulf! Can't wait for your update :D.
Title: Re: City Management Module
Post by: cyberkov on July 20, 2008, 08:35:49 pm
cyberkov: Haha, I've never been good at writing comments. I usually re-write complete sections after the logic doesnt make sense to me anymore. If there's considerable interest, I'll work on seperating the strings from the script so that we could have it in multiple languages.

hmm. I think we would need a more general approach on internationalization that it makes sense. I didn't see any routines in BeBot to use translation so im assuming that would be much more effort than it would be of use for the community.

btw that's what I did with your module http://dierebellen.net/cityprogress :)
the output still needs some design but it's working ;)
Title: Re: City Management Module
Post by: Organizer on July 21, 2008, 06:43:21 pm
Great module our guild will start using this shortly... :)
Title: Re: City Management Module
Post by: madrulf on July 22, 2008, 07:34:32 am
Updated to 1.3

Added city location to !settings city and removed !build config

Checking inputs for bank resources now to make sure it's numeric value

Bank now tracks coins by using !build bank coins <amount in silver> - for example, if you have 65G 80S in your bank use !build bank coins 6580


Next update will have the build menu. Just got rather busy recently.


Also wanted to see what you guys thought about the way resources required to complete <group> is handled. My guild's architect thought it was bugged, that we have 60 Gold in our bank, but it says that we still need 15 G 30 S for required resources. My response was that the resources required is just the total needed for remaining buildings, not the amount after subtracting what was in the bank. The reason for this is because, though it's logical for a guild to build the buildings before walls, it's not necessary and I can't determine where the gold is going to be spent. Buildings and Walls are tracked seperately as some guilds progress to Tier 2 buildings before completing Tier 1 Walls, and I'm sure is also the case for T3 Keep before T2 Walls are all up. If other people would like to see the calculation handled differently, I might add another setting for it.
Title: Re: City Management Module
Post by: Organizer on July 22, 2008, 01:48:12 pm
Not sure what I am doing wrong; used 1.2 with r4 without issues, upgraded to r9 today and the new 1.3 and getting this error now... also tried 1.3 with r13 and my stable r4 - same error...

Parse error: syntax error, unexpected '{' in G:\bebot\custom\modules\City.php on line 737
Title: Re: City Management Module
Post by: durroch on July 22, 2008, 01:59:51 pm
Missing a ")" on line 737 ;).
It should be
Code: [Select]
if (!is_numeric($qty))

Thanks for the update!
Title: Re: City Management Module
Post by: Organizer on July 22, 2008, 03:58:38 pm
If I might request another function or two to this amazing piece of work :) We stopped using the supplies mod and switched to this...

People needs reminding now and then and supplies added a cron task job that would remind people what is needed at a given interval, would this be possible for this mod as well, e.g. pick up what is still missing for the current tier and announce this in guild with a link to the full overview. Maybe have a an setting function on what to include in the announce, e.g. current tier building, current tier walls and/or both. I presume no guild really needs to include any next tiers to such an announce. If this is to advance even just spamming the overview link at certain times or intervals would be super great...

Thanks in advance!
Title: Re: City Management Module
Post by: madrulf on July 22, 2008, 06:11:45 pm
Well, don't know how I managed to edit the file when I had it running on my bot while adding it to the archive. 1.4 is a bug fix release. If you guys have already fixed the syntax error, you don't need to download this.

Organizer: I'll look at adding a cron with the options you've described.
Title: Re: City Management Module
Post by: Vrykolas on July 22, 2008, 06:32:36 pm
Mandrulf: you may want to talk to Kardsen about combining this with the supplies module he wrote (http://bebot.link/aoc-modules/need-help-*supplies-needed-module/ (http://bebot.link/aoc-modules/need-help-*supplies-needed-module/))
Title: Re: City Management Module
Post by: Organizer on July 23, 2008, 12:28:03 am
Thanks madrulf, would be great ;)

I'm no architect but in the list of buildings it lists one called "Library"? We have built all tier1 buildings as to my knowledge and have no Library. We do however have a "University", did Funcom rename it at one point or what?

I see as well on the official webpage that there is no Library listed, only Universety -> http://community.ageofconan.com/wsp/conan/frontend.cgi?func=publish.show&func_id=1096&table=PUBLISH&template=news_no_feature&selected=1096

Does anyone know more about this?
Title: Re: City Management Module
Post by: madrulf on July 23, 2008, 08:15:46 am
Organizer: I'm not certain. I went by the names given when activating an unbuilt Profession object. The name there is Library, however it requires a University Plan and says University in the description. I suppose I can rename it to University in next update with build menu. I should have time to work out the build menu tomorrow. The primary goal is to eliminate the need for typing out the '!build x y z' commands, 90% of the time.

Vrykolas: I didn't really consider it. My guild has been advertised as casual and my reason for making the module was to allow players to see how far we've come along from the start. Now that I've released the module and trying to meet the needs of the public, it may not be a bad idea. I felt that Supplies Needed was invasive (records names of players that contribute and demands resources) and didn't fit the "no commitment" nature of my guild, which prompted me to create my own module. :) We'll see how City evolves over the coming weeks.
Title: Re: City Management Module
Post by: Noer on July 23, 2008, 09:27:28 am
You can make it an optional sub-module if you are worried about the intrusiveness. :)
Title: Re: City Management Module
Post by: Organizer on July 23, 2008, 02:16:47 pm
Just wanted to report a possible minor bug when using the !build bank x y function and the x is not recognized, the error i get today at least in cases is "Unknown building material 'Coins'." -> presuming coins should have been whatever X I tried to add and not always coins.
Title: Re: City Management Module
Post by: Glyph on July 23, 2008, 05:02:55 pm
The cost in money has been updated. You should update the built in numbers to reflect the latest path. Not sure about the exact numbers however.
Title: Re: City Management Module
Post by: madrulf on July 23, 2008, 07:57:08 pm
Glyph: The current coin costs I'm going on are

Tier 1 Plans: 101 Silver (2*38 Paper + 25 Ink)
Tier 2 Plans: 153 Silver (2*64 Paper + 25 Ink)
Tier 3 Plans: 249 Silver (2*112 Paper + 25 Ink)

I'm not an architect, so unless recipes have changed, everything is accurate.

Organizer: Thanks for pointing that out, I'll fix that next release.
Title: Re: City Management Module
Post by: saik0 on August 01, 2008, 05:45:40 pm
Very nice module, one nice feature would be a confirmation link. In order to pull that off though you would probably want the "preparing" message always sent to the source in a tell. Then maybe always send the "built" message to guild chat.

Also it's not subtracting what the guild has from what is needed to build, is that intended?
Title: Re: City Management Module
Post by: Organizer on August 03, 2008, 02:34:21 am
Quote
Also it's not subtracting what the guild has from what is needed to build, is that intended?

Its intentionally for now not doing that as per a post from the author, would really have liked to see something on that as its hard to get a understanding of what exactly is missing, although I see the arguments of what makes it difficult to do as well... maybe add some settings option for each guild to decide what it should calculate against. He might be working on something as suggested earlier from me but presume he's been busy as there has not been any update for a while :)
Title: Re: City Management Module
Post by: madrulf on August 11, 2008, 02:57:35 am
Sorry for lack of updates. Been really tied up lately, haven't had much time to play either. I've got half of the next release worked out, but still got cleaning up to do. I'll have something out this week.

As for how resources will be handled -- If you have the resources in the bank, building a structure will reduce that amount from your stock, as long as you have that much material in stock. Otherwise it will set the stock to 0. This will allow for guilds that just installed the city module to immediately click links to build the city up to its current state without having to enter absurd values for bank materials.

Looking into the far future, I'd like to consider merging this module into that supplies needed module. Perhaps creating a module that operates the guild's bank, and then make it a prerequisite module for the city module.
Title: City module patch
Post by: saik0 on August 11, 2008, 08:50:06 pm
I made a patch to update all the mysql statements to use prefixes if necessary. Download link below.
Title: Re: City Management Module
Post by: catolh on January 18, 2009, 12:30:48 pm
I am getting an error when adding stuff like silver etc.

Code: [Select]

Botten [GROUP]  [MSG]   [random guild] random name: !build bank coins 5

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /guildbot/Sources/MySQL.php on line 188

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /guildbot/Sources/MySQL.php on line 193



Nothing gets stored in our database. I dont know if this is an error in your module, or an error in the way bebot handles modules.
SimplePortal 2.3.7 © 2008-2024, SimplePortal