Pink Petal Games

Game Editing And Additions => User Mods => Topic started by: sgb on May 12, 2010, 07:19:43 PM

Title: Sample script to add to girl files.
Post by: sgb on May 12, 2010, 07:19:43 PM
Nobody's braved the script editor packed with the game, but I've found it's not all that painful to use.  It order to start to encourage others to add a little more personalization to the girls, I've made a simplified example script for the Alena character that comes with the game.  There's no epic dialogue here, instead to purpose here so that players can actually tell who they're meeting on walks before they agree to take them or not.  The player is given a description, a rough estimate of her starting looks, a rough estimate of how high her starting rebelliousness will be, and an estimate of her combat skills before they decide to take her or not.  For the lazy, you can make a copy of this and simply edit a couple sentences for any of your characters, or add more dialogue for the adventurous.
Title: Re: Sample script to add to girl files.
Post by: RZ on May 12, 2010, 09:59:17 PM
Just a few questions about how scripts works:
1. After make a scripts in the script editor, we have to make the condition in XML file right?
2. Where do you put the scripts?
3. Do i have to start a new game after installing new scipts?

Well, I think it will be handy if someone make a beginner tutorials to use the script editor and stickied it here to make peoples who is unfamiliar with scripting learn it easier and in turn contribute more to the game..
Title: Re: Sample script to add to girl files.
Post by: sgb on May 15, 2010, 02:35:02 PM
1 and 2: You have to put the meetgirl.script and triggers.xml in each girl folder you want it to work for.  Triggers.xml should not be modified, but obviously you will want to personalize each meetgirl script.

3: No, it checks for the Triggers.xml when needed during the game.
Title: Re: Sample script to add to girl files.
Post by: fires_flair on May 15, 2010, 10:44:38 PM
ok, so I poked my head into the editor...and while it basically made sense (and more so when I checked you script sgb) i'm not quite sure how to make it work for a different condition (like if the girl has pc love equal to/over ___ this event happens) any advice?
and will this work on random girls too, and to ask a question that is probably silly, where do we get the trigger.xml file?
Title: Re: Sample script to add to girl files.
Post by: Dagoth on May 15, 2010, 11:43:38 PM
ok, so I poked my head into the editor...and while it basically made sense (and more so when I checked you script sgb) i'm not quite sure how to make it work for a different condition (like if the girl has pc love equal to/over ___ this event happens) any advice?
For PCLove, you're looking for IfStat down in the Actions list. The PCLove stat is stored among the girl stats.

and will this work on random girls too
It should, but I don't think anyone has tested it recently.

where do we get the trigger.xml file?
You can copy and modify the one sgb provided for Alena in the first post, or use the one which comes with Cammy in the core game.


Actually, let me provide a brief rundown of what can be set for triggers in the girl's triggers.xml file, gleaned from looking in the code.

Trigger "Type":
"Random"  // May trigger each week
"Shopping"  // May trigger when shopping
"Skill"  // May trigger when a skill is greater or equal to a value; requires additional "Skill" value (see below) and "Threshold" value set
"Stat"  // same as skill; ; requires additional "Stat" value (see below) and "Threshold" value set
"Status"  // has a particular status, ie slave, pregnant etc; requires additional "Status" value and "Has" value ("true" or "false") set
"Money"  // same as skill or stat levels; requires additional "Who" value ("Player" or "Girl") and "Comparison" value ("MoreThan" or "LessThan") and "Threshold" value set
"Meet"  // Triggers when meeting girl; requires additional "Where" value ("Town", "Dungeon", "Catacombs", "Brothel", "SlaveMarket") set
"Talk"  // triggered when talking to girl in dungeon on details screen
"WeeksPast"  // certain number of weeks pass while girl is in employment; requires additional "Threshold" value set
"GlobalFlag"  // triggered when a global flag is set; requires additional "Flag" value ("NoPay", "GirlDies", "CustomerDies", "GamblingCheat", "RivalLose") set
"ScriptRun"  // triggered when a specifed script has been run
"Kidnapped"  // triggers when a girl is kidnapped
"PlayerMoney"  // triggers when players money hits a value

Skills:
"Anal"
"Magic"
"BDSM"
"NormalSex"
"Beastiality"
"Group"
"Lesbian"
"Service"
"Strip"
"Combat"

Stats:
"Charisma"
"Happiness"
"Libido"
"Constitution"
"Intelligence"
"Confidence"
"Mana"
"Agility"
"Fame"
"Level"
"AskPrice"
"House"  // House percentage
"Exp"
"Age"
"Obedience"
"Spirit"
"Beauty"
"Tiredness"
"Health"
"PCFear"
"PCLove"
"PCHate"

You can optionally set a "Chance" value for any trigger, such as "50%" to have it trigger only half the times it is checked (as I understand it; defaults to 100%)
Also, there is the optional "OnceOnly" value for any trigger, which can be set to "true" to have a trigger only fire once ever (defaults to false)


So, for example, a trigger for the girl's triggers.xml file:
    <Trigger    Type        = "Stat"
                Stat        = "PCLove"
                Threshold    = "30"
                Chance        = "5%"
                OnceOnly    = "true"
                File        = "Loverly.script"
    />
The above trigger would be checked when her PCLove stat hit 30, with a 5% chance of it firing each time it is checked (once a week normally, I think), and only firing a single time ever.
    <Trigger    Type        = "Money"
                Who            = "Girl"
                Comparison    = "MoreThan"
                Threshold    = "5000"
                File        = "IQuitYouAsshole.script"
    />
This trigger would fire once she got more than 5000 gold built up.
Title: Re: Sample script to add to girl files.
Post by: sgb on May 16, 2010, 01:03:00 AM
Thanks for that information.  Interesting stuff, I wish my creative writing skills were a bit stronger so I could make better use of it.  At least I've made a Meetgirl script for all the unique characters in my game.  Even something as basic as that makes starting out a lot easier, when you can avoid the troublesome girls until you have the income to better deal with them.
Title: Re: Sample script to add to girl files.
Post by: Mehzerz on May 16, 2010, 03:11:04 AM
Whoa! You could make a girl show up when you have a specific amount of money? NEAT! How about an item? I wanted to start an event that way. :x
Title: Re: Sample script to add to girl files.
Post by: DocClox on May 16, 2010, 03:32:14 AM
I should point out that the trigger XML format is documented. There's a huge great comment at the end of GlobalTriggers.xml that explains what the options are, along with a load of examples, and suggestions as to how to use them.
Title: Re: Sample script to add to girl files.
Post by: Dagoth on May 16, 2010, 03:38:41 AM
Some of them probably don't work correctly right now, though; it would be good to have people trying them out. The only ones I know to work correctly now are Meet in Town, "NoPay", "RivalLose", and "GamblingCheat" GlobalFlags, and the Money script used to make -5000 gold game over for the player.

How about an item? I wanted to start an event that way. :x
That's not in there currently, though it might be something to add in for the future if somebody (such as yourself) would actually use it.

I should point out that the trigger XML format is documented. There's a huge great comment at the end of GlobalTriggers.xml that explains what the options are, along with a load of examples, and suggestions as to how to use them.
Good point, that is a useful place to look. I forgot about it being so well documented there somehow. :D
Title: Re: Sample script to add to girl files.
Post by: fires_flair on May 16, 2010, 11:09:50 PM
ok, so I tried random out, but well something isn't working, when I look at the text screen behind the image screen it says that the script file isn't there.
I've attached the save, trigger, and script file if some one wants to figure it out.

also how do you get everything to indent properly? I couldn't figure that out.
Title: Re: Sample script to add to girl files.
Post by: DocClox on May 17, 2010, 04:57:06 AM
Quote
also how do you get everything to indent properly? I couldn't figure that out.

That is a major reason why I'm busily re-writing the scripting system.
Title: Re: Sample script to add to girl files.
Post by: Dagoth on May 17, 2010, 09:10:39 AM
ok, so I tried random out, but well something isn't working, when I look at the text screen behind the image screen it says that the script file isn't there.
I've attached the save, trigger, and script file if some one wants to figure it out.
Your script was messed up (missing an EndIf, variables not set correctly in a couple of places), but even after fixing it (I think) it still wasn't firing for me. I'll look into it.

EDIT: also, the indenting is automatic; in your case, the missing EndIf caused it to be out of whack. The indentation doesn't always show correctly after editing; simply save the file and then load it again to refresh the indentation.

EDIT 2: though, of course, you should probably hold off on making any really elaborate scripts until Doc has Lua support in, as those scripts should be simpler to make and also give you a lot more capabilities.

EDIT 3: and after digging a bit into the workings of triggers attached to specific girls, I can say that the process looks pretty well borked for most such triggers (besides the "Meet" trigger and possibly the "Kidnapped" trigger). Since Doc is working on Lua support, I don't feel particularly compelled to put more effort into making the other triggers work (I'm almost certain they never did, based on the code). Sorry.
Title: Re: Sample script to add to girl files.
Post by: fires_flair on May 17, 2010, 08:38:53 PM
thanks for taking a look Dagoth :).
Title: Re: Sample script to add to girl files.
Post by: sgb on May 30, 2010, 11:55:46 PM
Just a quick verfication: the TalkDetailsDefault and TalkDungeonDefault are no longer used at all in favour of DefaultInteractDetails and DefaultInteractDungeon, correct?
Title: Re: Sample script to add to girl files.
Post by: Dagoth on May 31, 2010, 01:01:32 AM
Just a quick verfication: the TalkDetailsDefault and TalkDungeonDefault are no longer used at all in favour of DefaultInteractDetails and DefaultInteractDungeon, correct?

Correct.