Aller au contenu

Photo

New to Modding, UPDATED. Help with Scripting/Triggers?


  • Veuillez vous connecter pour répondre
13 réponses à ce sujet

#1
Tari

Tari
  • Members
  • 5 messages

Hi!

 

This is my first post, so pardon me if I put it in the wrong place.

 

I'm trying to make a new scene between the Player Origin and Ostagar, and I'm wondering what's the best way for me to go about that. (I've never really made a mod this big before.) So far, I've gone through some of the tutorials on the Toolset Wiki and have created the area and such that I want it to take place in, but I'm not sure what to do next.

 

Should I start with a cutscene, have the main conversation take place, than another scene and on to Ostagar? Or maybe just have the Player head into the area, have the conversation and leave at his or her leisure?

 

Personally, I would prefer the scene>convo>scene approach, but since this is my first real mod, I'm at a bit of a loose end as to how to really make that happen.

 

Thoughts, opinions, helpful links? Any insight would be thoroughly appreciated!



#2
luna1124

luna1124
  • Members
  • 7 649 messages

Hi Tari,

There are a lot more qualified people that can answer your questions. I don't know anything about scripting. I can however make an override cutscene work (replacing the vanilla scene). Did you create a new module with the toolset? Are you going to make a scene for each origin? It will trigger to play after leaving the origin, but before Duncan shows you the map and takes you to Ostagar? Maybe someone else can help more. :)



#3
Tari

Tari
  • Members
  • 5 messages

Hi Tari,

There are a lot more qualified people that can answer your questions. I don't know anything about scripting. I can however make an override cutscene work (replacing the vanilla scene). Did you create a new module with the toolset? Are you going to make a scene for each origin? It will trigger to play after leaving the origin, but before Duncan shows you the map and takes you to Ostagar? Maybe someone else can help more. :)

 

I did create a new module, which is where my new area is, and the bit of work I've done with a conversation. I was thinking that it would be more of a single scene focusing on what all the Origins have in common (leaving their homes, facing unknown, losing people, etc...).

 

I know this would probably take video editing and such, but ideally I would love for the scene to take place smack dab in between the map and the first scenes at Ostagar, since I'm imagining this as the night before Duncan and the Warden reach Ostagar. (Similar to how the Angelic Vendetta mod breaks up that cutscene.) I know that's wishful thinking, though, and I have enough on my plate for my first mod, lol. Maybe in the future. Otherwise, it would trigger right before the map.

 

Thanks so much for your reply! Trust me, any help is really, really appreciated.



#4
luna1124

luna1124
  • Members
  • 7 649 messages

I know another member was talking about making a mod like this some time ago, but she must have changed her mind because we never heard any more about it.  Good luck, there are a lot of really nice people here and helpful too.

If you have a specific question, it is sometimes easier to get help. :)



#5
Tari

Tari
  • Members
  • 5 messages

Thanks!

 

I guess more specifically, how do I trigger the cutscene? Also, how do I transfer from cutscene to just letting the Player walk around the area and interact with their surroundings? Maybe I'm just missing where it says that in the toolset wiki. I'll keep hunting, and update as I go. :)

 

Also, on a slightly unrelated note, is it possible to use a usually brightly lit area as a nighttime setting? (I'm currently using the area where you first meet Zevran, hoping that if I can make it dark, it will be less recognizable.)



#6
Tchos

Tchos
  • Members
  • 5 030 messages

I'm really rusty with this toolset, but it functions very much like the Neverwinter Nights 2 toolset, so most tutorials that apply to that toolset can also be applied to this one.  For your particular question, I can only give a couple of general suggestions.  You can start a cutscene either by an event or by a trigger.  An event can be entering an area, activating an object, killing a monster, etc.  Well, entering a trigger is also an event, so I guess you can say it's all about events.  With a trigger, you draw the trigger area, and then attach a script to its Enter event to fire the cutscene.

 

Yes, it's possible to turn a day area into a night area, but you'll have to rebake it with the terrible lightmapper.


  • luna1124 aime ceci

#7
Tchos

Tchos
  • Members
  • 5 030 messages

This might help regarding triggers and events:

http://social.biowar...dex.php/Trigger

 

Especially the section on "talk triggers".


  • luna1124 aime ceci

#8
Tari

Tari
  • Members
  • 5 messages

Thanks so much! So the trigger makes the cutscene play once the Player enters the area, but how do I script it so that they go to the area in the first place? Would that be another trigger at the end of the Origin, or a different process altogether?

 

Thanks again! I'll look into some NWN tutorials too, and see what I can dig up.



#9
Tchos

Tchos
  • Members
  • 5 030 messages

Just as a caution, the toolsets aren't exactly the same between NWN and DA, but some of the same scripting works between the two, and the concepts are largely the same, so at least you can get general ideas from the former. 

 

I haven't done this in Dragon Age, so what I say here may not exist, but I would expect that you should start the cutscene first, if that cutscene is in the form of a dialogue file.  Each node, or line of "dialogue", even if there's no dialogue on it, should allow a script to be attached that can, for example, move a character from one place to another, and you can set how long each node should last.  So once you have the cutscene going, you should be able to do whatever you want.  Forgive me if some of this is inaccurate.  I do some very advanced work in NWN2, but my work in DA was quite novice.  Hopefully someone with more direct experience in this toolset can correct any errors or expand on what I said.


  • luna1124 aime ceci

#10
Yara C.

Yara C.
  • Members
  • 240 messages

Until a scripter comes along who could shed more light on this I´ll throw in my 2 cents.

 

As far as I remember all Origins end with a cutscene. The following pre100cs_intro.cut is the bridge scene to Ostagar. Therefore I would try to find out how this scene is triggered.

I could imagine that the cutscene is loaded on an area special event. I don´t know how it is triggered but that would be my approach.

Anyway, you will have to deal with this scene because you want to create a new cutscene which should run between the Origins and the arrival in Ostagar.

 

The cutscene is assigned to the pre100ar_kings_camp area. The cutscene contains a reference to a bink file (a pre-rendered file), layered by Duncan voice over lines (pre_intro.dlg). That is the 'travel over the map' part which fades into the part where the pc, Duncan and -optional- dog arrive in Ostagar.

 

Regarding your first post and your considerations how to build your scenes ('scene-convo-scene approach') I'll try to sum up the cinematic options which are available.

 

1. Bink movie (*.bnk) - You need a Third Party tool to create a bink file, e.g. RAD tools.

Advantage: pre-rendered, quick loading

Disadvantage / to consider: independent of area, should not include the player character and optional followers. Because it is a pre-build, customization will be ignored.

Example for a bink movie in-game: Loghain hires Zevran

A bink file is referenced on the master track of a regular cutscene.

 

2. Conversation cinematics - Could be used for your 'scene-convo-scene' scenario assuming the player should get the possibility to explore the area after the last scene and not between. You have the option to convert a dialog line to a cutscene, including staging cameras etc., to modify the cutscene with the full potential of the cutscene editor. You can even associate a pre-existing cutscene to a dialog node (cutscene must match exactly the dialog line, can not contain more than one line)

More info here on the wiki.

Edit: Tchos covered this already. Should have refreshed the page earlier.

 

3. Cutscene with the full power of the cutscene editor

You can run a consecutive cutscene when a cutscene ends. Or on area exit. What ever. You have several options to run a cutscene, by a physical trigger placed in the area or triggered by various events. Which option will serve best your purpose will probably become much clearer when you will have explored your general options and made a draft concept.


  • DahliaLynn et luna1124 aiment ceci

#11
Tchos

Tchos
  • Members
  • 5 030 messages

I would avoid pre-rendered videos whenever possible (biks).  Disadvantages aside from the lack of customisation mentioned above: For one thing, they're huge, and will add up to a lot of uploading/downloading, and taking up space on the hard drive.  For another, despite their size, they tend to be lower quality (at least the official ones) than the game engine itself, at least at the resolution I run at.  And finally, you would have to get the thing running in the game engine in the first place to be able to record it at all, so you might as well just leave it in the engine unless you're good at making videos in other programs.

 

Since Yara has confirmed that the dialogue functions as I expected it to, you don't need three separate scenes to do what you describe.  All of it can be done in a single dialogue file, with some nodes being cinematics, and other nodes being actual conversation.


  • luna1124 aime ceci

#12
Tari

Tari
  • Members
  • 5 messages


Until a scripter comes along who could shed more light on this I´ll throw in my 2 cents.

 

As far as I remember all Origins end with a cutscene. The following pre100cs_intro.cut is the bridge scene to Ostagar. Therefore I would try to find out how this scene is triggered.

I could imagine that the cutscene is loaded on an area special event. I don´t know how it is triggered but that would be my approach.

Anyway, you will have to deal with this scene because you want to create a new cutscene which should run between the Origins and the arrival in Ostagar.

 

The cutscene is assigned to the pre100ar_kings_camp area. The cutscene contains a reference to a bink file (a pre-rendered file), layered by Duncan voice over lines (pre_intro.dlg). That is the 'travel over the map' part which fades into the part where the pc, Duncan and -optional- dog arrive in Ostagar.

 

Okay, while on my hunt to find the script/trigger/whatever that sets off the Ostagar-Map-Scene, I started with the City Elf Origin as a base. As far as I can remember, the CE Origin ends by a conversation option. (Duncan asks if you want to go, you say yes, cutscene is triggered.) When I open that Dialogue branch, and head to the 'Plots and Scripting' tab, I found the plot 'bec000pt_main' and the flag 'BEC_MAIN_START_PRELUDE'

 

After finding the corresponding .nss file (bec000pt_main.nss) and the right flag I found this: (spoiler tagged for length)

 

Spoiler

 

Right there, under '//jump to king's camp' is an Area Transition, so I think maybe I found the script/trigger I was looking for? If so, I imagine I would change that to my new area/waypoint?

 

Thanks!!


  • luna1124 aime ceci

#13
Tchos

Tchos
  • Members
  • 5 030 messages

For clarity, I use the word "trigger" to refer to the polygonal regions that you draw in a game area which can have scripts attached to them, and not to refer to the act of starting a script.  I use the verb "fire" for that latter purpose.  A trigger, as I previously linked, is a specific kind of object in the game, and using the word to refer to any kind of event firing off can be confusing to a novice modder, and makes it harder to explain things.

 

What you are referring to in the script above (UT_DoAreaTransition(PRE_AR_KINGS_CAMP, PRE_WP_START); ) is called a function or a command, not a script or trigger.  And yes, you would change the two items in the parentheses to refer to your area and waypoint.  But the area and waypoint has to be defined somewhere.  It appears that the function quoted uses variable constants that are defined elsewhere for that purpose, so you'll need to find how they're defined so that you can define your own.


  • luna1124 aime ceci

#14
Sunjammer

Sunjammer
  • Members
  • 925 messages

Because there is a area transition involved you can approach it from either end by a. changing something on the departure side or b. changing something on the arrival side.

 

As you have already determined the departure is triggered by the UT_DoAreaTransition(PRE_AR_KINGS_CAMP, PRE_WP_START); line which should appear in the main plot scripts for each of the origins. Replacing the function's parameters with values for your own area and waypoint will allow you to add a detour to the way to Ostagar. While this is a straightforward change, the disadvantage of this approach is that you have to override the main plot for each of the six backgrounds (bdc/bdn/bed/bec/bhm/bhn000pt_main) making your mod incompatible with any other mod that overrides any one of these. Moreover your mod would not be compatible with any additional community origin mods (unless you provided an override script for them).

 

On the arrival side, the "travel to Ostagar" cutscene is contained in Cailan's default conversation (pre100_cailan.dlg) which is started by making Cailan talk to the player when they enter Ostagar for the very first time. You can see this in the EVENT_TYPE_AREALOAD_SPECIAL event of the pre100ar_kings_camp script (at line 70 where you have UT_Talk(oCailan, oPC)). Adding an additional clause to that if/else if block would allow you to redirect the player on arrival and before talking to Calin. To do this you would have to have your own plot flag to ensure the redirection only occurred once. While this approach would be incompatible with other mods that override the pre100ar_kings_camp script it would be compatible with mods that override the origins' plot scripts and would automatically support additional community origin mods. Also you only have one script to modify and maintain.

 

If you used the latter approach, lines 58 to 76 could be replaced by something like:

            if(!WR_GetPlotFlag(PLT_MY_PLOT, MY_PLOT_FLAG))
            {
                // quick detour to my "on the way to Ostagar" mod
                WR_setPlotFlag(PLT_MY_PLOT, MY_PLOT_FLAG, TRUE);
                UT_DoAreaTransition("my_area_tag", "my_waypoint_tag");
            }
            else if(!WR_GetPlotFlag(PLT_PRE100PT_DARKSPN_BLOOD, PRE_BLOOD_PLOT_ACCEPTED)
            && !WR_GetPlotFlag(PLT_ZZ_PREPT_DEBUG, DEBUG_JUMP_TO_CAMP_DAY)
            && !WR_GetPlotFlag(PLT_ZZ_PREPT_DEBUG, DEBUG_DEMO2))
            {
                // Did not get one of the initial plots -> did not leave the area yet -> this is the first time the player enters
                UT_Talk(oCailan, oPC);
                WR_SetPlotFlag(PLT_COD_CHA_CAILAN, COD_CHA_CAILAN_MAIN, TRUE);
                WR_SetPlotFlag(PLT_COD_CHA_LOGHAIN, COD_CHA_LOGHAIN_MAIN, TRUE);
                WR_SetPlotFlag(PLT_COD_CHA_LOGHAIN, COD_CHA_LOGHAIN_QUOTE, TRUE);
            }
            else if(WR_GetPlotFlag(PLT_ZZ_PREPT_DEBUG, DEBUG_DEMO2) == TRUE)
            {

Note that regardless of the approach you choose you should include your new area in the pre01al_kings_camp area list so that it is loaded into memory along with Ostegar. This will speed up the transition between the two and avoid a loading screen (just the "Loading ..." message in the bottom right of the screen. Unless of course you want the loading screen to, for example, display a load hint.

 

There are other, more exotic, solutions that could be considered (such as overriding Cailin's conversation or dynamically replacing him) however they require considerably more effort and may not be any more compatible or robust!


  • luna1124, DarthGizka et sapphim aiment ceci