• Welcome to Freedom Reborn Archive.
 

EZ Script Help

Started by joemama, February 22, 2007, 12:26:19 PM

Previous topic - Next topic

M25

I shouldn't reply without testing this, but...

The problem I see (no fault of yours) is the use of the marker cosmic_king for both the 'Timer' and 'Fight' encounters.

EZ script won't spawn two encounters on the same marker at the same time.  Of course that works well for random encounters, but not so well here.

I'd suggest adding a second marker to the map such as 'cosmic_king_timer' and put it near the 'cosmic_king' marker.  That way, there will be two different markers and EZ script will spawn both encounters.


tommyboy

Thanks, I'll try that.

GogglesPizanno

I've got one that I hope someone has a clever answer to.

In the original FF game, the second level was the Warehouse at night.
you were supposed to be stealthy and avoid the guards, as they wouldn't attack until you got within a certain range.

I'm looking to simulate a location that is guarded, and you need to try and get in without being spotted.

Is there a tricky little bit of EZScripting to simulate this?




tommyboy

Quote from: M25 on April 25, 2007, 11:38:14 AM
I shouldn't reply without testing this, but...

The problem I see (no fault of yours) is the use of the marker cosmic_king for both the 'Timer' and 'Fight' encounters.

EZ script won't spawn two encounters on the same marker at the same time.  Of course that works well for random encounters, but not so well here.

I'd suggest adding a second marker to the map such as 'cosmic_king_timer' and put it near the 'cosmic_king' marker.  That way, there will be two different markers and EZ script will spawn both encounters.



Thanks that worked fine.
I probably should have figured it out myself, but thanks for the help, and the coolness that is EZscript.

M25

Quote from: GogglesPizanno on April 25, 2007, 04:31:42 PM
I've got one that I hope someone has a clever answer to.

In the original FF game, the second level was the Warehouse at night.
you were supposed to be stealthy and avoid the guards, as they wouldn't attack until you got within a certain range.

I'm looking to simulate a location that is guarded, and you need to try and get in without being spotted.

Is there a tricky little bit of EZScripting to simulate this?




Not exactly, but you could do something similar.

You could have an encounter that forces a loss of the mission if the player gets too close to the guards.

Encounter: Guard
Type: Local Cutscene
Villains: thug_with_gun
Next: Lose

Start Cutscene:
Villain turns to Hero
Villain says, "Ha!  We spotted you!"


You could also try something a little more sophisticated.  In the FF mission, the player is supposed to stop the guards from raising an alarm.

Setup:

Put a marker on the map called guard1 where the guard will spawn.  Put another marker called guard1_end1 some distance away from the guard1 marker.  The villain will run to the guard1_end1 marker to raise the alarm.  Put something on the map near that marker to make it look like they are running to raise an alarm. 

Then add a third marker next to the guard1_end1 marker.  Call this marker guard1_alarm1.  If the alarm is raised, the new guards will appear here.

Now the encounters:

Encounter: Guard
Type: Flee the Scene
Villains: thug_with_gun
Marker: guard
Primary Objective: "Sneak past the guards." for 10 prestige and 100 xp
Next: If All Escaped: Raise the Alarm
Next: If Some Escaped: Raise the Alarm

Start Cutscene:
Hero says, "I've been spotted.  I need to stop him from raising the alarm!"

Villain Escapes:
Villain says, "Raise the alarm.  Hero on the loose!"

None Escaped Cutscene:
Hero says, "That was close, but I stopped him in time."


Encounter: Raise the Alarm
Type: Hunt
Minions: thug_with_gun, thug_with_bat
Marker: guard1_alarm
Next: None

Start Cutscene:
Minion says, "Get them!"



Edit:  forgot to specify the markers in the encounters.

GogglesPizanno

Awsome.
Thats what i was lookin for.
Thanks.

tommyboy

Sorry to be a pain, but I have a recurring cutscene problem.
In some cutscenes the scene displays correctly, with heads and dialogue bubbles, but in others I get no head and the dialogue is printed on the mid-left of the screen, and the "cutscene border" disappears.
Sometimes this happens during a cutscene, so it starts correctly then "drops out".

So rather than a working cutscene:[spoiler]


I get:

[/spoiler]

Now, I know all the characters involved have head.nifs, and have their animportraits setup correctly.
I've tried to be rigorous in checking that a character is in the scene and having them speak telepathically if they aren't.
But I just can't see why some scenes work and others don't, even to the point where the same character will "headspeak" the line correctly in one cutscene but "drop out" in another even when I copy/paste the text from the first scene into the second.

Heres my text for the two cutscenes pictured above, the first Encounter "Villains arrive" plays its cutscene completely correctly, the second encounter "Meet Superboy" drops out of its alert cutscene:
[spoiler]
# Play an intro cutscene
# I've placed a marker on the map for the time_trapper to walk to.

Encounter: Villains Arrive
Type: Cutscene
Allies: time_trapper
Marker: statue_marker
Next: Meet Superboy, Time Bubble

Start Cutscene:
Unfade
Camera on time_trapper
#time_trapper is destroyed
Play effect effect_time_gem at time_bubble2
Ally walks to statue_marker
time_bubble2 is destroyed
#narrator says, "Smallville, Earth, Sol System, Milky Way, 20th Century."
#narrator says, "Time is out of joint"
Ally turns to esaturn girl
Ally plays animation special_c
Ally says, "ha ha ha! Brilliant! I have sent a set of evil legionnaires from an EVIL ALTERNATE TIMELINE to recruit SUPERBOY before the REAL LEGION can! Without SUPERBOY's might the LEGION will fall to my plans easily....."
Play sound fx_evilfemale_screech_1 at Ally
Play effect effect_ffx_miniportal at Ally
Ally is destroyed
Cinematic Camera on esaturn girl
esaturn girl turns to superboy_neutral
esaturn girl plays animation active_defence
Play effect effect_ffx_miniportal at esaturn girl
Play effect effect_ffx_telepathy at superboy_neutral
superboy_neutral plays animation special_i
esaturn girl says, "my telepathic powers will convince SUPERBOY to fight alongside us against the goody goody legion of super heroes.SUPERBOY you will fight along side us..we are your friends..you trust us.."
Cinematic Camera on ecosmic boy
ecosmic boy plays animation special_e
ecosmic boy says, "we will crush the LEGION with SUPERBOY on our side. And the TIME TRAPPER will make us rulers of Earth!"
Cinematic Camera on superboy_neutral
superboy_neutral plays animation special_a
superboy_neutral says, "so you say you are from the future and need my help to repel an invasion of futuristic super villains? count me in! we'll teach them a lesson they'll never forget!"








# LSH meets Superboy

Encounter: Meet Superboy
Type: Fight
Villains: ecosmic boy, elightning boy, esaturn girl, superboy_neutral
Marker: statue_marker
Primary Objective: "'Persuade' Superboy to join the Legion by defeating the Evil LSH" for 500 prestige and 200 xp
Next: Win


Alert Cutscene:
ecosmic boy is destroyed
esaturn girl is destroyed
elightning boy is destroyed
superboy_neutral is destroyed
Cinematic Camera on Hero
brainiac_5 says telepathically, "OK, let's start looking for Superboy."

[/spoiler]


Again, it's probably something very simple that I'm missing, but I just can't see it.

In the start cutscene of the Meet Superboy Encounter, it plays as it should until "cosmic boy says," where it drops out.
Then Brainiac_5_1 head appears as it should (albeit with no cutscene border), then the Ally speech has no head:
[spoiler]
Start Cutscene:
Cinematic Camera on Hero
Hero turns to esaturn girl
Hero says, "what the..? those kids look like versions of us! and is that SUPERBOY with them? what's going on here?"
Camera on esaturn girl
esaturn girl plays animation special_f
esaturn girl says, "there they are! SUPERBOY attack them! you must crush them or they will destroy EARTH!"
Camera on superboy_neutral
superboy_neutral plays animation special_i
superboy_neutral says, "I feel so...odd...like my thoughts aren't my own....must crush them..save earth..."
Camera on Hero
cosmic_boy says, "I think that SUPERBOY is being controlled by these evil versions of us! we must defeat them all!"
Camera on brainiac_5_1
brainiac_5 says telepathically, "there is more than one way we can win this, Legion. remember we can time travel, as well as fight...defeating Superboy will not be easy"
Ally says, "but if we can get SUPERBOY near the KRYPTONITE he may be weakened enough for us to beat him"
[/spoiler]


Other than the "dropping out" of some of the cutscenes, the mission runs and plays entirely correctly.
So can anyone tell me what I've missed/messed up this time? All help gratefully received.

M25

EZ script scans the captions.txt file in <your mod>/Lang/English  and it looks for lines that match the ones in your cutscenes.

When it can't find a line from a cutscene in captions.txt it displays it as text on the left side of the screen.  The cutscene border is dropped due to the fact that the text is invisible for some reason when the cutscene border is displayed.

So... you either made a change to your cutscene and didn't re-add the captions, or something strange is going on.  Add the captions again.  It's easiest to open up m25config.py and set
M25_MAKE_CAPTIONS = 1
and load your story (you don't have to play all the way through) in the game. 
Then generate the language files using ffedit again. 

tommyboy

Quote from: M25 on April 27, 2007, 07:03:52 AM
EZ script scans the captions.txt file in <your mod>/Lang/English  and it looks for lines that match the ones in your cutscenes.

When it can't find a line from a cutscene in captions.txt it displays it as text on the left side of the screen.  The cutscene border is dropped due to the fact that the text is invisible for some reason when the cutscene border is displayed.

So... you either made a change to your cutscene and didn't re-add the captions, or something strange is going on.  Add the captions again.  It's easiest to open up m25config.py and set
M25_MAKE_CAPTIONS = 1
and load your story (you don't have to play all the way through) in the game. 
Then generate the language files using ffedit again. 

D'oh!
Thanks again, that was it, I'd forgotten to make the captions again after altering them, and needed to do that and generate the lang dats via FFedit.
Thanks for the patience with my grotesque stupidity.


joemama

M25,

I've updated Patriot World with activated doors, and I want to include instructions on how to use them.  Is this correct?

[spoiler]You need special encounters to activate the doors.  There are wide doors and thin doors.  To use them:

wide doors (door1, door5, door9), use:
Encounter: door1
Type: Open Door
Object:  nazihq_wide_door_closed named jm_door1
Marker: firstdoor

thin doors (door2, door3, door4, door6, door7, door8, doorboss), use:
Encounter: door2
Type: Open Door
Object:  nazihq_door_closed named jm_door2
Marker: seconddoor

Use a separate encounter (i.e. door1-door9, doorboss) for each door (i.e. m_door1-jm_door9, jm_door_boss).  Use the thin door encounters for doors/rooms 2-4, 6-8, and boss.  Use the wide door encounters for doors/rooms 1, 5, and 9.  Sorry, but that's how they designed the doors! 
[/spoiler]

Thanks for your help.

JM

EDIT--made a correction

M25

That should work for the door encounters, yes.

Here's what I have for th Open Door Encounter

[spoiler]
Black Jack moved towards the huge steel doors bolted to the bare rock within the nazi base.  "The captured scientists must be inside!"

Yes, an encounter devoted to opening doors.  This encounter takes a door on the map and allows the player to open it by selecting the OPEN command on the door.

Encounter: My Door
Type: Open Door
Object: _impobj_48

Alert Cutscene:
Red Arrow on Object


To simulate the 'fog of war' that exists on some of Irrational's maps, you can use the Fog parameter.  Give it the name of the fog object and the fog will be removed automatically when the player opens the door.  Use the actual name of the object on the map, not it the name of the template.

Fog: fog1

The open door encounter handles the doors for the nazi base in FFvTTR but you may want to use the encounter for other types of doors.  To do so, set the effect played when the door opens, and the template of the open door.

Effect: effect_door_wide_opening
Open Door: nazihq_wide_door_open

Remember that the door and the fog object must exist on the map.  You have to put them there, since placing a door on the map at random wouldn't make much sense.  You don't need to have a fog object, but the option is there if you want it.

Cutscenes

•   Alert – the encounter is ready to run (the hero is alerted to the encounter)
•   Start – the hero is close enough to see the door
•   End – the door has been opened

End Conditions

•   End – the only way the encounter can end is the hero successfully opening the door

[/spoiler]

tommyboy

Quote from: M25 on April 25, 2007, 11:38:14 AM
I shouldn't reply without testing this, but...

The problem I see (no fault of yours) is the use of the marker cosmic_king for both the 'Timer' and 'Fight' encounters.

EZ script won't spawn two encounters on the same marker at the same time.  Of course that works well for random encounters, but not so well here.

I'd suggest adding a second marker to the map such as 'cosmic_king_timer' and put it near the 'cosmic_king' marker.  That way, there will be two different markers and EZ script will spawn both encounters.




OK, now I have an Examine Encounter that randomly takes place at one of six markers, and after the examination, an Alliance Encounter is next.
Now, given that I can't use the same marker for both Examine and Alliance encounters, so I created copies of the Examine Markers.
How do I convince the game to use the same Alliance Marker that corresponds to the randomly selected Examine Marker?
At the moment it all works, but the Alliance Encounter ends up miles away from the Examine Encounter.
Or can I do something like:

[spoiler]
Encounter: Pzone
Type: Examine
Objects: phantom_zone_projector named phantom_zone_projector1
Marker: pzone
Allies: mon_el
Secondary Objective: "Find and use any other strange artifacts" for 500 prestige and 200 xp


Alert Cutscene:
Camera on hero
Hero says, "our instruments picked up something else here in town, if you see anything strange it may be worth examining it"



Examine Cutscene:
Camera on Hero
Hero says, "hey, I found some strange device!"
Hero says, "I wonder what THIS button does? Something compels me to press it......"
Hero plays animation special_a
Play effect effect_time_gem at phantom_zone_projector1



End Cutscene:
Hero says, "ooopsie"
Ally says, "Hello, I'm Mon-El"
[/spoiler]

I hope I explained all that clearly.
It's not the end of the world if I have to do without the random aspect and have both encounters nailed down to one location, but if there is a way for the second encounter to take place where the first one randomly took place, that would be kewl.

May I also reiterate that EZscript (and by extension FFX) is the best thing since sliced bread.   

   

M25

EZ script won't spawn two encounters on the same marker at the same time. 

It can spawn a second encounter at the same marker if the first encounter has already ended.


Unfortunately, that doesn't help in this case.  EZ script currently can't force one random encounter to appear next to another random encounter.

The easiest thing to do is to skip the random aspect.

There is a trick that would do what you want, but you'd need to cut and paste multiple copies of each encounter. Depending on how long the encounter chain is, this might be more trouble than it's worth.
[spoiler]


# Pick a random branch
Encounter: Choose Location
Next: Choose 1 from PZone1, PZone2, PZone3, PZone4, PZone5, PZone6


Encounter: Pzone1
Type: Examine
Objects: phantom_zone_projector named phantom_zone_projector1
Marker: pzone1
Allies: mon_el
Secondary Objective: "Find and use any other strange artifacts" for 500 prestige and 200 xp

#cutscenes go here



Encounter: Allies1
Type: Alliance
Marker: pzone1
Next: Third Encounter



Encounter: Pzone2
Type: Examine
Objects: phantom_zone_projector named phantom_zone_projector1
Marker: pzone2
Allies: mon_el
Secondary Objective: "Find and use any other strange artifacts" for 500 prestige and 200 xp

#cutscenes go here

Encounter: Allies2
Type: Alliance
Marker: pzone2
Next: Third Encounter

#etc.


#all of the alliance encounters go to this encounter,
# you only need a single copy of it
Encounter: Third Encounter


[/spoiler]

If you don't have an encounter that runs after the Alliance encounters, you'd set the Next: part of each Allies encounter to None

Next: None



joemama

QuoteHow do I convince the game to use the same Alliance Marker that corresponds to the randomly selected Examine Marker?
At the moment it all works, but the Alliance Encounter ends up miles away from the Examine Encounter.

How about "teleport all"?

[spoiler]
Encounter: Alliance Encounter
...
...

Alert Cutscene:
fade 1 second
teleport all allies to hero
unfade 1 second

[/spoiler]

That should bring the encounter to you.

JM

M25

That too. 

I've been out-EZ scripted!   
:blink: 
:o 
:lol: 
:cool:

tommyboy

Quote from: joemama on May 14, 2007, 04:20:14 PM
QuoteHow do I convince the game to use the same Alliance Marker that corresponds to the randomly selected Examine Marker?
At the moment it all works, but the Alliance Encounter ends up miles away from the Examine Encounter.

How about "teleport all"?

[spoiler]
Encounter: Alliance Encounter
...
...

Alert Cutscene:
fade 1 second
teleport all allies to hero
unfade 1 second

[/spoiler]

That should bring the encounter to you.

JM

Thanks, that probably would work, but unfortunately an earlier encounter produces lots of other allies that I don't want teleported to the Hero.
So I tried:
Alert Cutscene:
Camera on Ally
teleport Ally to Hero

but that just seems to hang the cutscene indefinitely.
Since I'm a bit tired now (2:06am local time), I'll leave it for now and try again tomorrow.

M25

Quote from: tommyboy on May 14, 2007, 06:06:30 PM

Thanks, that probably would work, but unfortunately an earlier encounter produces lots of other allies that I don't want teleported to the Hero.
So I tried:
Alert Cutscene:
Camera on Ally
teleport Ally to Hero

but that just seems to hang the cutscene indefinitely.
Since I'm a bit tired now (2:06am local time), I'll leave it for now and try again tomorrow.

It should be
Ally teleports to Hero

The teleport all command only affects characters that belong to the encounter.  If you do a teleport all allies to hero, it won't affect allies from other encounters.






tommyboy

Quote from: M25 on May 15, 2007, 09:13:34 AM
Quote from: tommyboy on May 14, 2007, 06:06:30 PM

Thanks, that probably would work, but unfortunately an earlier encounter produces lots of other allies that I don't want teleported to the Hero.
So I tried:
Alert Cutscene:
Camera on Ally
teleport Ally to Hero

but that just seems to hang the cutscene indefinitely.
Since I'm a bit tired now (2:06am local time), I'll leave it for now and try again tomorrow.

It should be
Ally teleports to Hero

The teleport all command only affects characters that belong to the encounter.  If you do a teleport all allies to hero, it won't affect allies from other encounters.








*in the voice of Mr.Burns* Excellent.....
Thanks again, just saved me about 8 hours of ignorant flailing...

joemama

QuoteI've been out-EZ scripted!

That's a HUGE compliment!

JM

tommyboy

Yay! Thanks guys, that worked like magic!
....it's not magic is it?
'Cause I'd hate to have to burn you at the stake after you've been so helpful...

Boalt92

M25:

Can I use the "Next" or "Starts When" options to specify a story in my freeroam directory?

For example:

Story: Round 1

Encounter: Goons

Encounter: Bad Cops

Encounter: Pinstripe
Next: Round 2

##

Story: Round 2
Encounter: Bacchite
Starts When: Round 1 at End

Encounter: Manbull

Encounter: Pan

(abbreviated, but I think you get the idea)

If not, do you know if having larger story files will affect performance?

Thanks in advance.  Great job on this system!


B92

M25

No, you can't jump to another story like that.

The biggest thing that will slow down the game is the number of different models and textures it has to load and keep in memory (meshes, fx, etc.).

cmdrkoenig67

I guess I'm confused about what actually can and can't be done with EZScript...I'm trying to make my mod using it.  I suppose before I go any further, I should ask (M25 or anyone else who may know) some questions, since I can't seem to find my answers in the tutorials...

Do my mod missions/maps go in the FFX missions folder or into their own seperate mod folder (for a self-contained mod)?

Can musak be played during missions via EZScript?

How about characters/FX/textures/sounds and musak for the mod?

From what you told me in Pms...The character files go into the normal FFVTTR hero file section(I hope that's right), right?

I apologize for my ignorance, but this stuff baffles me...Any help you can provide is much appreciated.

Best.

Dana

catwhowalksbyhimself

I can tell you right now that the game will not work if all the files are not in the normal places.

Now where the story files go I can't tell you, but I can tell you that much.

Since Tommyboy's LSH mod is done in EZScript, I suggest using that as an example.

M25

Quote from: cmdrkoenig67 on June 15, 2007, 05:20:26 AM
I guess I'm confused about what actually can and can't be done with EZScript...I'm trying to make my mod using it.  I suppose before I go any further, I should ask (M25 or anyone else who may know) some questions, since I can't seem to find my answers in the tutorials...

Do my mod missions/maps go in the FFX missions folder or into their own seperate mod folder (for a self-contained mod)?

Can musak be played during missions via EZScript?

How about characters/FX/textures/sounds and musak for the mod?

From what you told me in Pms...The character files go into the normal FFVTTR hero file section(I hope that's right), right?

I apologize for my ignorance, but this stuff baffles me...Any help you can provide is much appreciated.

Best.

Dana

It really depends on what sort of mod you want to make.  EZ script can do mini-mods, campaign mods and freeroam mods.

If you are creating a campaign, I suggest making a copy of the ffx3 folder and renaming it to whatever you are calling your mod.  In other words, put the files in their own mod folder.   Everything, fx, sounds, etc. should be placed within the mod folder.

You'll want to delete the missions that come with FFX and create your own of course.

If you want to make a truly self-contained campaign mod, you'll need to convert your hero files into built-in characters.  I made a tool for that which can be found in this forum.

To play music, you use the "Play Music <name of the music resource>" command inside of a cutscene.

Encounter: Start
Type: Cutscene

Start Cutscene:
Play Music music01_dream1


The actual names you can use are found in the resources tab of FFEdit.





cmdrkoenig67

Thank you, guys...This will help me a lot!  A question about the music part...

Quote from: M25 on June 15, 2007, 10:01:17 AM
To play music, you use the "Play Music <name of the music resource>" command inside of a cutscene.

Encounter: Start
Type: Cutscene

Start Cutscene:
Play Music music01_dream1

Can I have music play during a mission?

Best.

Dana


M25

What I posted does play music during a mission.   The music will continue to play until you ask it to play a different piece of music.


cmdrkoenig67

Oops!  Sorry...I wasn't sure if it would stop at the end of the cutscene or not.  Thank you very much, M.

Dana

Boalt92

On music:
I went to a couple of music production sites, (stream) recorded some of their sample tracks (I know...but they're never leaving my harddrive!), mixed them together into a couple of .mp3 files, and created Music Resources through FFedit.  They work fine in game.

Reading this thread got me to thinking: can you create a jukebox script that changes music when you change maps in a freeroam campaign?

IE:
Encounter: Jukebox
Type: None
Next: Rumble, Creepy, Sci Fi
#------------------------------

Encounter: Rumble
Type: Cutscene
Map: city

Alert Cutscene:
Play music rumble
#------------------------

Encounter: Creepy
Type: Cutscene
Map: sewer, cave

Alert Cutscene:
Play music creepy
#--------------------

Encounter: Sci Fi
Type: Cutscene
Map: space

Alert Cutscene:
Play music scifi


The music tracks should re-start everytime you switch maps.....right?

Just curious.  Not a big deal either way.


B92

M25

That would work for a couple of map shifts, and then it would end.

There's no mechanism for restarting a story when the map changes.  Is it something people would find useful?

|