How to store, filter and edit my data? (GuideMe)

Webteases are great, but what if you're in the mood for a slightly more immersive experience? Chat about Tease AI and other offline tease software.

Moderator: 1885

Post Reply
User avatar
Pseudonym
Explorer At Heart
Explorer At Heart
Posts: 376
Joined: Sat Sep 22, 2012 12:03 pm

How to store, filter and edit my data? (GuideMe)

Post by Pseudonym »

Hey,
I'm working on tease for GuideMe with proceduraly generated taunts. I should also say that I'm relatively new to coding.

I have started with editing my object with taunts and their conditions in my text editor, but soon realized that it's becoming too big to navigate and manage.

I've decided to try to store my data in excel and converting it to JSON.
It looks something like this:
Image
You can see the conditions in the first column, then there are weights and in the last column are arrays of possible taunts.

It seemed great at first. Now I could filter based on variables used in my conditions which is extremely useful since there are so many of them and so many combinations.

The problem is that I have to have all the taunts in one cell and excel can't highlight searched words inside a cell. These two things really complicate working on these taunts and are making this approach useless.



Is there a better way to store this kind of data? I've tried to search for different options and tools, but haven't found anything useful.
Should I go back to just editing the data in my text editor?

I hope I was able to explain my problem in a comprehensive way. I would be glad for any tips you can give me.
My Discord server: https://discord.gg/tbQxJ22
My latest release: Cock Hero - Replay viewtopic.php?t=24640
All my work so far: https://mega.nz/folder/sdcHmQzT#PZ4ctIZsoGp4N7zuDmIh_Q
undeniable_denial
Explorer At Heart
Explorer At Heart
Posts: 109
Joined: Sat Aug 24, 2019 11:42 am
Gender: Male
Location: Germany

Re: How to store, filter and edit my data? (GuideMe)

Post by undeniable_denial »

What an πšŽπš—πšπš’πšŒπš’πš—πš pair of πšŸπš˜πš•πšžπš™πšπšžπš˜πšžπšœβ€ƒπš–πš˜πšœπššπšžπš’πšπš˜ πš‹πš’πšπšŽπšœ she has.
:whistle:

I get what you're doing (and: holy shit), but I'm not sure what the issue is.
Excel can't highlight search results within cells? That's crazy, I didn't know that, but why does it matter?

I don't think it's a good idea to have several taunts combined in a single cell. Why do you say you have to do that? Spreadsheets have one value per cell, that's their nature. You're trying to force a tree structure (JSON) into it.
It would make more sense to unwrap them into their own rows with identical conditions. Filtering will still work and presumably Excel can at least highlight the correct taunt for you.

I'm concerned about your conditions, also. You're storing logical statements as strings, which means you rely on arbitrary text to be executed as code. That's ... well... It's probably fine in this case.
Still, I would suggest to use columns such as "TeasingWith" and "Breasts" and use cell-values like "panties" and "true". Then just assume all conditions are linked with an AND-operator.
If you need an OR, you just duplicate it for all other options.

Excel just isn't JSON. In my opinion you have to work with Excel the way it's designed to be used. Then treat the conversion to JSON as a seperate problem.

That would be my advice. Hope it's somehow useful.


EDIT: There is also jsoneditoronline.org . Its neat, but I can't tell if it has everything you need.
User avatar
Pseudonym
Explorer At Heart
Explorer At Heart
Posts: 376
Joined: Sat Sep 22, 2012 12:03 pm

Re: How to store, filter and edit my data? (GuideMe)

Post by Pseudonym »

Thanks for your response undeniable_denial.
undeniable_denial wrote: Wed Jul 08, 2020 12:12 pm I don't think it's a good idea to have several taunts combined in a single cell. Why do you say you have to do that? Spreadsheets have one value per cell, that's their nature. You're trying to force a tree structure (JSON) into it.
Exactly, Excel doesn't seem to be the way to go and I'm not using it right.
undeniable_denial wrote: Wed Jul 08, 2020 12:12 pm I'm concerned about your conditions, also. You're storing logical statements as strings, which means you rely on arbitrary text to be executed as code. That's ... well... It's probably fine in this case.
I'm not using eval() if that's the worry.

Infact my conditions are not stored as strings but as "pure" boleans (If that's the right way to call it).
It works because I'm reloading the whole object each time I use it and in a place that has acces to all the variables.
If I understand it correctly, the conditions get resolved right away and I get simple true/false.
Whether it's a good idea - I'm not sure. As I said, I'm kind of new to coding and I'm trying to learn on the way.
But it seems to be working very well so far.
undeniable_denial wrote: Wed Jul 08, 2020 12:12 pm Still, I would suggest to use columns such as "TeasingWith" and "Breasts" and use cell-values like "panties" and "true". Then just assume all conditions are linked with an AND-operator.
If you need an OR, you just duplicate it for all other options.
I've actually tried the solution you are proposing, but it quickly became too cumbersome since some of the conditons are more complex.

Anyway, I thought about it and realized that writing down the data in text editor isn't such a problem. The problem is management and understanding.
So I decided to go back to writing it in Atom, but I'll also create separate Excel file where I will just keep track of my conditions and used variables this time. Sort of like a visual map of all the combinations that can be filtered and that will help me with orienting myself and understanding what's going on, what I already have and what is missing.

Again, thank you.
My Discord server: https://discord.gg/tbQxJ22
My latest release: Cock Hero - Replay viewtopic.php?t=24640
All my work so far: https://mega.nz/folder/sdcHmQzT#PZ4ctIZsoGp4N7zuDmIh_Q
User avatar
Lucifie
Explorer
Explorer
Posts: 68
Joined: Thu Nov 15, 2018 5:17 pm
Gender: Male
Sexual Orientation: Straight

Re: How to store, filter and edit my data? (GuideMe)

Post by Lucifie »

Have you ever tried to use VBA? You could just enter your search word in a cell or a input box and then use VBA to analyse the cell values in your E column and format the texts that matches your searchword in red for example.

Excel itself is sometimes limited but with VBA you can do a lot of stuff that is not supported initially.
You can even create or format an excel file completely by code.

Another idea:
Write your single comment array lines in a separate table and let this formula combine them for your main table.
=TEXTJOIN(CHAR(10),TRUE,MyTextRange)
Then you can search in your other table as every line is separated.
CHAR(10) is line break. MyTextRange is your range with all text options.

Excel is powerfull if you know how to use it ;)
User avatar
bobhill
Explorer At Heart
Explorer At Heart
Posts: 164
Joined: Tue Mar 15, 2016 8:49 pm
Gender: Male
Sexual Orientation: Straight
I am a: None of the above

Re: How to store, filter and edit my data? (GuideMe)

Post by bobhill »

Pseudonym wrote: Tue Jul 07, 2020 11:02 am Hey,
I'm working on tease for GuideMe with proceduraly generated taunts. I should also say that I'm relatively new to coding.

I have started with editing my object with taunts and their conditions in my text editor, but soon realized that it's becoming too big to navigate and manage.

I've decided to try to store my data in excel and converting it to JSON.
It seems that you are using Excel to organize your data, which is fine. Are you then trying to convert it in GM to actual data? I think what you need to be doing is creating JavaScript arrays in js files manually once you get your taunts in final form. So with your examples, you would create separate arrays like vPantiesTaunts, vAssTaunts, etc. You would have separate code to test the conditions and to randomly select a taunt from the appropriate array.

Like this:

Code: Select all

    
    function fInitiatePantiesArray() {
		var vPantiesArray = [
			{ 
				Text:		"Taunt 1",
				Used:		false,
			},
			{ 
				Text:		"Taunt 2",
				Used:		false,
			},
			{ 
				Text:		"Taunt 3",
				Used:		false,
			},
		]
		scriptVars.put("vPantiesArray",vPantiesArray);
	}			
Or you could have the taunts in text files that are read into arrays, it's an additional step of coding, but not very difficult. I would suggest looking at global.js from d3vi0n's Pilgrim Quest if you want to do this, as he has some great file functions already created.

Here's an example:

Code: Select all

	
	function fGetLinesFromFile(vFile, vFolder) {	
		if (comonFunctions.directoryExists(vFolder) == false) { fError(vFolder + " doesn't exist (fGetLinesFromFile)"); }
		if (comonFunctions.fileExists(vFolder + "\\" + vFile) == false) { fError(vFolder + "\\" + vFile + " doesn't exist (fGetLinesFromFile)"); }
		var vPath = vFolder + "\\" + vFile;
		var vTextfile = comonFunctions.jsReadFile(vPath); 
		var vLines = [];
		if (vTextfile.length > 0) {	
			vLines = vTextfile.split(/\r\n|\n/);
			return vLines; 
		} else { fError("ERROR READING: " + vFolder + "\\" + vFile + " (fGetLinesFromFile)"); }
	}
I really enjoyed Ravelli's Corruption, so helpfully this helps you on your new project!
User avatar
Pseudonym
Explorer At Heart
Explorer At Heart
Posts: 376
Joined: Sat Sep 22, 2012 12:03 pm

Re: How to store, filter and edit my data? (GuideMe)

Post by Pseudonym »

Thanks VoIDoo and bobhill!
I'll look into these options.
My Discord server: https://discord.gg/tbQxJ22
My latest release: Cock Hero - Replay viewtopic.php?t=24640
All my work so far: https://mega.nz/folder/sdcHmQzT#PZ4ctIZsoGp4N7zuDmIh_Q
Post Reply