• Welcome to Freedom Reborn Archive.
 

True(r) Freeroam via EZ Script WIP

Started by Boalt92, March 28, 2008, 01:17:05 PM

Previous topic - Next topic

Boalt92

I'm not sure if this should be in the scripting forum or not, but I got the idea in this forum so...

Thanks to M25's brillian EZ Script it is now possible to have "true" freeroam experience in both Rumble Room and Campaigns.  By "true" I mean:

1) mission, and/or map-based random simple encounters
2) players' choice of missions - eliminates the repeats and eliminations of random mission rotations
3) missions influenced by players' choices

Would you believe it?

If you find that hard to believe, it's not.  It's all possible with the Start Story and Simple Choice encounter plugins available on M25's site.  They are pretty much self-explanatory, the "story" plug-in allows you to start a story from within another encounter, while the "simple choice" gives you up to 5 separate choices (right click on the "choice" character, then right click again and the "choices" appear).

The theory is pretty simple:

Control Encounter
-Choice 1 --> Start Story Mission 1------>end
              --> -loop----> Return to Control Encounter---->repeat
-Choice 2---> Start Story Mission 2------->end
              --> -loop----> Return to Control Encounter---->repeat
-Choice 3, Choice 4, Choice 5 (as above, if needed)


First we have the Control Encounter.  This is the Simple Choice Encounter that controls a particular set of stories/missions.  I say set, because there are a few limitations:

1) you cannot start a story once it has completed, which means you must loop this control encounter.  I tried placing the control encounter at the end of each story, but, if you select a story that has already completed, you get to a dead end.  This way, at least you'll still be able to make selections, and you'll know if you've chosen all the missions. (see #2)

2) (this one is cosmetic)  You must have a control character to interact with.  There may be away around it, but this is how it works for my project.  To do this, I use the Allies: character named character line.  This keeps the character onscreen and available for further choices.  The only problem is that each time the you use the Simple Choice on this character, you add a "talk_to" command on him/her/it.  After a few loops, you have quite a few "talk_to"s.  Spreading missions out over multiple control characters will reduce this blemish.  I don't know if it will affect game performance.  The good news is that, if a player sees as many "talk_to"s as there are choices, the player will know there are no more choices available for this control character.


Next, we have the Start Story encounters.  These are pretty obvious.  Start any story in your story directory here.


Finally, we have the Loop.  I've already mentioned the purpose of the loop, so here I'll mention it's placement.  Since our control character stays on screen, we need to reset the control encounter in a way that flows within the story.  That's why I place the Loop somewhere away from the control character.  I haven't tested it yet in the Rumble Room, but in a freeroam campaign (hint, hint...) I place it on a map in a spot where I know the hero has to be.  I also include a reminder to the player to return to the control area to reset the control encounter.


Which brings me to my next point: how do we use it?  Again, this has been designed for freeroam, but should work (has been mostly tested, anyway) in the rumble room as well.  The control encounter and character should be in a control area.  The freedom fortress is the obvious choice.  This way you can have the controller in a place where it will not interfere with the other stories.  This also helps for a smoother reset (see above) as you can place your "Loop" encounter at the map transition point.  When the hero transitions from one map to the other, he/she/it/they reset the control encounter.  When they return to the control area, they have a fresh new set (or fresh reset) of choices.  Finally, if you're using multiple controllers, you can have each controller (and their stories) assigned to a particular map (using the Map: mymap ) line - markers too.  This keeps stories from running into each other (which should also reduce load on your computer).  You can also use this concept to have area-specific random encounters.  Say your controller is out of missions, just have a "choice" be random patrol and prepare a group of random encounters for that particular controller's area.

I have yet to test it (hopefully in the next week or so), but you should be able to use the same concept within a mission to give a player choices (and consequences  :arrr) that direct the outcome of a mission.  You don't have to have a million different endings, just give players options on how to complete the mission (the easy way or the hard way)....anything along those lines.


That's about it for now.  Please chime in as this is very much a WIP and I could use all the feedback I can get.

To see my concept in action, I have a simple demo script you can check out.  Keep in mind this is an omega version, meaning you have to do some work if you want to see it.  It also means there's nothing more than placeholder text and absolutely no action whatsoever.  Still it works in the Rumble Room, so it's not hard to set up.

First copy this code into a text file called "missiontest.txt" and place it in your 'stories' directory:
[spoiler]story: missiontest


Encounter: Simple Choice Example
Type: Simple Choice
Allies:the_ant named ant

Choice1: mission 1
Choice2: mission 2
Choice3: quit

Next: If mission 1: Select 1
Next: If mission 2: Select 2
Next: if quit: End


Alert Cutscene:
the_ant teleports to demo1
the_ant says, "this is the control encounter.  'talk to' me first, then right click again to make a selection"

mission 1 Cutscene:
the_ant says, "you've chosen mission 1."

mission 2 Cutscene:
the_ant says, "you've chosen mission 2"

quit Cutscene:
the_ant says, "you've chosen to quit"



##############Select 1 Encounter #############
Encounter: Select 1
Type: Start Story
Allies: the_ant named ant
Stories: testmission1
Next: reset



##############Select 2 Encounter #############
Encounter: Select 2
Type: Start Story
Stories: testmission2
Next: reset

##############

Encounter: reset
Type: Cutscene
Next: Simple Choice Example
[/spoiler]


Next Copy this code and name it "testmission1.txt", and place it in your 'stories' folder:
[spoiler]Story: testmission1

Encounter: begin
Type: Cutscene
Allies: bullet
Next: Stop

Alert Cutscene:
bullet teleports to hero1
bullet says, "test mission 1 has begun"


Encounter: Stop
Type: Cutscene
Next: none

Alert Cutscene:
bullet says, "test mission 1 ending"
[/spoiler]

Do the same here only name it "testmission2":
[spoiler]Story: testmission2

Encounter: begin
Type: Cutscene
Allies: minute_man
Next: Stop

Alert Cutscene:
minute_man teleports to hero1
minute_man says, "test mission 2 has begun"


Encounter: Stop
Type: cutscene
Next: none

Alert Cutscene:
minute_man says, "mission 2 ending"
[/spoiler]

Almost there :doh:

Next, create your .py files.  Be sure to change the appropriate line to missiontest, testmission1, and testmission2.  Sorry, but if you don't know how to do that, you'll need to study the manual :P

Lastly, open any EZ Script enabled map in FFedit and add a marker called "demo1".  Place near your hero's spawn point.  It makes everything easier.

That's it for now.  I'll have a playable demo ready in a few weeks  :rolleyes:.  Until then, I'd love to hear everybody's suggestions/reactions/input.


B92

Epimethee

Sounds good, Boalt92. EZScript for Freeroam has a lot of untapped potential; the techniques you described above makes it even more tantalizing.

In some case, instead of a control character, a static object could be used: FF Trainer, Computer, Freedom Fortress, Phone Booth, etc.

Maybe some of the script-specific limitations could eventually be attenuated by adding the corresponding functionalities to EZScript or, in a more generic fashion, by allowing it to call Python functions (or maybe outputting the EZScript code to a Python file rather than interpreting it on the fly).

Looking forward to the demo. :)

lmalonsof

It's great to know you're working on this!!!

In fact, I had a similar idea one month ago but since I'm working simultaneuosly on 3 campaign ezscript mods, I decided to finish at least 2 of them to start with freeroam campaigns.

I completely agree with the focus you want to give to freeroam mod and, as I said in other post, it would be great to try to give a Neverwinter nights flavour to Freedom Force. I would even emphatise more the possibility of the player deciding different actions and the impact that these decissions may have during the game.

Keep it up!