• Welcome to Freedom Reborn Archive.
 

EZ Script Qs: Freeroam theory

Started by Boalt92, March 12, 2008, 06:24:33 AM

Previous topic - Next topic

Boalt92

M25,


2 EZ Script questions:

1) Using the M25enc_exit plugin:  if an exit is DISALLOWED, it will not appear at all on the map?  In other words, I can put it on the map and save it for later?

2) You used to have encounters scaled to the players' prestige.  I'm guessing you changed it due to prestige imbalances (and 300 spawned thugs).  At any rate, I was wondering how difficult it would be reinstitue that system (rounded to the nearest 1000 prestige) with a cap of, say, 15 creatures spawned?  This is not a priority, and would only be for a few very specific scenarios, so if it's going to require anything more than a simple cut/paste (or coding equivalent), don't worry about it. 


Thanks in advance.

B92

EDIT--

One more thing:
For a freeroam base map, I need - a) 'to_<map>' link connecting it the freeroam world; b) hero_1 -4 markers; c) 'mapname_<map>' marker; and d) a 'base_map' maker?  Missing anything?

M25


1) Yes, a disallowed exit should not be visible to the player.

2) The removal of the prestige code was more due to efficiency.  Getting the prestige values of enemy characters was slow (they have to spawned off map and then have their prestige calculated).  Everyone would have to commit to pre-calculating all prestige values, which I thought was bad for ease of use. 


For a base map you also need one or more encounter markers.


Boalt92

M25, Thanks for the info.  Didn't realize there were performance issues with the leveling. 

At any rate, I've got another question regarding the Simple Choice add-on:

I took a look at the code, and it looks like you can have up to 4 choices.  Can you please review/correct the code below for syntax? (I think I'm missing something....)

Encounter: Simple Choice Example
Type: Simple Choice
Allies:the_ant named ant
Marker: choice1
Next: If Choice 1: Select 1
Next: If Choice 2: Select 2
Next: if Choice 3: Select 3
Next: If Choice 4: Select 4

Alert Cutscene:
the_ant says, "this is an example of a simple choice encounter.  Right Click on me to make a selection."

Choice 1 Cutscene:
the_ant says, "you've chosen 'select 1'"

Choice 2 Cutscene:
the_ant says, "you've chosen 'select 2'"

Choice 3 Cutscene:
the_ant says, "you've chosen 'select 3'"

Choice 4 Cutscene:
the_ant says, "you've chosen 'select 4'"

##############Select 1 Encounter #############
Encounter: Select 1
Type: Cutscene
Allies: the_ant named ant
Marker: choice1
Next: If Choice 1: Simple Choice Example
Next: If Choice 2: End

Alert Cutscene:
the_ant says, "if you see this, then you chose 'select 1' and the encounter worked correctly."
the_ant says, "are you satisfied with this example?  Choose 'no' and start it over, or choose 'yes' and end this example."

Choice 1 Cutscene:
the_ant says, "o.k.  i'll replay the example"

Choice 2 Cutscene:
the_ant says, "great!  happy scripting!"

############# REPEAT FOR SELECT 2-4 ########################


Oh yeah, I'm using 'named' to track the_ant through each encounter.  Is that necessary?  Does it even work?

Thanks in advance

B92

M25

You use words or phrases as the choices, instead of numbers.

It would looks something like:

[spoiler]

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

Choice1: yes
Choice2: no
Choice3: maybe
Choice4: not a chance
Choice5: could be

Next: If yes: Select 1
Next: If no Select 2
Next: if maybe: Select 3
Next: If not a chance: Select 4
Next: If could be: Select 5

Alert Cutscene:
the_ant says, "this is an example of a simple choice encounter.  Right Click on me to make a selection."

yes Cutscene:
the_ant says, "you've chosen 'select 1'"

no Cutscene:
the_ant says, "you've chosen 'select 2'"

maybe Cutscene:
the_ant says, "you've chosen 'select 3'"

not a chance Cutscene:
the_ant says, "you've chosen 'select 4'"

could be Cutscene:
the_ant says, "you've chosen 'select 5'"

##############Select 1 Encounter #############
Encounter: Select 1
Type: Cutscene
Allies: the_ant named ant
Marker: choice1
Choice1: replay
Choice2: move on
Next: If replay: Simple Choice Example
Next: If move on: End

Alert Cutscene:
the_ant says, "if you see this, then you chose 'select 1' and the encounter worked correctly."
the_ant says, "are you satisfied with this example?  Choose 'replay' and start it over, or choose 'move on' and end this example."

replay Cutscene:
the_ant says, "o.k.  i'll replay the example"

move on Cutscene:
the_ant says, "great!  happy scripting!"

############# REPEAT FOR SELECT 2-5 ########################



[/spoiler]


There are five 'choice slots', so you can let the player select from 5 different choices.



When you give a character a name, it tells EZScript not to remove that character when the encounter they are in finishes.  The character becomes encounter independent.  When you use the same named character in another encounter, EZScript tries to find a character with that name, and use that character in the new encounter.   In other words, the_ant will be the same through all the different encounters. 


Boalt92

Thanks again for your help, M25.  This is actually, going somewhere....really!

I'm testing a concept in freeroam, but I can't find my copy of your freeroam sample campaign.  Please confirm:

1) FFedit Campaign tab - 1st mission should be set to 'ezscriptfreeroam'

*************

2) 'ezscriptfreeroam' base & mission pys:
import m25startup
from m25startup import *

# what is the name of the story (the text file) that the mod uses
freeroam_storyfile='freeroam' - [color=red]Should this be 'stories' or should i create a folder called 'freeroam'?  I'm testing the 'start story' plug-in, so I'd planned on placing them in the 'story' folder[/color]

# who will the player be able to recruit from at the start of the mod
# built-ins only. 
# the player can still recruit any customs they want - [color=red]Self Explanatory[/color]
freeroam_addbuiltins=['alchemiss', 'blackbird', 'bullet', 'el_diablo', 'eve',
'green_genie', 'ironox', 'man_bot', 'man_o_war', 'microwave', 'minute_man',
'liberty_lad', 'order', 'quetzalcoatl', 'sea_urchin', 'tombstone']

# How much prestige will the player have to recruit characters - [color=red]Self Explanatory[/color]
freeroam_startingprestige=11000

# what map does the mod start on
freeroam_startingmap = 'demo_base' - [color=red]This is a base mission with mapname/folder name 'demo_base' and an exit link to my 'demo_city' map. can I have place a 'briefing' encounter/cutscene in this folder?  should I place it in the 'stories' folder?[/color]


**************

3) the manual refers to an 'anthology file' for listing the stories in your freeroam.  Is this a physical file or just a concept?  could you please elaborate?


Again, many thanks for your patience and support for this plug-in.  If all goes well, I might actually have something to give back to the community!

B92

M25

1. Yes, the first mission must be the directory you have the freeroam base.py and mission.py files in.  You also need to put your starting base map in that directory.  The freeroam scripts will swap maps once you start the game, but the game needs a legitimate freeroam enabled map (has the right markers on it) in that directory to start or it will crash.

2.
You should create a directory called 'freeroam' and put the stories you want the mod to begin with in the freeroam directory. 

If you are using the 'start story' plug-in, those stories should go in the 'stories' (note spelling) folder.

Stories won't run in a freeroam base.  You can run a cutscene as soon as they player exits to the demo_city map though.


3.  You can use an anthology file, but it is much easier to just use the 'freeroam' directory.  An anthology file is simple a text file that has 'Anthology' on the first line and a list of story files on subsequent lines.

Boalt92

M25,

More EZ script stuff questions:

Encounter types WAIT and NONE

WAIT
I noticed you use Type: None in the onpatrol example to begin random rotations.  I want to add a random timer to spread encounters out a bit by using Type: Wait and setting Minimum Time: 30 and Maximum Time: 90.  Will Type: Wait affect any other encounters that are running at the same time?  Should I use a couple of custom encounters instead? (i.e. Actions: Immediate Timed Encounter)


NONE
I'm setting up a mission with multiple ways to complete it.  I had an idea that I could use Type: None as a placeholder to track progress through the mission.  I just want to make sure these encounters register as complete within the EZ Script engine and that  Starts When will not confuse them.  For example:


Story: freeroam theory
Starting Encounters: mission1, mission2


#--interrogate the criminals--------------
#criminal1
Encounter: mission1
Type: Simple Choice
Allies: gangster

Choice1: go easy
Choice2: get tough
Choice3: make a deal

Next If go easy: noclue1
Next If get tough: clue1
Next If make a deal: clue1

#- criminal2
Encounter: mission2
Type: Simple Choice
Allies: gangster

Choice1: go easy
Choice2: get tough
Choice3: make a deal

Next If go easy: clue2
Next If get tough: noclue2
Next If make a deal: clue2
#--------------------------END interrogation encounters-----


#--clue placeholders--------
Encounter: clue1
Type: none
Next: none

Encounter: noclue1
Type: none
Next: none

Encounter: clue2
Type: none
Next: none

Encounter: noclue2
Type: none
Next: none
#--------------------END clue placeholders--------------


#---mission thread 1 selector must have at least one clue-----------

# both clues
Encounter: mission1_a
Type: none
Starts When: clue1 at End, clue2 at End
Next: thread1

# clue 1 only
Encounter: mission1_a_1
Type: none
Starts When: clue1 at End, noclue2 at End
Next: thread1

# clue 2 only
Encounter: missio1_a_2
Type: none
Starts When: noclue1 at End, clue2 at End
Next: thread1
#------------------------------end thread 1 selector------------

#----mission thread 2 selector - no clues------------
Encounter: mission1_b
Type: none
Starts When: noclue1 at End, noclue2 at End
Next: thread2
#---------------END thread 2 selector------------------



Lastly....can I use a villain/minion for a simple choice encounter?  will it work like an interrogation encounter?


Thanks in advance.  My project is really moving along.  I should post some screens soon.


B92

M25

Wait will only affect encounters that come after it, not ones that are running at the same time. 

The None encounters you've written should work.   Very clever.   :)


A villain or minion in a simple choice encounter won't be interrogated.  You could set up two encounters, one in which the villain is defeated, and then the next one in which they are treated as an ally.

Something like...

Encounter: e1
Type: Fight
Villains: thug_with_bat named batty

End Cutscene:
batty is revived
batty says, "OK, enough already."

Encounter: e2
Type: Simple Choice
Allies: thug_with_bat named batty
Choice1: yes
Choice2: no

#choice cutscenes here

End Cutscene:
batty is destroyed