Author Topic: ScriptEditor needs an update  (Read 3267 times)

0 Members and 1 Guest are viewing this topic.

Offline HuiBui

  • Full Member
  • ***
  • Posts: 148
ScriptEditor needs an update
« on: November 25, 2017, 06:22:00 AM »
I would really love to have a small group of commands which I'm missing really in the script editor.

What I would like to have are commands about the girlstatus.

for an example:

 if girl status : pregnant (poisoned etc.)
or
have girl status."text"
or
remove girl status "text"

in addition it would be really helpfull if someone would remove the bugs from the latest script commands.

commands like: give girl item..... or If girls free etc. causing mistakes in all coding lines following after these commands because the if /endif are not working correctly.
Further more all command lines following after such a buggy command are moved to the left, so you dont have no more overview about the command structure which is really needed especially in larger scripts.

Kind regards
HuiBui




Offline aevojoey

  • Hero Member
  • *****
  • Posts: 1413
  • Thats ok, I'm used to disappointment.
Re: ScriptEditor needs an update
« Reply #1 on: November 25, 2017, 10:48:34 AM »
Attach a copy of your script so I can debug it.
Fixing the game is a better game than actually playing it.
Get the Current Version <|> Discuss the Game <|> Report a bug

Offline HuiBui

  • Full Member
  • ***
  • Posts: 148
Re: ScriptEditor needs an update
« Reply #2 on: November 25, 2017, 06:08:48 PM »
I dont have these sripts anymore because  I removed the buggy commands again.

But for example if you add the command Give item to girl "text" somewhere into the Default interaction script, you can see the bug by yourself.

Offline aevojoey

  • Hero Member
  • *****
  • Posts: 1413
  • Thats ok, I'm used to disappointment.
Re: ScriptEditor needs an update
« Reply #3 on: November 25, 2017, 10:46:42 PM »
I have looked at the scripts and I can answer a few things.

First, the moving of things to the left is a limitation of the old script editor.
Only the IF commands that were hard coded into the editor by the original creator will shift things to the right.
The "EndIf" command will shift anything back to the left.
I have added "EndIfNew" that does the same thing as "EndIf" but does not shift the text in the editor.
This should help a little.


I tried the give item commands but did not get any bugs with them.
When entering the name of the item don't use quotes.
The text entered should be exactly the same as the item name in the .itemsx file.


I will try to add in a few more commands next week if you want to make a list of what you need.
Fixing the game is a better game than actually playing it.
Get the Current Version <|> Discuss the Game <|> Report a bug

Offline HuiBui

  • Full Member
  • ***
  • Posts: 148
Re: ScriptEditor needs an update
« Reply #4 on: November 26, 2017, 08:12:12 AM »
Dear aevojoey,

thanks again for your help.

First I will explain more about the if commands.
I've worked hours for hours trying to write scripts.

What I've found out is that only the last four if commands in the editor are not working correctly.
ifgirlhasitem
ifplayerhasitem
ifgirlsslave
ifgirlsfree

all other/older if-commands are working fine together with the endif command.
(means that the endif causes only a one step shift back to the left edge for the whole following commands.) And so you can see very clearly if these things are coded well.
If all is fine all ifvar"number"... are standing correctly at the very left edge. Otherwise the script is buggy.

So I'm not shure if your idea with the  endifnew solves these problems.
It feels more as if these commands dont have a correct internal steering command.

When I remembering right the buggy if commands are causing other troubles too. Pictures are not shown correctly (the picture is shown one step later, when the script is running for a second time, for example. But I'm not really shure if I'm remembering right.


About the givegirlinvitem:  I had written a script with this command and the script was running. But no girl ever got an item on these way. Ive checked this very often, closing the game , than opened again , knowing that changes of a script are working not during a game session, but it was never sucessful, always failed.

to all of you guys: Do you have other experience?

At least my wish list:
- ifGirlStatus*text*
-addGirlStatus*text*
-removeGirlStatus*text*

I was also thinking about to combine these commands together with a temp/nontemp election, lets say for the poisoned status, but on the other hand could it causes logic mistakes by some other states? What do you think?

kind regards

Offline aevojoey

  • Hero Member
  • *****
  • Posts: 1413
  • Thats ok, I'm used to disappointment.
Re: ScriptEditor needs an update
« Reply #5 on: November 26, 2017, 10:23:15 AM »
The GiveGirlInvItem gives the girl and item from your inventory so if you don't have one she will not get one.
GiveGirlInvItem should be used with IfPlayerHasItem
Use AddItemtoGirl to create an item from nothing and give it to her.

Poison does not do anything in the game at the moment and with each turn being 1 week, poisons having a duration does not make much sense.


New script commands for .06.03.00
"IfGirlStatus ~ is ~"

"SetGirlStatus ~ to ~"
- If used to end any type of pregnancy, this will end all types of pregnancy.
- If used to start a pregnancy, it will not work if she is already pregnant.

"EndPregnancy"
- Ends all pregnancies

"CreatePregnancy type ~ chance ~ force ~"
- force=true will end existing pregnancies, force=false will not create pregnancy if already pregnant
« Last Edit: November 26, 2017, 12:18:17 PM by aevojoey »
Fixing the game is a better game than actually playing it.
Get the Current Version <|> Discuss the Game <|> Report a bug

Offline HuiBui

  • Full Member
  • ***
  • Posts: 148
Re: ScriptEditor needs an update
« Reply #6 on: November 26, 2017, 02:50:10 PM »
The GiveGirlInvItem gives the girl and item from your inventory so if you don't have one she will not get one.
GiveGirlInvItem should be used with IfPlayerHasItem
Use AddItemtoGirl to create an item from nothing and give it to her.

It works. I cant believe. Thanks

Offline GigaQuad85

  • Newbie
  • *
  • Posts: 6
Re: ScriptEditor needs an update
« Reply #7 on: November 18, 2020, 10:39:41 PM »
I can confirm that this all still works, to a point.
I added to some of the scripts already available in the game, to give the game some flare.  I added stories of fighting and also of erotic prowess, or just a basic adventure in text (would you like to throw the crystal orb?).  There are only so many items a girl can carry, only so many traits she can have at any one time.  This does give the game some balance even if it does limit some things.  Some girls come preprogrammed with traits, and using a script that adds to them could end up in overflow, never allowing the girl to acquire more traits, and only multiplying the ones she has already.


In case anybody hasn't noticed, you need to be very careful with the if---- commands in the script, but there are mechanisms that allow you to get creative.  I added a storyline that, based on equipment in my inventory, sent me on a journey with a particular girl, then provided her with equipment, and allowed that equipment to be acquired only one time per girl, as most of it was clothing or misc.  The way to do this was to create the ifgirlhasitem command, but leave the next command blank, and instead add an Else or Elsenew that was followed by the item acquirement.  There are two ways for the girls to acquire items, I tried both, but I found that using random rolls to put the items into my inventory first was a bit more balanced, and I only had to do the roll once to get an "Item acquirement Level", that way I could use the greater or equal quality in a string of singlecommand if statements that work from the top level downward.  I could then add these items to the girl later by testing if I had them in my inventory before trying to give them to her.  Since each set only gets given once, there's no buildup except of the new items.  Once they are acquired to differing levels of a complete set with the girl, I have a scripts with triggers that have a "weekly roll" that offer another aspect of the whole journey.  Some of them actually allow other scripts to be run, or offer items that activate other script features I've added to the different place to meet scripts.


What I haven't found out how to do yet is how to add a button to a place that allows a meetscript to be attached; I've checked the HTML\XML tags for the places, and I've attempted to make adjustments.  I've added my own button images, but when I run the game, even with new saves, the buttons do not show up.  If they have to be added in the CPP or python scripts, that may be out of my league, but if somebody could point me in the right direction, I'd be happy to try.


On another note, some people have also requested the ability to loop the meetscripts so that using a meeting script causes the meetscript to run again several times to get more chances at acquiring girls.  There are several ways to do this, and they vary by intent.  One way is to replace the AddTargetGirl with an add of a random girl to the dungeon.  I'd like to see this command have a counterpart of AddRandomGirlToBrothel, or AddRandomGirlTo with a place marker that allows you to send them to a particular area.  By using a roll variable and several quick if endif blocks you could have the girl sent to a random area, or you could have her sent to the area of the script.  However, I'm not great with code, and while I may soon attempt this adjustment, don't hold your breath on my account.  If somebody were to do this, I would be grateful.  By adding random girls, you get around the one girl limit, even though the script is attached to a particular girl (this is the way scripts work, and it should be that way in my opinion; it makes modifying the game more an act of creativity and playing the mods allows you to adjust by your intent).
This, of course, actually gives us a suggested path for another method of looping, from outside a script.  Using a pair of global variables and 3 scripts for each meeting place, you can continually loop until you have met your quota of attempts in any meeting place.  By setting global variables in the triggers list, you can check for them on meeting triggers.
you set global variable A to 100 for a maximum of 200 attempts
You have a script run at every week that resets a second global variable B to global variable A
You set up a second meetscript that matches the first, but you have it trigger based on global variable B, which will decrement every time this script runs, and when that variable reaches 0, the script will no longer run.  You add a choice in the both the old and dupelicate script that allows you to end the entirety by simply setting the global variable B to 0.  This will end the loop for this week.  The downside is that you will have to add all of this for each meeting place, which means a lot of dupelicated information.
I'm working on this method for the future; I've created a copy of my main game folder, and then instead of actual files for most of it, I used special symlinks, so I don't have to have so many copies of my data files that eat up a lot more space.  This has afforded me the ability to make only one extra folder for each of the areas I'm working on with the basic editors that came with the game.  I'm interested in viewing the main code of the game, but ultimately, I don't think I'll be much help there.  I might be able to devise a looping method that can be applied in the triggers to loop the meetscripts by a config-file variable, so you can set the maximum loop number for standard girl attempts.  It would also be great if you could create a random girl from the target girl the script is attached to, but that may take some adjustment.  It all depends on what the random girl script commands actually do.  If they select base-girls at random, this may only require a slight adjustment.  Instead of randomizing the basegirl, it could be used to grab a randomized copy of the target girl, or a new command could be added called AddTargetRandomGirl with some flags could be used to make a copy of the target girl, set a few particulars, and then send her to a desired location.  But again, that's a lot more coding than I'm yet prepared for.


To recap, you can loop in a script if you swap AddTargetGirl for adding a random girl or set of girls to your dungeon.  Since I also have special dungeon scripts, this is more help than hindrance.  I've also been writing scripts that let me shop to outfit her or to otherwise make her adept at different jobs by misc or consumables that adjust her values.  The original scripts worked really well, but lacked the ability to loop, so I added it by going with random girls at first.  Then I added a final chance at the target girl in the end of the script.  Once that was finished, I added more choices and storylines, allowing the whole script to loop from within.  I'd like to amend that further.  I'll be making my attempts using the game provided methods first, to see how it goes.  If it works, I'll keep it to that for a while.

Offline h1262216

  • Newbie
  • *
  • Posts: 30
Re: ScriptEditor needs an update
« Reply #8 on: November 29, 2020, 08:52:57 AM »
I'm working on an update for WM and one of the big changes is that the scripting will be based on lua, so that there is a real scripting language and you can use whatever editor you like. The basics are working, but currently there are still a few things that the old scripts could do that are missing in my new code.
you can find the new scripts here:
https://github.com/h1262216/crazys-wm-mod/tree/master/Resources/Scripts

@GigaQuad85
as somebody who has apparently used the old scripting extensively, I'd be especially interested in your feedback, critique and suggestions.

Offline GigaQuad85

  • Newbie
  • *
  • Posts: 6
Re: ScriptEditor needs an update
« Reply #9 on: April 01, 2021, 04:00:22 AM »
I'm working on an update for WM and one of the big changes is that the scripting will be based on lua, so that there is a real scripting language and you can use whatever editor you like. The basics are working, but currently there are still a few things that the old scripts could do that are missing in my new code.
you can find the new scripts here:
https://github.com/h1262216/crazys-wm-mod/tree/master/Resources/Scripts

@GigaQuad85
as somebody who has apparently used the old scripting extensively, I'd be especially interested in your feedback, critique and suggestions.
LUA huh?  I guess I'll have some learning to do.As long As I can translate the logic, it shouldn't be difficult.  I'd be happy to check out your work when it's ready.  I'm already looking at the scripts.