Author Topic: Script editing (MeetTownDefault.script)  (Read 5640 times)

0 Members and 1 Guest are viewing this topic.

Offline Chaz

  • Newbie
  • *
  • Posts: 13
Script editing (MeetTownDefault.script)
« on: July 19, 2015, 02:30:54 PM »
Hi there.


I wanted to edit MeetTownDefault.script to add a variety of scenarios that can happen when you go for a walk and find a girl. Using the script editor to do this is a tad tedious because you can't copy-paste sections of code, but any attempt to duplicate chunks of code in a text editor results in the file becoming unreadable. Is there another way to do this?

Offline aevojoey

  • Hero Member
  • *****
  • Posts: 1413
  • Thats ok, I'm used to disappointment.
Re: Script editing (MeetTownDefault.script)
« Reply #1 on: July 19, 2015, 02:41:10 PM »
I wanted to edit MeetTownDefault.script to add a variety of scenarios that can happen when you go for a walk and find a girl. Using the script editor to do this is a tad tedious because you can't copy-paste sections of code, but any attempt to duplicate chunks of code in a text editor results in the file becoming unreadable. Is there another way to do this?
Sorry I have not gotten around to finishing the script editor in WME.

If you load both the original script editor and the WME editor, you can edit the text in WME, save it and load it back in the original.
Make the script changes in the original editor, save and load it in WME.

It is rather tedious but it should work until I have time to finish it.
Fixing the game is a better game than actually playing it.
Get the Current Version <|> Discuss the Game <|> Report a bug

Offline Chaz

  • Newbie
  • *
  • Posts: 13
Re: Script editing (MeetTownDefault.script)
« Reply #2 on: July 19, 2015, 09:31:22 PM »
Actually, I didn't even notice that Script tab on the WME, I've just been using the old editor.


I don't really have any problem editing text - it's just replicating the if/then structure of an event with a sequence of choices takes a long time. I just want to save time by being able to duplicate the structure of an event, but the old editor does not allow this.


Are you a dev of WM? I don't know who made the game, but this seems to be the forum to talk about it. I discovered it recently and am rather fond of it.

Offline aevojoey

  • Hero Member
  • *****
  • Posts: 1413
  • Thats ok, I'm used to disappointment.
Re: Script editing (MeetTownDefault.script)
« Reply #3 on: July 20, 2015, 08:44:53 AM »
I don't really have any problem editing text - it's just replicating the if/then structure of an event with a sequence of choices takes a long time. I just want to save time by being able to duplicate the structure of an event, but the old editor does not allow this.
If you save the file as a .scriptx you can try modifying the variables directly.
Once you figure out how they work, it is a lot easier than it looks.
You can look in the source code at cGameScript.cpp to see how they work.

Are you a dev of WM? I don't know who made the game, but this seems to be the forum to talk about it. I discovered it recently and am rather fond of it.
The original devs moved on to other things years ago.
I found this game and its source code a little over a year ago and have been using it to teach myself C++.
I, along with several other members here, have been slowly adding to the game when we have time.
The original source code for the script editor is lost to time so I started making a new editor in WME.
Fixing the game is a better game than actually playing it.
Get the Current Version <|> Discuss the Game <|> Report a bug

Offline hjp766

  • Newbie
  • *
  • Posts: 10
Re: Script editing (MeetTownDefault.script)
« Reply #4 on: July 20, 2015, 10:02:01 AM »
I've been trying to figure out the script structure for a while with a view to trying to make a couple of scripts. I have failed. Is there an "idiots guide" anywhere perhaps?

Ta

Offline Chaz

  • Newbie
  • *
  • Posts: 13
Re: Script editing (MeetTownDefault.script)
« Reply #5 on: July 20, 2015, 11:24:54 AM »
Thank you for bringing the scriptx possibility to my attention - it looks as though I will be able to do some of what I want through that.

Do you happen to know if there's a way to swap out or remove the initial message in the town meet? It requires that every scenario start with you approaching a woman, which is a little limiting.

Edit: I attempted to duplicate a 'event template' block in a text editor and prefix the ActionNumber with an additional so that they would have different numbers and, presumably, work. The WME found this acceptable, but won't re-save it. :( Is there another way to do this?
« Last Edit: July 20, 2015, 11:44:59 AM by Chz »

Offline aevojoey

  • Hero Member
  • *****
  • Posts: 1413
  • Thats ok, I'm used to disappointment.
Re: Script editing (MeetTownDefault.script)
« Reply #6 on: July 20, 2015, 08:00:44 PM »
Do you happen to know if there's a way to swap out or remove the initial message in the town meet? It requires that every scenario start with you approaching a woman, which is a little limiting.
Sorry, that is hard coded into the game.
I will see what I can do to make that changeable.

Update:
I have added a way to skip the default intro for "MeetTownDefault.script" by adding a file called "MeetTownDefault.script.intro".
If this file is not there, it will use the original intro; If the file is empty, there will be no intro; If there is any text in the file, that will be used as the intro.
It is a plain text file.
When I tried to add it to the girls as well I hit a minor problem but I got that fixed.

Update 2: I have added this to the Arena, Studio and Clinic walks as well.
Basically you can just add files "MeetArenaTry.script.intro", "MeetCastingTry.script.intro" and "MeetClinicTry.script.intro" and get rid of the default intros.

Edit: I attempted to duplicate a 'event template' block in a text editor and prefix the ActionNumber with an additional so that they would have different numbers and, presumably, work. The WME found this acceptable, but won't re-save it. :( Is there another way to do this?
The game will also load and save both .script and .scriptx files
Open the ./Resources/Scripts folder and run the game (not in fullscreen).
If you want to convert the .script to .scriptx, remove the .scriptx and activate the script in the game.
It will read the .script and save it as .scriptx.
To save the .scriptx as .script, remove the .script file and activate the script in the game.
The game does not care about the ActionNumbers as much as WME does so you can leave them out when doing it this way.

If the script does not save properly or crashes the game, then you have something wrong in the script.
« Last Edit: July 26, 2015, 10:51:57 AM by aevojoey »
Fixing the game is a better game than actually playing it.
Get the Current Version <|> Discuss the Game <|> Report a bug

Offline Chaz

  • Newbie
  • *
  • Posts: 13
Re: Script editing (MeetTownDefault.script)
« Reply #7 on: July 22, 2015, 02:57:25 PM »
Thanks for the .intro addition. The latest version crashes for me almost always (eg. when I enter the shop, when I go ahead a week) but I will keep an eye on it. Do you have an SVN for the latest version?


Regarding my attempt to make scripts: I'm having little trouble with having the game or editor not crash on me, I will revisit it at a later time when I am feeling more patient.



I should point out something I've noticed: When I have the editor generate a random variable number (SetVarRandom) it will sometimes generate a number outside of the range specified (ie if I generate a number between 4 and 5, sometimes the number will be greater than 5). Have you noticed this or is it just on my end?