All times shown according to UTC.
Time | Nick | Message |
---|---|---|
00:09 | DiscordBot | <Natalie> Hmm |
00:09 | <Natalie> What the evercrapping crap. | |
00:10 | <Natalie> Any idea why | |
00:10 | <Natalie> @property def gold(self): gold = self.data.get("gold", 0) return gold @gold.setter def gold(self, gold): self.data["gold"] = gold | |
00:10 | <Natalie> Works 100% | |
00:10 | <Natalie> However | |
00:10 | <Natalie> @property def xp(self): current_xp = self.data.get("xp",0) return current_xp @xp.setter def xp(self, xp): self.data["xp"] = xp | |
00:10 | <Natalie> Doesn't | |
00:11 | <Natalie> In fact, if I use | |
00:11 | <Natalie> @py self.character.xp = 125 let's say | |
00:11 | <Natalie> @py self.character.xp will return 125 | |
00:11 | <Natalie> However self.db.chardata["xp"] remains unchanged | |
00:12 | <Natalie> self.data = self.parent.db.chardata | |
00:18 | <Farî> I don't know why the first one works, but you should change the xp.setter name to set_xp | |
00:21 | <Natalie> That's not how I want to do it, I want them to be properties and accessed the same | |
00:21 | <Natalie> So I can use | |
00:21 | <Natalie> character.hp to both get and set the value | |
00:21 | <Farî> yes @property def xp(self): current_xp = self.data.get("xp",0) return current_xp @xp.setter def xp(self, xp): self.data["xp"] = xp | |
00:21 | <Farî> yes @property def xp(self): current_xp = self.data.get("xp",0) return current_xp @xp.setter def set_xp(self, xp): self.data["xp"] = xp | |
00:21 | <Farî> character.xp = 25 | |
00:22 | <Natalie> They don't need the same name? | |
00:22 | <Natalie> @X.setter def X() ? | |
00:22 | <Farî> in fact I believe they should not have the same name | |
00:22 | <Farî> the name is defined in @name.setter | |
00:23 | <Natalie> Well, let me see then. | |
00:24 | <Natalie> AttributeError: can't set attribute | |
00:25 | <Farî> can you provide more traceback? | |
00:25 | <Natalie> That's all it says. | |
00:25 | <Farî> check your server log | |
00:26 | <Natalie> Nothing. I'll reload and try again | |
00:27 | <Natalie> apparently deleting the log file and reloading causes the entire thing to crash. | |
00:28 | <Natalie> Nothing in the log at all | |
00:28 | <Farî> can you show me what your code looks like and screenshot the @py command? | |
00:30 | <Natalie> Relevant code is | |
00:31 | <Natalie> python class CharacterHandler: """ This file will have helper methods to deal with Characters """ def __init__(self, character): self.parent = character self.data = self.parent.db.chardata @property def level(self): level = self.data.get("level", 1) return level @level.setter def set_level(self, level): self.data["level"] = level | |
00:31 | <Natalie> so changing | |
00:32 | <Natalie> set_level() back to level() | |
00:32 | <Natalie> fixes one thing at least | |
00:32 | <Farî> and you're calling @py self.level = 1 or similar? | |
00:32 | <Natalie> yeah changing it back fixes it | |
00:32 | <Natalie> @py self.character.level = | |
00:32 | <Natalie> yes | |
00:32 | <Farî> this is my code python @property def title(self): return self.parent.db.job @title.setter def set_title(self, title): self.parent.db.job = title | |
00:32 | <Farî> works just fine | |
00:33 | <Natalie> No idea. If mine's changed from level to set_level it explodes. | |
00:33 | <Natalie> Could it be because it's not updating the objects in memory to know what thing to call? I have no idea | |
00:33 | <Farî> hmmm, maybe I'm wrong then | |
00:34 | <Farî> anyway, back to the original point, 'fraid I have no idea about this one | |
00:35 | <Farî> they should work if they're both identical | |
00:35 | <Natalie> Okay, so I seem to have narrowed it down | |
00:35 | <Natalie> If I | |
00:35 | <Natalie> handler.property = X | |
00:35 | <Natalie> It works with all of them it seems | |
00:35 | <Natalie> If I use | |
00:35 | <Natalie> += or -= | |
00:35 | <Natalie> It only works with some of them | |
00:36 | <Natalie> no wait | |
00:36 | <Natalie> it's more janky than that wtf | |
00:37 | <Natalie> >>> self.character.level = 1 >>> self.db.chardata {'str': 8, 'dex': 16, 'con': 14, 'int': 19, 'wis': 8, 'cha': 16, 'str_mod': -1, 'dex_mod': 3, 'con_mod': 2, 'int_mod': 4, 'wis_mod': -1, 'cha_mod': 3, 'unspent_sp': 0, 'max_hp': 24, 'race': 7, 'class': 15, 'hitdie': 8, 'hp': 24, 'healed_last': 1604089292.734594, 'last_healed': 1616346179.0323598, 'xp': 100, 'copper': 127, 'silver': 159, 'gold': 269, 'hunger_state': 50, 'level': 1} >>> | |
00:37 | self.db.chardata {'str': 8, 'dex': 16, 'con': 14, 'int': 19, 'wis': 8, 'cha': 16, 'str_mod': -1, 'dex_mod': 3, 'con_mod': 2, 'int_mod': 4, 'wis_mod': -1, 'cha_mod': 3, 'unspent_sp': 0, 'max_hp': 24, 'race': 7, 'class': 15, 'hitdie': 8, 'hp': 24, 'healed_last': 1604089292.734594, 'last_healed': 1616346179.0323598, 'xp': 100, 'copper': 127, 'silver': 159, 'gold': 269, 'hunger_state': 50, 'level': 2} >>> self.db.chardata {'str': 8, 'dex': 16, 'con': 14, | |
00:37 | 'int': 19, 'wis': 8, 'cha': 16, 'str_mod': -1, 'dex_mod': 3, 'con_mod': 2, 'int_mod': 4, 'wis_mod': -1, 'cha_mod': 3, 'unspent_sp': 0, 'max_hp': 24, 'race': 7, 'class': 15, 'hitdie': 8, 'hp': 24, 'healed_last': 1604089292.734594, 'last_healed': 1616346179.0323598, 'xp': 100, 'copper': 127, 'silver': 159, 'gold': 269, 'hunger_state': 50, 'level': 2} | |
00:37 | <Natalie> It's just ... randomly toggling it back to the old value | |
00:38 | <Natalie> See level changing from 1 back to 2 at the end | |
00:38 | <Farî> might I suggest changing this dictionary into a Script? | |
00:38 | <Farî> that might be easier to work with | |
00:41 | <Natalie> What do you mean? That's just the stuff stored on the character. I can get the level fine through scripts | |
00:41 | <Farî> no no, a Script | |
00:41 | <Natalie> I'm just showing the raw data in the database is changing randomly | |
00:41 | <Farî> https://evennia.readthedocs.io[…]test/Scripts.html | |
00:42 | <Farî> instead of self.db.chardata being a dict full of keys and values, make it an object inheriting DefaultScript | |
00:42 | <Farî> then you can merge the handler into it | |
00:44 | <Natalie> I'm not sure the benefit or difference. Except where the data is stored, which I currently just am storing in DB attributes | |
00:44 | <Natalie> How does having that on a script object help over db attributes? | |
00:46 | <Natalie> The only thing I can think of being the problem currently is some sort of memory-caching issue, or if it's making a COPY of the attributes and modifying those over the original... but even then, why work in all cases except one | |
00:46 | <Farî> Organizationally, you are currently accessing and setting this data through a byzantine labyrinth of getters and setters, handlers, properties, values in dictionaries; this makes the process much more prone to failure or unexpected results, as you are currently experiencing. Philosophically, I consider it more appropriate to store attributes in the database in row/column form, where the column is an integer and the row is the value, rather | |
00:46 | than in JSON format where all of the integers and strings and whatnot are bundled up into a text string that is loaded out of the database | |
00:47 | <Farî> Also, within Evennia's design, this is precisely the sort of use case that Scripts are for, persistently storing data about an object. | |
00:47 | <Natalie> That seems the issue | |
00:47 | <Natalie> >>> self.db.chardata {'str': 8, 'dex': 16, 'con': 14, 'int': 19, 'wis': 8, 'cha': 16, 'str_mod': -1, 'dex_mod': 3, 'con_mod': 2, 'int_mod': 4, 'wis_mod': -1, 'cha_mod': 3, 'unspent_sp': 0, 'max_hp': 24, 'race': 7, 'class': 15, 'hitdie': 8, 'hp': 24, 'healed_last': 1604089292.734594, 'last_healed': 1616346179.0323598, 'xp': 100, 'copper': 127, 'silver': 159, 'gold': 269, 'hunger_state': 50, 'level': 1} >>> self.character.level 2 | |
00:47 | <Natalie> It's just not accessing the thing, it's accessing some copy instead of the original | |
00:48 | <Farî> Would not be happening if you used a script | |
00:48 | <Natalie> Well all the tutorials when I started creating my game all showed specifically to use DB Attributes | |
00:48 | <Natalie> I haven't seen any saying to use a script to store persistent data, so I'm not even sure how that'd work | |
00:48 | <Farî> It's no different. You store the data in DB attributes on the Script, which takes the place of the dictionary, and then store the Script in a DB attribute on the player. | |
00:49 | <Farî> This way, your character data is stored as an object in the database, instead of a string | |
00:49 | <Natalie> Okay... so I'm storing the exact same thing, but one step removed then? | |
00:49 | <Natalie> Instead of character.db.something | |
00:49 | <Natalie> I'm doing | |
00:49 | <Natalie> character.script.db.something | |
00:49 | <Farî> Yes, but you would access it the same way. self.character.level via the level @property on the script, which would be a @lazy_property named 'character' | |
00:50 | <Farî> Or, actually, not a lazy property, just a property that returns self.db.character | |
00:50 | <Natalie> I ... I still just don't get what the difference is with having it once removed. They're both just DB properties no? | |
00:50 | <friar> # adding two objects def add(self, o): return self.a + o.a | |
00:50 | <Natalie> Why is character_object.db worse than character_object.script.db ? | |
00:50 | <Farî> For the reasons outlined above | |
00:51 | <Farî> And also because of the issues you are currently struggling to fix | |
00:51 | <friar> typeclass.property+=integer is shorthand for typeclass.property=typeclass.property + integer. | |
00:51 | <Natalie> I get that, but I don't see why | |
00:51 | <friar> which likely the property needs the __add__ function defined. | |
00:51 | <Natalie> character.db.level = 1 would be different than character.script.db.level = 1 | |
00:52 | <Farî> Not to your code, which would simply call self.character.level = 1 either way | |
00:52 | <Farî> You would never directly call character.script.db | |
00:53 | <Natalie> I know, but what does moving it change mechanically. Like... I have object, attached handler. | |
00:53 | <Farî> I feel I have explained that already | |
00:53 | <Farî> Also, you would no longer have a handler | |
00:53 | <Natalie> How does the handler access a SCRIPT differently than it would the character object | |
00:53 | <Farî> You move the handler properties to the script | |
00:53 | <Farî> The script is both handler and database object | |
00:54 | <Natalie> Well aren't you just moving a handler from a flatfile to a database object then? | |
00:54 | <Farî> The script directly references self.db.level instead of self.parent.db.chardata.get("level", 1) | |
00:54 | <Farî> Thus eliminating several failure points | |
00:55 | <Farî> And simplifying your data storage | |
00:56 | <Natalie> I feel that change would require me to wipe all the characters though. Well, wouldn't it complicate my storage? If I need to edit an attribute quickly on a character, I can just do it through the django admin pages. If it's just a script object attached to the character, doesn't that mean any modifications or viewing or anything has to be done solely through code? | |
00:57 | <Farî> No, scripts are also stored in the database, which can be edited through the django admin page | |
00:58 | <Farî> As a matter of fact there's a special page for editing them | |
01:00 | <Farî> I'm currently using them to store outfit configurations so that my players can swap between different configurations of clothing with a single command | |
01:01 | <Natalie> I just actually made an outfit manager too. | |
01:02 | <Natalie> In any case | |
01:02 | <Farî> I highly recommend leveraging the power of Scripts to serve as both handler and database storage in one | |
01:02 | <Natalie> 100% my problem is this self.data = self.parent.db.chardata | |
01:02 | <Natalie> Which makes a copy | |
01:02 | <Natalie> when I want it to make a pointer | |
01:02 | <Cloud_Keeper> Interesting design paradigm fari | |
01:02 | <Natalie> Is there a way to make it POINT to that rather than just make a copy? | |
01:03 | <Cloud_Keeper> What have you found to be the advantages over handlers and storage on the object | |
01:03 | <Farî> Sure, make a property that returns self.parent.db.chardata for self.data | |
01:03 | <Natalie> That's done in the init part though, so I'm not sure where/what I'd do to do that. | |
01:03 | <Natalie> Oh wait. | |
01:03 | <Natalie> I guess... ooooooh. | |
01:04 | <Natalie> Maybe... I shall see lol | |
01:04 | <Farî> It's a little difficult to articulate, it just feels better I suppose? It allows me to organize my code in a more satisfying way that better adheres to the principles of object-oriented programming IMHO | |
01:05 | <Cloud_Keeper> Fair enough | |
01:05 | <Farî> It is less hacky | |
01:05 | <Farî> From a principled standpoint, I don't like handlers setting db variables on the parent all that much. It makes more sense to divide them into different objects which hold that data themselves | |
01:06 | <Farî> Particularly given that I see a handler as an "extension of functionality" over the base object | |
01:07 | <Cloud_Keeper> I can see that perspective | |
01:08 | <Natalie> Ahaaa. | |
01:08 | <Natalie> I figured out where it went wrong. | |
01:08 | <Natalie> self.parent = character self.data = self.parent.db.chardata | |
01:08 | <Natalie> That makes a sneaky bastard copy | |
01:08 | <Natalie> self.parent = character self.data = character.db.chardata | |
01:08 | <Natalie> That attached it to the ORIGINAL | |
01:09 | <Farî> But it's not my place to organize other people's code, I'm just offering an alternative | |
01:09 | <Cloud_Keeper> I can appreciate how overloaded an object can feel as you add functionality and using handlers on the object doesn't necessarily alleviate that. I'll have to ponder on the greater ramifications. | |
01:09 | <Farî> *nod* | |
01:12 | <Farî> You also have to weigh builder accessibility vs code organization. I think it's OK to put things on the parent obj if you want builders to be able to easily set them. But something like a roster of saved outfits, there's no reason for that to be easily accessible to builders. They shouldn't need to edit that so it all gets abstracted away as a reference to a Script. | |
01:13 | <Farî> I like how extensible and flexible Scripts are, so I'm trying to use them more as building blocks for things that are persistent. | |
01:47 | <DaveWithTheNiceHat> weakref? I know it makes a reference that will not prevent garbage collection. | |
02:05 | <Natalie> | |
02:05 | <Natalie> Now I just need to find collaborators! Bwahaha. | |
02:06 | <Natalie> I guess I can work on something on my todo list for game features before having a nap | |
02:08 | evenniacode | [pull request] realkinetix review-requested PR #2360 (Maintenance time calculations should be done in minutes, not[...]) to evennia/maintenance-times <https://github.com/evennia/evennia/pull/2360> |
02:15 | DiscordBot | <Natalie> I swear there was a ... command... function... something... to take a string and truncate it to a certain length and add [...] to the end if it went over that length. |
02:15 | <Natalie> Does anyone remember what it was in Evennia? | |
02:15 | <Farî> I bet it's in utils | |
02:15 | <Natalie> I wish to show a preview of text, but have it trail off and truncate if it's too long | |
02:15 | <Natalie> Hmm. Probably! I should go look | |
02:16 | <Farî> https://www.evennia.com/docs/l[…]ght=utils#evennia.utils.utils.crop | |
02:16 | <Farî> You can even customize the suffix | |
02:16 | <Natalie> def crop(*args, **kwargs): | |
02:16 | <Natalie> Oh, you beat me to it haha | |
02:16 | <Farî> The power of docs | |
03:11 | craigp joined #evennia | |
03:21 | DiscordBot | <Natalie> does a little dance |
03:21 | <Natalie> makes a little noise | |
03:21 | <Natalie> gets down tonight | |
03:33 | <Kovitikus> | |
03:36 | <Natalie> Okay here is a serious question. | |
03:36 | <Natalie> Is there a way to get the last COLOR tag present in a string? | |
03:36 | <Natalie> My use case: I'm using a text wrapper to split long lines into two lines | |
03:36 | <Natalie> however If I did something like | |
03:37 | <Natalie> "Here is some text with a |rRed Barn|n in the text" | |
03:37 | <Natalie> And I split between Red and Barn | |
03:37 | <Natalie> "Red" will be red, "barn" will be default color | |
03:38 | <Farî> yep, I was solving a related problem yesterday | |
03:38 | <Natalie> So I just need to find the last color in the split | |
03:38 | <Farî> how comfortable are you with regex? | |
03:38 | <Natalie> Somewhat, I am not pro, but I can generally understand them, or make extremely rudimentary ones if I need them. | |
03:38 | <Farî> https://pastebin.com/j8eGJqNN | |
03:38 | <Farî> here you go. you should be able to edit this to do what you need | |
03:39 | <Farî> the functionality of the code is unrelated, but the important part is the regex query it contains | |
03:39 | <Farî> it will grab ansi tags from the string, which means you can customize it to only grab color tags | |
03:40 | <Farî> then simply take the last match it gets in a string, and that's the last color tag | |
03:40 | <Natalie> I will look into it now, thanks. | |
03:40 | <Farî> my pleasure | |
03:40 | <Farî> I can say from experience, that's the best solution you're going to get. lol | |
03:41 | <Kovitikus> @Natalie <regex101.com/> | |
03:43 | jerryaldrichiii joined #evennia | |
03:45 | DiscordBot | <Natalie> Easy peasy. |
03:45 | <Natalie> > from handlers.ui import UIHandler ; UI = UIHandler() ; print(UI.last_tag("|wWhite text|rRed Text|yYellow Text")) > ['|w', '|r', '|y'] | |
03:45 | <Farî> | |
03:46 | <Natalie> That'll help tons. | |
03:46 | <Farî> glad I could save you some time | |
03:46 | <Natalie> Then to get the last you just array[-1] right? | |
03:46 | <Kovitikus> Yes. | |
03:46 | jerryaldrichiii joined #evennia | |
03:46 | DiscordBot | <Farî> Sure, that'd work |
03:47 | <Farî> That reminds me. One thing I think Evennia is missing is a color tag that reverts back to the previous color | |
03:47 | <Farî> Like |n but instead of gray, it goes to whatever the last color tag was | |
03:53 | <Natalie> Yeah, could be useful. | |
03:53 | <Natalie> Could be tricky though | |
03:53 | <Farî> CoffeeMUD had it and I'm starting to miss it | |
04:18 | <Natalie> Shit. This is actually more complicated than I thought, since I have to apply the color to the NEXT line in the sequence not the current one. Hmm. | |
04:19 | <Farî> I guess I'm confused why you need to do this in the first place? Can't you just insert a |/ and the color won't change? | |
04:21 | <Natalie> Not really, it's for UI Elements, which have padded borders and such. | |
04:21 | <Farî> fair | |
04:22 | <Farî> though, if you used EvMenu, it would preserve the colors | |
04:22 | <Natalie> So when I text wrap to a new line, I just need to shunt in the last color from the previous line | |
04:22 | <Farî> and you wouldn't need to do this workaround | |
04:22 | <Natalie> I'm not sure heavy evmenu and other things are. | |
04:22 | <Farî> They are not heavy at all, you can set them up in 3 lines of code | |
04:22 | <Natalie> I notice even simple commands like "who" which I think rely on it, even with only a few people online can take a long time to process | |
04:23 | <Farî> Sorry, EvTable, not EvMenu | |
04:23 | <Farî> "who" takes a long time to process for you? huh | |
04:23 | <Farî> well, I suspect that's because it's pulling data about the sessions and collating it, not because of EvTable | |
04:41 | <Kovitikus> Who also takes an extraordinarily long amount of time to process for me too and I only have just my one account logged in and only 9 objects in existence. | |
04:42 | <Farî> Mine takes almost no time at all | |
04:42 | <Kovitikus> It was faster for me on repeat commands. | |
04:43 | <Kovitikus> I think it was cause my server is just sitting around idle for 24+ hours and so the parsing was slow? I dunno. | |
04:44 | <Farî> my server runs 24/7, so idk | |
04:51 | <Natalie> I have heard many people say commands like who etc take a very long time to run | |
04:52 | <Natalie> The execution time on it is quite slow no matter the hardware I have it running on | |
04:56 | <Tehom> EvTable can be incredibly expensive in my experience | |
04:56 | <Tehom> I don't know where the bottleneck is in it, but I know I've locked up a pretty beefy server for a few seconds when displaying a good-sized table | |
04:57 | <Farî> guess I'm just built different | |
04:57 | <Tehom> My guess is that it's based around wrapping rows in it - but for performance I use the predecessor 'prettytable' that was in a previous version for large tables | |
04:58 | <Natalie> Well, unless you modified the database it runs on, or modified "who" | |
04:58 | <Tehom> 'large' being several hundred rows, usually | |
04:58 | <Natalie> It should run slow for you too | |
04:58 | <Farî> but, it does not | |
04:58 | <Tehom> It has nothing to do with the database | |
04:58 | <Tehom> It does not execute queries | |
04:59 | <Natalie> Not sure why Fari would be the only one to have it run quickly then. I thought I saw them mentioning they ran PosteGRSLSLSLRSLE or something that I thought might be the difference | |
04:59 | <Natalie> So dunno then | |
04:59 | <Natalie> But that may have been someone else using a different DB | |
05:01 | <Tehom> I'm pretty sure it's some weird issue based around what it does with text in the table and how many times it happens. I wanna dig into it eventually but I just used another table implementation as a workaround | |
05:01 | <Farî> I have not migrated to postgres yet | |
05:02 | <Tehom> In general, any sort of performance issues will usually be based on queries - the lone exception to that I've seen is EvTable, for whatever reason | |
05:03 | <Tehom> but if you only use it for things that are like under 50 rows, I don't think it should be noticeable | |
05:04 | <Natalie> I haven't heard anyone not noticing it, even on single sessioned "who" commands, which is why I shocked Fari said they didn't have the issue | |
05:04 | <Natalie> Just ran it on all 3 servers I have it running on | |
05:05 | <Natalie> "who" on the fastest took ~1.5 seconds, took ~4 seconds on the slowest | |
05:05 | <Natalie> That is first run | |
05:05 | <Natalie> Subsequent runs are instant | |
05:05 | <Farî> must be that I keep the server running so I hardly ever do a first run then | |
05:05 | <Natalie> Well, I meant "not run in awhile" | |
05:06 | <Natalie> my servers never shut down | |
05:06 | <Natalie> except my development one | |
05:06 | <Natalie> Though | |
05:07 | <Natalie> if you reload (which I do frequently) | |
05:07 | <Natalie> Then it takes a long time to run who again | |
05:09 | <Tehom> if subsequent runs are instant, it's a query issue | |
05:09 | <Tehom> evtable performance issues are a constant with the same data set | |
05:10 | <Tehom> The slow initial run followed by fast subsequent runs is because of the caching done by Evennia's queries - it stores a lot in the AttributeHandler | |
05:11 | <Tehom> I modified the who command a lot so I don't really remember what the basic version does, query-wise | |
05:16 | <Natalie> 2 hours of troubleshooting to fix something simple. | |
05:16 | <Natalie> throws herself off a cliff | |
05:17 | <Farî> that's programming for you | |
05:17 | <Tehom> thinking about it, it's probably because after a reload, a who will populate the account, puppet, room, and all the objects in those rooms, for everyone connected | |
05:17 | <Tehom> otherwise it'd happen for each character as they take actions, since they'll be loading themselves | |
05:18 | evdemo | [Public] sparrowhawk just connected to the Evennia demo for the first time! |
05:24 | DiscordBot | <Kovitikus> Well, we know that commands are kept after they are run and reused when called upon, unless something changes. |
05:24 | <Kovitikus> So perhaps it has something to do with that. | |
05:24 | <Kovitikus> If it still has a previous who command stored maybe that's why it's so quick, but new ones generated are slow. | |
05:33 | evdemo | [Public] sparrowhawk disconnected from the Evennia demo. |
05:42 | DiscordBot | <Natalie> Hm. I can't wrap my head around the logic to accomplish what I want. |
05:42 | <Farî> explain it to me | |
05:42 | <Natalie> My text wrapper takes a string input, as well as a width to wrap to. | |
05:43 | <Natalie> Then it splits the text into an array containing each "chunk" up to the width allowed. | |
05:44 | <Natalie> So if you wrapped to 5 characters, and had a 15 character sentence, it would potentially split into an array of three yes? (Just for simplicity, it actually splits whole words etc. But we're just being simple here.) | |
05:45 | <Natalie> So the issue I am trying to figure out, with ANSI codes in there, it'll actually count those as characters. So if there are a lot of ansi codes within the string, it will potentially wrap at a width that could have more room were it not taking those characters into account. | |
05:45 | <Natalie> I will show an example | |
05:46 | <Natalie> >>> from modules.utility.textwrap import TextWrapper ; w = TextWrapper() ; print(w.wrap("Guard Gary has told you of a popular hangout in the Market District of Aeston called For Heaven's Cakes!. Without anything better to currently do, you figure it's worth investigating.")) ['Guard Gary has told you of a popular hangout in the Market District of Aeston', "called For Heaven's Cakes!. Without anything better to currently do, you", "figure | |
05:46 | it's worth investigating."] | |
05:46 | <Farî> oh, that's easy. ANSIString(text).clean() | |
05:46 | <Natalie> @py from modules.utility.textwrap import TextWrapper ; w = TextWrapper() ; print(w.wrap("|x|oGuard Gary|x has told you of a popular hangout in the |gMarket District|x of |gAeston|x called |gFor Heaven's Cakes!|x. Without anything better to currently do, you figure it's worth investigating.")) | |
05:46 | <Farî> strips all ANSI from the text | |
05:46 | <Natalie> Yes except, if I strip it, then when I text wrap, I am removing all the colors I want to remain. | |
05:47 | <Farî> I meant to do that for the purposes of determining where to wrap | |
05:47 | <Farî> then just do it around the ansi codes | |
05:47 | <Farî> also, use EvTable | |
05:47 | <Natalie> I don't like EvTable! | |
05:47 | <Natalie> bah humbugs | |
05:48 | <Farî> then customize EvTable to suit your needs, instead of rebuilding it from scratch | |
05:48 | <Natalie> I'm not sure EvTable even respects word wrapping at client width | |
05:49 | <Natalie> Nope, just checked, and it will just go as wide as you like it by default | |
05:49 | <Farî> I'm sure you can get the client's width from the session somewhere | |
05:55 | <Natalie> Nope. The default_client_width is in the config | |
05:55 | <Natalie> but as far as I can see, it's not set, or really used or anything | |
05:55 | <Natalie> Session info containing the flags I never see any reported client widths from any client etc. | |
05:55 | <Farî> Griatch said that the client sends info like its width | |
05:55 | <Farî> so it presumably knows about it somewhere | |
05:56 | <Natalie> He said some clients do, but they're all inconsistent in the way that they do | |
05:56 | <Natalie> So I'm not sure it actually works anywhere | |
05:56 | <Natalie> It for sure doesn't with webclient, my Mudlet has never reported it. (Or Evennia doesn't know how to receive it anyways) | |
05:57 | <Natalie> So I've just opted to work with client_default_width across the board | |
06:21 | <Kovitikus> Clients are liars, sometimes. | |
06:46 | evenniacode | [fork] daiimus forked evennia <https://github.com/daiimus/evennia> |
06:48 | DiscordBot | <Natalie> Does anyone know offhand with evennia .search() if exact=True enforces case? |
06:49 | <Natalie> I want to search for a character, which I normally do with global_search=True since I need to find them if they're elsewhere or offline | |
06:49 | <Natalie> But I want the person to have to type their full character name, but I don't care about case | |
06:51 | <Natalie> Actually it seems searches aren't fuzzy by default when done in a global search so it's okay! Nevermind! | |
06:57 | SNAILBot joined #evennia | |
06:57 | Topic for #evennia is now Welcome to the Python MUD/MU* dev system Evennia (http://evennia.com)! Chat is logged to http://tinyurl.com/evchatlog . Forum: https://groups.google.com/forum/#%21forum/evennia . If you don't get a reply immediately, lurk around - you'll get noticed eventually. | |
08:01 | DiscordBot | <Kovitikus> Swedish people... smh. Just found out the Swedish word for "The End". |
08:02 | <Kovitikus> More specifically "ending, termination, finish, close, closure" I suppose. | |
08:08 | Griatch | Lol, doesn't sound so good if read in English, but it's pronounced very differently in Swedish ;) |
08:08 | DiscordBot | <Kovitikus> Yeah, like sloot. |
08:10 | Griatch | Not quite. The U is not oo, but like this: https://www.youtube.com/watch?v=VI8NksZxmxg |
08:13 | DiscordBot | <Kovitikus> GG. It all sounds the same to me. |
08:14 | Griatch | People pronouncing the long U as OO is a very easy way to recognize an English-speaker speaking Swedish. :D |
08:15 | DiscordBot | <Kovitikus> The problem is that he's being extremely picky about exactly how it sounds and he's saying illa twice, but one was wrong, yet they both sound exactly the same to me. |
08:15 | <Kovitikus> Perhaps I just take English for granted, but I don't know that we have such subtlety to our words. | |
08:16 | Griatch | Of course you do |
08:16 | DiscordBot | <Kovitikus> Any examples? |
08:17 | <Kovitikus> I'm sure the difficulty of some words changes based on the native language of the people attempting to pronounce them. | |
08:19 | Griatch | The spelling of English words often have very little to do with how they are pronounced. What is 'tear' for example - what happens when you cry or does it mean tearing something up? "Close" - is that closing something or that you are near something? |
08:20 | Content - is that me being pleased with life or the contents of a container? | |
08:20 | Pronounciation (and context) matters here, it's not easy to follow if you are not a native speaker. | |
08:21 | DiscordBot | <Kovitikus> Those are context based words, but they either are pronounced exactly the same or have very different pronunciations. I dunno, I just feel like the Swedish examples are far more subtle. |
08:21 | <Kovitikus> Huh, yeah I suppose content is pronounced slightly different in each version. | |
08:21 | Griatch | Do you know. Object (as in item) or Object (as in objecting to something) |
08:22 | DiscordBot | <Kovitikus> I never noticed that there is a subtle difference in those pronunciations until I just attempted to say them aloud. |
08:24 | <Kovitikus> Anyways, since you are around, I wanted to ask you how to recall a persistent delay after the server is reloaded in order to cancel it. | |
08:24 | Griatch | English is also much, much, much more word-bloated than Swedish by comparison (check out the thickness of an English dictionary compared to a Swedish one). It's not an easy language by any stretch, it's just the events of history that happened to make it a world language. :) |
08:25 | DiscordBot | <Kovitikus> Yeah true, we kicked down everyone's doors and shoved our culture down their throats. |
08:25 | Griatch | Well, economic dominance after the world war. German was the world language before 1930s. But they lost the war so that was it for them. |
08:25 | DiscordBot | <Lysaer> When the English tongue we speak. Why is break not rhymed with freak? Will you tell me why it’s true We say sew but likewise few? And the maker of the verse, Cannot rhyme his horse with worse? Beard is not the same as heard Cord is different from word. Cow is cow but low is low Shoe is never rhymed with foe. Think of hose, dose,and lose And think of goose and yet with choose Think of comb, tomb and bomb, Doll and roll or home and some. |
08:25 | Since pay is rhymed with say Why not paid with said I pray? Think of blood, food and good. Mould is not pronounced like could. Wherefore done, but gone and lone – Is there any reason known? To sum up all, it seems to me Sound and letters don’t agree. | |
08:26 | <Kovitikus> Your limerick was destroyed in IRC I'm sure. | |
08:26 | <Lysaer> hehe | |
08:26 | <Lysaer> I'm sure. | |
08:26 | Griatch | I got the gist of it. Where's it from? |
08:27 | DiscordBot | <Kovitikus> https://gist.github.com/koviti[…]e52e572ac618661f3 |
08:27 | <Kovitikus> There. | |
08:28 | Griatch | @Kovitikus: You cannot. The deferred is wiped on reload. To mimick surviving a reload, the task/tickerhandler will save the remaining timing/callback/args/kwargs and start a new deferred on reload. |
08:28 | DiscordBot | <Lysaer> It's an old poem written by lord cromer in 1902, apparently. There's thousands of those. I'm a bit of a fan of nonsense/absurd poems like that. |
08:28 | <Kovitikus> But then why does it save it with a task_id? | |
08:29 | <Kovitikus> Is that task_id generated anew each time the serverconfig data is reloaded? | |
08:30 | <Kovitikus> https://github.com/evennia/eve[…]askhandler.py#L95 | |
08:30 | <Kovitikus> I see that it generates a new one when you add it, but I figured the id was saved to the serverconfig and used to repopulate it again when it returns. | |
08:31 | <Kovitikus> self.tasks[task_id] = (now + delta, callback, safe_args, safe_kwargs) | |
08:31 | <Kovitikus> Then of course it calls save at the end. https://github.com/evennia/eve[…]askhandler.py#L95 | |
08:31 | <Kovitikus> Errr whoops already linked that. | |
08:32 | <Kovitikus> And I see it says dbserialize in there too, so I assumed it was using the serverconfig to save this task to storage. | |
08:32 | <Kovitikus> Which I guess only saves the date, the callback, the args, and kwargs, but not the task_id? | |
08:33 | Griatch | You'll find that the deferred itself is never saved. It saves the task_id as a convenient way to retrieve the serialized `(date, safe_callback, args, kwargs)` later. It never actually stores the deferred. |
08:33 | DiscordBot | <Kovitikus> Is there any way to change this in a feature request type thing? I'm honestly a bit confused why delays don't seem to be very manageable after you set them. |
08:34 | <Kovitikus> I get that they are lightweight, but they are the only option for setting a float delay and also for a timer that is one-shot by default. | |
08:34 | <Kovitikus> Otherwise I'd have to set a Ticker and then immediately stop it after the first tick. | |
08:34 | <Kovitikus> Seems wasteful, and again I can't set a float for the ticker. | |
08:36 | <Kovitikus> The use-case for floats, for what I can think of at the moment at least, is mostly shorter precise cooldowns, like an attack or spell cast. | |
08:37 | <Kovitikus> I want to make sure that if a player gets a % modifier to their attack speed or some sort of stat upgrade, that they can get the effects of that change. Taking them from something like a 4s cooldown to a 3.6s cooldown. | |
08:38 | <Kovitikus> Of course, these types of cooldowns aren't critical regarding reloads, so if they are lost then that is OK. | |
08:38 | Griatch | The `delay` helper is a convenient wrapper for calling TaskHandler.add(). I guess what you refer to is that you really want the task_id and not the raw-deferred so you can call TaskHandler.remove(task_id) to stop the task from executing before it has had time to run. |
08:38 | DiscordBot | <Lysaer> Why not have a boost with an expiry? Then check to see if the boost is still active where it's applied? |
08:38 | <Kovitikus> Yes, but I'd also like that to be possible even after the server is reloaded and the delay is recreated. | |
08:39 | <Kovitikus> Because there are times when an automatic message should be sent to the player to let them know it has expired, without them doing anything. @Lysaer | |
08:39 | Griatch | I suppose `delay` could return the task_id if `persistent=True`. |
08:39 | The task_id is just an integer, so that you can store in an Attribute however you like. | |
08:40 | DiscordBot | <Kovitikus> Yeah Griatch, that's what I was thinking already. But of course I was pretty sure we don't get access to the task_id. |
08:40 | <Kovitikus> Yeah I saw that. I like how you just count up from 1 until you find a free task_id. | |
08:40 | <Lysaer> I want to do that for item numbers... | |
08:40 | <Lysaer> Just haven't gotten around to it yet. | |
08:41 | <Kovitikus> It honestly reminds me a lot of how I set up my instance_handler to generate the instance_id, except I use the current obj.dbid_datetime. | |
08:41 | Griatch | Lysaer: You don't want that, trust me. |
08:41 | DiscordBot | <Lysaer> We've spoken about this before. |
08:41 | <Kovitikus> Haha. | |
08:41 | Griatch | We have, and it remains a nonsense argument |
08:42 | DiscordBot | <Lysaer> But I'm from an Avalon/IRE item background at it feels soooooo natural for me. haha |
08:42 | <Kovitikus> So what are we supposed to do with the deferred that is returned by default right now? Is that sufficient to just use the .cancel() and store it in memory, as I do with my AFK timer? | |
08:42 | <Kovitikus> Returned by delay() | |
08:42 | <Lysaer> Good old sword2117. | |
08:43 | <Kovitikus> Until sword2117 is destroyed and 3 weeks later a new object takes its place and the whole game breaks because it still has a reference to 2117 as being the old sword. | |
08:44 | Griatch | @Kovitikus: The deferred is meant to be used in-memory. So you can use it to cancel things but not across a reload. I think it makes sense to have delay return the task_id rather than the deferred if persistent=True. Maybe add a kwarg to delay for doing the removal/stopping too, using that same id. |
08:45 | DiscordBot | <Kovitikus> Here's my question regarding that. Why is .remove() even there if we can't use it? https://github.com/evennia/eve[…]skhandler.py#L155 |
08:45 | <Kovitikus> | |
08:45 | <Lysaer> That wouldn't break the game. It may break a quest if that specific sword was important - but then you wouldn't be able to destroy the sword as it would be protected. | |
08:45 | Griatch | Yeah, it's a bit strange, I agree. :) |
08:45 | DiscordBot | <Kovitikus> LOL |
08:46 | <Kovitikus> Thank god, I thought it was just me not understanding the TaskHandler. | |
08:47 | <Kovitikus> Ok, I'm going to open a feature request for this, because there has been others who have seen the need to stop a delay after a reload. (Especially if something it is supposed to call on gets deleted, like an object.) | |
08:47 | Griatch | I think the TaskHandler.add should return the deferLater, but if persistent=True, it should instead return the task_id. |
08:47 | DiscordBot | <Kovitikus> Ok. |
08:48 | Griatch | It probably was like this, but at some point it got refactored and some functionality was lost. |
08:48 | DiscordBot | <Kovitikus> Owch. |
08:48 | <Kovitikus> I'll open an issue for it. | |
08:50 | Griatch | Thanks |
08:50 | phaethon joined #evennia | |
08:53 | evenniacode | [issues] kovitikus opened issue #2370 in evennia: [Feature Request] TaskHandler should return the task_id if persistent. (<https://github.com/evennia/evennia/issues/2370>) |
08:53 | DiscordBot | <Kovitikus> This will be a great change, because then you can also decide to execute it early as well with do_task(). |
08:54 | <Kovitikus> Is this the sort of change that will go to the develop branch and we gotta wait for 1.0? | |
08:54 | <Kovitikus> I know it's kinda minor, but so was the tags.has() request I made and that was sent to develop as well. | |
08:55 | Griatch | This is sort of a bug so it should probably be back-ported to master. |
08:55 | DiscordBot | <Kovitikus> celebrates |
08:55 | Griatch | Any api changes to utils.delay would happen in develop though |
08:56 | DiscordBot | <Kovitikus> This is a stupidly simple code change isn't it? Just put return task_id and move the return deferLater to an else statement from the if persistent:? |
08:57 | Griatch | Well, deferLater must start in all cases. |
08:57 | DiscordBot | <Kovitikus> I'm not going to attempt to muck with it myself, but I was curious if I have it pinned on how it'd be updated. |
08:57 | <Kovitikus> Oh.. | |
08:58 | <Kovitikus> Yeah whoops. I forgot that the return also CALLS the deferLater. | |
08:58 | Griatch | That's the actual 'delay' in delay after all :) |
08:58 | DiscordBot | <Kovitikus> Haha. |
08:58 | <Kovitikus> Well, we'd just duplicate that under persistent, but not return it, then return the task_id at the end. | |
08:58 | <Kovitikus> | |
08:59 | Griatch | Something like that. I don't recall off hand if the deferred need to retain a reference too, so it's not garbage-collected. Probably not. |
08:59 | DiscordBot | <Kovitikus> The add() method is missing the returns docstring anyhow. |
09:01 | Griatch | Looking at it, I don't think I actually wrote the TaskHandler. :) Not dodging any blame since I must have reviewed the code, but it's not quite my code style. |
09:02 | DiscordBot | <Kovitikus> It did seem a bit different, mostly the docstrings don't seem how you'd format them. |
09:03 | Griatch | Ah well. |
09:04 | DiscordBot | <Kovitikus> The Forking Evennia link here is broken, is that part of what will be fixed in 1.0 doc changes or should I report stuff like this? https://www.evennia.com/docs/l[…]forked-repository |
09:04 | <Kovitikus> It's supposed to lead to https://www.evennia.com/docs/l[…]l#forking-evennia | |
09:06 | Griatch | Report it. Many of these pages are the same (but in different places) for 1.0. |
09:07 | DiscordBot | <Kovitikus> If only I can remember how to update my local Evennia fork... There's a bunch of this stuff I could be submitting fixes for myself, honestly. Especially the typos. |
09:07 | <Kovitikus> git fetch upstream master | |
09:09 | Griatch | Remember to always work in your own branch though, never in your `master` branch. Keep it in sync with upstream and you'll have a lot less problems. |
09:09 | DiscordBot | <Kovitikus> Yeah, I'm just going to have to re-read all of this page haha. |
09:10 | <Kovitikus> Later though, got some AFK stuff to do and then maybe I'll pass out. I'm glad we got to converse about this TaskHandler thing, because it did feel wonky for sure. | |
09:11 | Griatch | But overall, for documentation, it's probably best to submit PRs against develop branch at this point. If done towards master, it's a bit iffy to port that change to develop since everything has moved around. |
09:11 | In lieue of that, reporting errors is good enough. | |
09:11 | DiscordBot | <Kovitikus> Hrmmm... even with the broken link and the typos? |
09:12 | <Kovitikus> Cause who knows when 1.0 will be ready and in the meantime anybody visiting the page won't so easily get to the version control. | |
09:12 | Griatch | Then those things should be updated both in master and develop, is what I'm saying. |
09:12 | DiscordBot | <Kovitikus> Oh, gotcha. |
09:13 | Griatch | And since develop has moved around the develop part can be a little tricky since it's not a 1:1 correlation everywhere. |
09:18 | DiscordBot | <Kovitikus> Griatch you think we should move toward encouraging people to use the GitHub Gists instead of Pastebin? |
09:19 | Griatch | Nah, to each their own |
09:19 | DiscordBot | <Kovitikus> It's far superior in functionality and presentation IMO and it keeps people within the same ecosystem. |
09:19 | <Kovitikus> Yes, but the article says to use Pastebin... and I was just thinking that the documentation might be better off suggesting Gist. | |
09:19 | <Kovitikus> https://i.imgur.com/iIif4SY.png | |
09:20 | Griatch | It's rare to have patches delivered this way, but sure, I guess we could suggest gist. |
09:21 | DiscordBot | <Kovitikus> Oh, haha I didn't even read the actual paragraph, I was just looking at the link. |
09:21 | Griatch | Drawback of Dark mode, you don't actually see the text, only the links ;) |
09:22 | DiscordBot | <Kovitikus> I just don't really trust pastebin, I dunno why. Seems like it's simply a breeding ground for bots and god knows what. If new developers are generally staying within GitHub for opening issues, discussions, etc, then we should probably also keep them directed to something like Gist. |
09:22 | <Kovitikus> lmfao no, more like I'm just scanning the page for broken links, not to read anything ATM. | |
09:22 | <Kovitikus> And my god are there so many broken links. | |
09:23 | <Kovitikus> Like 90% of them. | |
09:23 | Griatch | I never had any issues with pastebin myself. It's a very old service, the first of its kind. |
09:23 | DiscordBot | <Kovitikus> I don't have issues with it persay, but I feel like GitHub is already designed for code and it feels more inline with the way we manage and navigate code regularly with the project to begin with. |
09:24 | Griatch | There are not 90% broken links overall; it happens on some pages where markdown self-reference links are used though. |
09:24 | An artifact of the wiki conversion | |
09:25 | DiscordBot | <Kovitikus> Yeah, that's what I meant. |
09:25 | <Kovitikus> Just on this page there's a lot of the self-references. | |
09:25 | <Kovitikus> this page's 90%* | |
09:26 | Griatch | Overall, the wiki is still around for such things. Which is why I've not spent time to fix the conversion. Actual misinformation is something else of course. |
09:27 | evenniacode | [issues] kovitikus opened issue #2371 in evennia: [Documentation] Broken Links on Contributing Doc (<https://github.com/evennia/evennia/issues/2371>) |
09:27 | DiscordBot | <Kovitikus> Righto chap. |
09:27 | <Kovitikus> I've abandoned using the wiki, cause I like your site better and I've never been keen on the wiki to begin with anyhow. | |
09:28 | Griatch | Me too, I find I search things in the new docs rather than click through to them most of the time. |
09:29 | DiscordBot | <Kovitikus> I noticed. Most of your links are filled to the brim with highlight tags in the url. |
09:29 | <Kovitikus> It's a great search feature, I agree. | |
09:29 | <Kovitikus> I just also like the format and presentation of the new docs site. You did a great job and I'm sure it's only going to get better. | |
09:30 | Griatch | Thanks, it's an ongoing project. :) |
09:31 | DiscordBot | <Kovitikus> Indeed. Alright, AFK. If I get my Evennia fork set up all properly I'll see if I can fix some of these smaller stuff, especially typos. |
09:33 | Griatch | Cool, see you later |
09:34 | DiscordBot | <Kovitikus> @Farî @DaveWithTheNiceHat RE: Persistent Delays https://discord.com/channels/2[…]29271308848070707 The delay() conversation began here in chat history. (Alternative IRC history link https://irclogs.jackgrigg.com/[…]1-04-07#i_4710369) Also, here's the request to update it. https://github.com/evennia/evennia/issues/2370 |
10:10 | evdemo | [Public] Kweeky just connected to the Evennia demo for the first time! |
10:11 | [Public] Kweeky disconnected from the Evennia demo. | |
11:32 | DiscordBot | <Kovitikus> What's this failure thing I got? https://github.com/kovitikus/e[…]ns/runs/725818974 |
11:34 | <Kovitikus> Looks like some sort of Sphinx issue... | |
11:35 | <Kovitikus> All I did was git pull upstream master on my Evennia fork and then git push to send the changes back to my GitHub copy. | |
11:40 | Griatch | The doc building requires extra permissions so that will always fail on a fork. |
11:41 | Possibly one could maybe set it up differently so it's not run on forks, but not sure how github actions does that | |
11:46 | DiscordBot | <Kovitikus> Ok, it's fine as long as it's nothing important or anything I did. |
11:47 | <Kovitikus> It threw me off cause it also sent me an email haha. | |
11:47 | <Kovitikus> R.I.P. inbox. | |
11:51 | evenniacode | [forum] Griatch created 'The Six Cultures of play (link to blog)' in General Discussion (<https://github.com/evennia/eve[…]/discussions/2372>) |
12:58 | evdemo | [Public] guester just connected to the Evennia demo for the first time! |
13:02 | [Public] guester disconnected from the Evennia demo. | |
13:12 | evenniacode | [issue comment] davewiththenicehat commented on issue #2370 ([Feature Request] TaskHandler should return the task_id if p[...]) in evennia: For reference:\Branch off of develop, but merge back into ma[919 more] (<https://github.com/evennia/eve[…]comment-814903421>) |
13:39 | [issue comment] kovitikus commented on issue #2370 ([Feature Request] TaskHandler should return the task_id if p[...]) in evennia: Yeah, I was a bit confused on the develop and master branch[470 more] (<https://github.com/evennia/eve[…]comment-814922326>) | |
14:12 | [issue comment] Griatch commented on issue #2370 ([Feature Request] TaskHandler should return the task_id if p[...]) in evennia: > Yes, I think this will break some folks code who are curre[926 more] (<https://github.com/evennia/eve[…]comment-814948489>) | |
14:41 | [forum] Griatch commented on 'GLOBAL_SCRIPTS Attribute Assignment': We could certainly add support for all the script-creation k[...] (<https://github.com/evennia/eve[…]ioncomment-580232>) | |
14:55 | evdemo | [Public] clp just connected to the Evennia demo for the first time! |
14:58 | Griatch | Hi there clp |
15:01 | evdemo | [Public] clp disconnected from the Evennia demo. |
15:24 | evenniacode | [issues] kovitikus opened issue #2373 in evennia: [Feature Request] GLOBAL_SCRIPTS support for all creation kwargs. (<https://github.com/evennia/evennia/issues/2373>) |
15:35 | rogersm joined #evennia | |
15:37 | evenniacode | [forum] alephate commented on 'The Six Cultures of play (link to blog)': That was pretty interesting to read. I think I'm mostly in t[403 more] (<https://github.com/evennia/eve[…]ioncomment-580500>) |
15:52 | [forum] fariparedes commented on 'The Six Cultures of play (link to blog)': I've dipped my feet in both trad and OSR and enjoyed them. I[215 more] (<https://github.com/evennia/eve[…]ioncomment-580572>) | |
15:55 | [forum] Griatch commented on 'The Six Cultures of play (link to blog)': I honestly think bleed in the sense that the Nordic-LARP guy[290 more] (<https://github.com/evennia/eve[…]ioncomment-580610>) | |
15:57 | [forum] Griatch commented on 'The Six Cultures of play (link to blog)': Most 'rules lite' games I know fall under 'story games' acco[180 more] (<https://github.com/evennia/eve[…]ioncomment-580627>) | |
19:17 | DiscordBot | <Natalie> Is there somewhere I can view a tutorial about creating a new admin page thing? (There's Accounts, Objects, Scripts etc. I'm wanting to add another type so I can review my player reports online through my web admin.) |
19:47 | rogersm joined #evennia | |
20:09 | DiscordBot | <Natalie> Anyone available to give me advice on a specific but simple design choice? |
20:10 | <Natalie> I will leave it here for advice | |
20:11 | <Natalie> I am working on my quest log, and making it show current progress on a quest. | |
20:11 | <Natalie> One quest type is a turnin quest, very common type of quest in games. So if you are required to give Bob 2 red apples | |
20:11 | <Natalie> It will show | |
20:11 | <Natalie> 0/2 red apple turned in. or 1/2 red apple turned in. etc. | |
20:12 | <Natalie> If you have not turned in enough the numbers and turned in parts will be colored maroon, if you are 2/2 etc, it will turn green. | |
20:12 | <Natalie> Now the question. Is there a good way to display if you HAVE enough on you to turn in? | |
20:13 | <Natalie> 0/2 red apple turned in. (2 owned.) Or something? | |
20:13 | <Natalie> Feedback would be wonderful. | |
20:20 | <alkaid> I think the parens are probably the easiest way to represent that. You might want a third color picked (muted yellow or something) that a task will switch to when you have all the requirements but haven't turned them in for extra reinforcement. | |
20:24 | <Natalie> I was thinking of that third color as well yes | |
20:24 | <alkaid> Alternatively, I've seen some quests in games that give the feedback at each step (or the final step) as you pick up the needed items. So depending on how verbose you want to be you could echo the player with "you have all the apples you need for <Mob>" or even "you need # items still" on pickup. | |
20:24 | <Natalie> Displaying that you indeed have the number you need to turn in in an intuitive way has been what I've been trying to figure out | |
20:25 | <Natalie> Mhm. I was not planning realtime feedback on quest progress, I had thought about it before, but decided against it for immersion | |
20:27 | <Tehom> @Natalie - There's an immense amount of documentation about the admin site because it's one of the django web framework's best selling points. Here's the official docs: https://docs.djangoproject.com[…]ef/contrib/admin/ | |
20:28 | <Tehom> There's tons of stuff out there though, like entire reskins of it | |
20:28 | <Natalie> I figured out how to reskin the front end, but none of the sub pages inherit it for some reason | |
20:28 | <Tehom> For example: https://djangopackages.org/gri[…]/admin-interface/ | |
20:29 | <Natalie> And I was hoping for an evennia specific tutorial on how to add more pages, since something complicated like django I need to be walked through, and don't want to really learn the whole thing when I only intend to extend it by adding one or two pages | |
20:29 | <Natalie> well I changed the theme | |
20:29 | <Natalie> https://cdn.discordapp.com/att[…]13184/unknown.png | |
20:29 | <Natalie> But like I said, as soon as I click somewhere there | |
20:30 | <Farî> I also set up a dark theme first thing when I installed Evennia, lol | |
20:30 | <Natalie> https://cdn.discordapp.com/att[…]10791/unknown.png | |
20:30 | <Natalie> It doesn't stick to any of those pages | |
20:30 | <Tehom> In general, you can change stuff by overriding templates, which you can place in the template_overrides directory that Evennia gives you. For individual list and change pages, you can set those up too. You can also make your own links to things in the same way you'd add any other page on the site, which I think Evennia does have a few tutorials for | |
20:31 | <Tehom> but the tldr is you create a view, a template, and change urls.py to have a route that points to that view which renders the template | |
20:31 | <Tehom> That's the scripts list page, which you'd need to override individually | |
20:32 | <Natalie> Any idea how to apply my CSS to the admin pages? (On the front pages all I had to do was drop in new CSS files into \web\static_overrides\website\css) | |
20:32 | <Natalie> For that dark theme | |
20:32 | <Natalie> But I'd really like it to apply to the admin pages, just never figured out how | |
20:32 | <Tehom> I forget if the admin classes add a way for you to add css classes without overriding the templates. Let me check | |
20:34 | <Tehom> This might be the best solution: https://stackoverflow.com/a/48526125 | |
20:34 | <Tehom> There's a base_site.html template for admin that you can override | |
20:34 | <Tehom> And then add more css styles to that | |
20:37 | <Natalie> Hmm. I think I looked at that before and couldn't figure it out. | |
20:37 | <Natalie> Couldn't find any references in my sites to anything admin related | |
20:38 | <Tehom> The way django templates work is that it'll search through different directories for matches, and then use the first one it finds | |
20:38 | <Tehom> So to override admin, you'd make an 'admin' directory in template_overrides, and then create the html file by name it's looking for | |
20:39 | <Tehom> If it finds yours, then it'll use that | |
20:39 | <Natalie> Any idea where to find the original so I can modify that one and see if it works? (I assume I need an evennia reload to see if anything changes when I try it?) | |
20:40 | <Tehom> I think you'd find the original in the django source code in your virtual environment, otherwise you could look at django's source code on github | |
20:40 | <Tehom> with an IDE like pycharm you can normally do a search for it and it'll look through your venv files as well | |
20:41 | <Natalie> Oh. So something simple like changing CSS is a big involved process in django? lol | |
20:41 | <Natalie> >:[ | |
20:41 | <Tehom> In django admin it is, unfortunately, since it's not designed to be user-facing | |
20:42 | <Tehom> Changing css in your own pages is going to be assumed to have your own templates, or you're using a custom frontend with its own build process and just communicating with the back end via a REST API, like the django web framework | |
20:43 | <Natalie> There aren't even any HTML files in my django site-packages stuff | |
20:43 | <Natalie> Oh wait... | |
20:44 | <Natalie> Hmm. | |
20:46 | <Natalie> template_overrides/admin/ | |
20:46 | <Natalie> or | |
20:46 | <Natalie> template_overrides/website/admin/ | |
20:49 | <Tehom> just admin, I think | |
20:49 | <Tehom> evennia has a 'website' app, so the website/ folder corresponds to that, I think | |
20:51 | <Tehom> if I recall you have to do some annoying thing in any app with its templates folder of having a subfolder of the app name again. so you wind up with my_app/templates/my_app/template.html | |
20:55 | <Tehom> https://github.com/django/djan[…]n/templates/admin is the base templates for admin | |
20:56 | <Natalie> cackles | |
20:56 | <Tehom> In their base.html they have a {% block extrastyle %}{% endblock %} line, which is intended to be something you override in child templates to add extra css | |
20:56 | <Natalie> Something broke terribly. | |
20:56 | <Natalie> But something changed at least | |
20:56 | <Tehom> So it's kind of a convoluted process but they do try to support it | |
20:56 | <Tehom> progress! | |
20:57 | evenniacode | [fork] davewiththenicehat forked evennia <https://github.com/davewiththenicehat/evennia> |
20:58 | DiscordBot | <Natalie> https://cdn.discordapp.com/att[…]66590/unknown.png |
20:58 | <Natalie> it looks like it took some of the CSS | |
20:59 | <Tehom> Probably combining rules? I imagine @Farî would be infinitely better at debugging this sort of thing than me | |
20:59 | <Farî> You flatter me | |
20:59 | <Tehom> Look I know enough to know I suck at CSS and shouldn't be let anywhere near the frontend | |
21:01 | <Farî> I'll ping you when I have some free time if you haven't figured it out yourself by that point | |
21:01 | <Natalie> It could just be that the theme I'm using doesn't apply to those kind of elements | |
21:02 | <Natalie> I'm just using a | |
21:02 | <Natalie> bootstrap.min.css from https://bootswatch.com | |
21:17 | <Natalie> Making progress | |
21:17 | <Natalie> just overriding all the default CSS >_> | |
21:44 | evdemo | [Public] pepe just connected to the Evennia demo for the first time! |
21:50 | [Public] pepe disconnected from the Evennia demo. | |
22:00 | DiscordBot | <Natalie> Fuck it, good enough. |
22:00 | <Natalie> https://cdn.discordapp.com/att[…]49182/unknown.png | |
22:00 | <Natalie> https://cdn.discordapp.com/att[…]76552/unknown.png | |
22:00 | <Natalie> lol | |
22:08 | <Tehom> nice! | |
22:09 | evenniacode | [pull request] davewiththenicehat opened PR #2374 (TaskHandler returns the task_id if persistent) to evennia/master <https://github.com/evennia/evennia/pull/2374> |
22:12 | [issue comment] davewiththenicehat commented on issue #2370 ([Feature Request] TaskHandler should return the task_id if p[...]) in evennia: I've got to be misunderstanding if you think this would requ[105 more] (<https://github.com/evennia/eve[…]comment-815296406>) | |
23:58 | [issue comment] kovitikus commented on issue #2370 ([Feature Request] TaskHandler should return the task_id if p[...]) in evennia: > Running a persistent delay with the expectation of also be[1309 more] (<https://github.com/evennia/eve[…]comment-815346080>) |