Author Topic: Dynamic PC Rumor Generation  (Read 579 times)

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Dynamic PC Rumor Generation
« Reply #15 on: November 08, 2011, 02:54:28 pm »


               Hmm,  I dont have a lot of time right now.  

Lets see if this helps.  

bit positions are 0 based.   So
1<<0 = 1  or a test for bit position 0.  

if (1<< 0 & nRumor)  //would check to see if the 0 bit was set in nRumor.
if (1<< 1 & nRumor)  // would check to see if the bit in position 1 was set or not  

nRumor= nRumor  ^ 1 << 0;  //( '^'  is an Exclusive or. )  would toggle the state of bit positon 0;  
nRumor= nRumor  ^ 1 << 1;  //would toggle the state of bit positon 1;

nRumor = nRumor | 1<<0;  //would set bit posistion 0 to 1; reguardless of wether it was set yet or not.
nRumor = nRumor | 1<<1;  //would set bit posistion 1 to 1;

To unset a bit you take the logical bitwize NOT  of the number and do a logical AND

nRumor =    ~(1<< 1) &  nRumor ;   // ('~' is a bitwize logical NOT) would unset bit posistion 1;
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Dynamic PC Rumor Generation
« Reply #16 on: November 08, 2011, 09:54:18 pm »


               I know I posted my flags include on the boards here some where.   The heck if I can fing them though.  

since I cant find a link I just posted it to pastebin.   perhaps I wont lose them again this way.  

Ok rant done.   See if this library helps you at all.   RR_I0_flags

If you are still having problems please post back and let me know.
               
               

               
            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
Dynamic PC Rumor Generation
« Reply #17 on: November 12, 2011, 07:32:43 pm »


                 Okay, thanks to Lightfoot8's help the bitwise comparison seems to be working properly now.

  The newest version of it has a constant flag for "misheard" rumours, as well as the chance of a rumour being repeated incorrectly.
  This change affects only how the rumour is said, not the stored rumour itself, at the moment.  I could probably add another flag with a check to see if a sufficient number of NPCs are around to hear a misrepeated rumour to justify the stored one being changed.

  A simple mechanism for deliberately storing false rumours has also been added, that doesn't require a target object to be entered.

  As before, the download link for it is in the first post.
               
               

               
            

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0
Dynamic PC Rumor Generation
« Reply #18 on: November 12, 2011, 08:06:52 pm »


               <muses...>

A thought on that, if a sufficient number of NPC hear the misspoke rumor, generate a *new*, false rumor, but leave the original in place so there are competing variations...

<...that his muse is prominent in her absence>
               
               

               
            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
Dynamic PC Rumor Generation
« Reply #19 on: November 13, 2011, 04:55:26 am »


               

Rolo Kipp wrote...

<muses...>

A thought on that, if a sufficient number of NPC hear the misspoke rumor, generate a *new*, false rumor, but leave the original in place so there are competing variations...

<...that his muse is prominent in her absence>


Done.

  The weight of the new false rumour is the average of a DC 15 persuade roll and the speakers CR, plus the number of NPCs (of 8 and over int) there to hear it above the initial 5 needed before it will store it.

  With an unconvincing speaker the weight will likely be too low to be able to overwrite any existing rumours, but if that reknowned travelling minstrel happened to get it wrong, that might be a rumour that the PC can never shake.


  I also found a bug in the version I'd put up this morning while adding that.  I'd made the false rumour part a void function, when it should have been returning a string.
               
               

               
            

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0
Dynamic PC Rumor Generation
« Reply #20 on: November 13, 2011, 06:16:04 pm »


               <chattering...>

Failed.Bard wrote...
...
  With an unconvincing speaker the weight will likely be too low to be able to overwrite any existing rumours, but if that reknowned travelling minstrel happened to get it wrong, that might be a rumour that the PC can never shake.

Just the kind of behavior I was thinking of. Thank you, FB. :-)

<...like a schoolboy>
               
               

               
            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
Dynamic PC Rumor Generation
« Reply #21 on: June 10, 2012, 04:19:29 pm »


                 I've kept working at this off and on in my little mod, mainly in tailoring it specifically for that, but this week-end I started into an accents add on for it.  Using the FindSubString routine I only found out the varied uses for recently (for the Hex String to Int converter), and a simple letter/letter grouping replacement system.

  So far I've just been playing around with simple accents (replace "simple" with cliched there, really) for it, and accents that I've used for characters I've played/DM'd.


  Here's a few examples of the variety achieved so far, pulled directly from the logs.  NPC name has been replaced with accent name.  I'm not happy with the prevalence of "offed" instead of "killed", it's supposed to be the lowest level of reply, for below average to average (10) intelligence, but is the most common.

  The only thing actually stored here as a string is the name of the creature killed, zombies of various sorts in these cases, since they're the most prevalent enemy in my mod.

// The only thing scarier than a bear in the woods?  A Zombie bear in the woods.
[French/HM] You're Zherese Davis, right?  You offed a monstrous zombie grizzly?
[French/HM] Aren't you zhe one zhat offed one of zhose large zombie brown bears?

// The same orc rumour in two different accents.

[French/HM]Is it true you offed one of zhose brutish zombie orcs?
[French/HM] Aren't you zhe one zhat offed zhat brutish zombie orc?
[Simple] Hey, Therese Davis.  I heard'ja killed that brutish zombie orc.

// Same dwarven accent, same rumour, different random part components.
[Dwarf] Hey, Derese Davis.  I heard you offed dat huge zombie bulette.
[Dwarf] You're de one dat killed dat huge zombie bulette?
[Dwarf] Is it true you offed one of dose huge zombie bulettes?
[Dwarf] I keep hearing how you offed a huge zombie bulette.

[Dwarf] Aren't you de one dat killed dat unholy stone giant?


  Any ideas for accents that could be pulled off under this system?

  To give an idea how it works, here's the "French" accent routine.

//// If bioware can use french accents in the expansions, I don't see why I shouldn't slap in
//// a cheesy french accent.
//// For Ravenloft - High Mordentish
string FB_AccentFrench (string sString)
{
string sFind, sReplace;
int nLength, nReplaceStart, nCaseSensative, nCount;

while (sFind != "DONE")
   {
    switch (nCount ++)
       {
  case 0: sFind = "me"; sReplace = "oi";
                       nLength = 2; nReplaceStart = 1; nCaseSensative = FALSE; break;
 case 1: sFind = "Yes"; sReplace = "Oui";
                       nLength = 3; nReplaceStart = 0; nCaseSensative = TRUE; break;
 case 2: sFind = "yes"; sReplace = "oui";
                       nLength = 3; nReplaceStart = 0; nCaseSensative = TRUE; break;
 case 3: sFind = "No"; sReplace = "on";
                       nLength = 2; nReplaceStart = 1; nCaseSensative = FALSE; break;
 case 4: sFind = "Th"; sReplace = "Zh";
                       nLength = 2; nReplaceStart = 0; nCaseSensative = TRUE; break;
 case 5: sFind = " th"; sReplace = " zh";
                       nLength = 3; nReplaceStart = 0; nCaseSensative = TRUE; break;
 case 6: sFind = "H"; sReplace = "'";
                       nLength = 1; nReplaceStart = 0; nCaseSensative = TRUE; break;
 case 7: sFind = " h"; sReplace = "'";
                       nLength = 2; nReplaceStart = 1; nCaseSensative = TRUE; break;
 case 8: sFind = "th"; sReplace = "'";
                       nLength = 2; nReplaceStart = 1; nCaseSensative = TRUE; break;
 case 9: sFind = "I "; sReplace = "Ah";
                       nLength = 1; nReplaceStart = 0; nCaseSensative = TRUE; break;
 default: sFind = "DONE"; break;
 }
 sString = FB_FindAndReplaceSubString (sString, sFind, nLength, sReplace, nReplaceStart, nCaseSensative);
   }
return sString;
}

sFind is self explanatory, as is sReplace.

nLength is how many characters to skip when replacing.  This is usually the length of sFind.

nReplaceStart is used if you're keeping certain characters from the original.  Useful here to allow "No" and "no" to become "Non" and "non" off a single check, by leaving the original "n".

 nCaseSensative is used largely when nReplaceStart > 0, for the use mentioned above.


  Since I'm not sure how processor intensive FindSubString is, I'll be keeping all the accents under 20 replacements max, and preferably under 10, but other than that I'll put in any that people can suggest.

  All I would need is an accent "name" to give it, and what to change.  Adding one only takes about five minutes, so it's easy on my end to put more in before I package it up again into an erf.
               
               

               


                     Modifié par Failed.Bard, 10 juin 2012 - 03:21 .
                     
                  


            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
Dynamic PC Rumor Generation
« Reply #22 on: June 10, 2012, 11:27:31 pm »


               Here's  (or here if the project DL isn't working) a very simplified demo module of the current system, set to run off a database item at the moment.  It can use a NWNX database, the vanilla bioware DB, a database item, or local variables on the PC.
 The last is really only good for testing, even the database item is really only useful with server vault characters. 

  There are 4 rats in the area, 1 HP each, with an artificially boosted CR to try and ensure a rumour is stored.  Once those are killed, simply walk in and out of the NPCs field of view to see their responses.

  There are no hooks into the player death event in the demo mod.  There are comments at the end of the rumor include on how to do that, as well as the script snippets needed for the various events.
               
               

               


                     Modifié par Failed.Bard, 11 juin 2012 - 07:29 .
                     
                  


            

Legacy_QlippothVI

  • Full Member
  • ***
  • Posts: 197
  • Karma: +0/-0
Dynamic PC Rumor Generation
« Reply #23 on: June 11, 2012, 05:28:26 pm »


                "403 Forbidden"... ':crying:'
               
               

               
            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
Dynamic PC Rumor Generation
« Reply #24 on: June 11, 2012, 05:33:58 pm »


               Oops.  Should be fixed now, hopefully.  I'm still not used to the projects DL set up.
               
               

               
            

Legacy_acomputerdood

  • Sr. Member
  • ****
  • Posts: 378
  • Karma: +0/-0
Dynamic PC Rumor Generation
« Reply #25 on: June 12, 2012, 02:25:38 pm »


               this reminded me of one of my previous nwvault submissions for a hobo/storyteller to tell stories pulled from a mysql/nwnx database:

http://nwvault.ign.c....Detail&id=3837

most everything in it has already been covered in the thread, so the only thing i'm adding to the conversation is a .cgi form to allow admins to dynamically enter rumors into the DB from the web.
               
               

               
            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0
Dynamic PC Rumor Generation
« Reply #26 on: June 12, 2012, 03:39:01 pm »


               Your web-to-game work is really, really cool.  I have these fantasies of one day writing up a tutorial so newbs can easily install WAMP or something similar and drop in these cool little pieces so their players can help fashion the world.  I got my start on MUDs and LPMUDs, and one of the things I loved the most was being able to participate in building the game world.
               
               

               


                     Modifié par OldTimeRadio, 12 juin 2012 - 02:39 .
                     
                  


            

Legacy_QlippothVI

  • Full Member
  • ***
  • Posts: 197
  • Karma: +0/-0
Dynamic PC Rumor Generation
« Reply #27 on: June 14, 2012, 01:46:16 am »


               Double post, darn AT&T network
               
               

               


                     Modifié par QlippothVI, 14 juin 2012 - 12:50 .
                     
                  


            

Legacy_QlippothVI

  • Full Member
  • ***
  • Posts: 197
  • Karma: +0/-0
Dynamic PC Rumor Generation
« Reply #28 on: June 14, 2012, 01:47:36 am »


               I was talking to someone last year about how it would be nice to release a turnkey NWNX/WAMP installer. Maybe with some default settings for easy use. Of courseIi wasnt the one with the skills.

There is also that DB system someone did with a windows client for editing things in the DB.

I was Playing with Universe of Arlandia a while back, amazing tech with a randomly generated world, with new worlds added procedurally as you finally got offworld. It should still be available on the web somewhere. I also have a copy, as well. No story, but a world(s) exploration and dominating sandbox
Ran it on a XP VM with WAMP.

- Qlippoth
               
               

               
            

Legacy_QlippothVI

  • Full Member
  • ***
  • Posts: 197
  • Karma: +0/-0
Dynamic PC Rumor Generation
« Reply #29 on: June 15, 2012, 07:38:48 am »


               Wait, what was the UOA thread mentioned at the beginning of this one?

Also, Universe of Arlandia post a year ago by TheRack: 
http://social.biowar...-4866770-1.html 

 - Qlippoth
               
               

               


                     Modifié par QlippothVI, 15 juin 2012 - 06:42 .