Aller au contenu

Photo

Mostly conversation editor questions. Everything now solved and the protagonist has a head. :)


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

#1
Firky

Firky
  • Members
  • 2 140 messages
Edit: New questions are in post at bottom of thread.



Edited: 2 new questions here. Thanks for help so far. Coming along.

I'm experimenting with these 2 things at the moment. I've had limited success with 1, and none with 2.

1. Is there some way to mark lines of a conversation "show once?" Not all lines in a conversation, but some lines? It gets more complex, but let's start from the beginning. :P

2. Is there a way to trigger a slide from some kind of tripwire as you walk across it? Any links to info related to that?





Hi.

Firstly. Just trying to generate a character who is female and wearing templar armour. This script generates a woman with no hair and commoner clothes. (What I have entered next to "EquipItem" seems to be Templar armour in the inventory selector, but it's not showing templar armour.)

I've been searching for a solution for hair (can you select a face morph in here somehow, I really just want any female head with hair for now, I ain't picky) but thought someone might just be able to look at this and go, "Oh, easy, you need x." I'll keep searching.

Posted Image

Secondly. I have 5 actors on a stage. The play you participate in is started by talking to Accuse. (He's actually a rage demon, dressed up as a Templar, don't ask.) Anyway, I was doing this thing where, if you talk to the other actors first, they say "Hi" and direct you to Accuse. Then, after they've said "Hi", and if you talk to them again, they say, "Go talk to Accuse" more directly. Then, after you have talked to Accuse, they start up with their main dialogue.

For all characters except Pride, this three step beginning to the conversation works. I set the first line of dialogue to be Condition False, met_(whichever character it is), then at the end of the "Hi" dialogue, an action to set met_(whichever character it is). The second line is set to be Condition False, find_blood_mage, which is the main quest triggered at the end of Accuse's first conversation.

Something else that is working is that, during Accuse's first 4 lines, I made actions set to met_(all other four characters) and now their first two lines of dialogue don't trigger at all unless you meet them before Accuse. (Which is nifty. I like it.) The only person who seems to be totally stuck on their first little run of dialogue is Pride. She doesn't progress past the first bit at all. Here is a screenshot. Any ideas?

Posted Image

Modifié par Firky, 08 mai 2012 - 06:04 .


#2
Craig Graff

Craig Graff
  • Members
  • 608 messages

Firky wrote...


Hi.

Firstly. Just trying to generate a character who is female and wearing templar armour. This script generates a woman with no hair and commoner clothes. (What I have entered next to "EquipItem" seems to be Templar armour in the inventory selector, but it's not showing templar armour.)

I've been searching for a solution for hair (can you select a face morph in here somehow, I really just want any female head with hair for now, I ain't picky) but thought someone might just be able to look at this and go, "Oh, easy, you need x." I'll keep searching.

Posted Image

 
It's been a while since I've looked at this sort of thing, but I suspect that the core Chargen scripts are overwriting
your customization attempts. One way to fix this should be to move your HandleEvent(ev, RESOURCE_SCRIPT_MODULE_CORE) call above the switch statement.

#3
Firky

Firky
  • Members
  • 2 140 messages
Hi. Thanks for reply.

Firstly. I copy pasted the script from - somewhere - probably the wiki. I have a basic understanding of it, but "basic" is the correct word, so apologies if I'm not understanding correctly.

I believe I correctly moved it as you said. There was no change.

However, I also simply tried to change female to male to see if there was a change and there wasn't. I do seem to have a problem exporting changes. (This might be the problem with the convo file, too, because I definitely saved it at least once before adding the conditions and action. Also, I was trying to load slides into conversations which suddenly stopped exporting correctly, too.)

I've been exporting single files with and without dependent resources - makes no difference. I've had more luck - but not universally, and not in this case, with selecting every file in the module and exporting together.

Although it doesn't solve my possible export problems, what I did manage to do was create a whole new script and load that instead. But the changes you suggested still generated - Jadena. (Unless I moved it wrong.) A second try at this generated Jaden, so at least I can create new scripts.


Edit: Does anyone know of any export glitches or anything - and how to fix them? Making a new script is no drama. But that Pride conversation is 2000 words of confusing branching and conditions/actions everywhere. She's, like, the person who drives the whole play and what happens. I don't think I can face writing it again, from scratch. (And, although the structure is mostly there, she would benefit from testing and a thorough polish. It's not like I can just do one attempt at a dialogue file and expect it to be perfect. :P I really hope I'm just doing something stoopid.)

Modifié par Firky, 11 mars 2012 - 09:52 .


#4
Sunjammer

Sunjammer
  • Members
  • 925 messages
I believe the source of this script is the wiki's Character generation page. It is handy for testing but isn't really intended for a final module, for example, because of the issues caused by skipping character generation. However there is no need to move the HandleEvent block as Craig suggests: the script should work fine as written. In fact if you moved the HandleEvent block too far up it could cause a syntax error and prevent your script from compiling (more on this later).

The pre-set name, head morph and lack of hair are due to skipping character generation. If this is an issue then either allow character generation, allow the player to import a character or, if its for a cutscene video, simply have an NPC play that part as well. If these aren't an option then I believe (but have never tested) that you can get round this by creating a creature with the appearance you like, exporting it and rename it/move it so it overrides default_player.utc. See this thread for details.

I'm AFT at the moment but I seem to recall Templar amrour restricted to Templars. There may also be minimum requirements that your new level 1 character doesn't meet. If either of these do exist then that would be a reason why your character won't equip the Templar armour. Nonetheless it should be in the party inventory and if not there is something else going wrong. Assuming it is being created possible solution would be to create some new armour which has the Templar armour's appearance but none of its restrictions and use its resource name in your script.

With regards to your conversation issues all I can say is check your condition and action are checking/setting the correct flag in the correct plot then save and export.

If you are having, or think you may be having, export issues then open the log (if you haven't already). It will tell you what it tried to export, what was exported, what failed and what was skipped. It will also flag any errors or warnings (you can right click on the log window for filter options) which can usually give you an insight into why something failed. If, for example, you had moved the HandleEvent block above the int nEventHandled = FALSE; line then the script wouldn't compile and the log would flag up a (somewhat misleading) syntax error.

If you have errors in your log that you don't understand post them and there's a good chance someone in the community has encountered it before and can tell you what the real issue is and how to fix it.

Modifié par Sunjammer, 12 mars 2012 - 01:37 .


#5
Firky

Firky
  • Members
  • 2 140 messages
That stuff about the templar armour makes complete sense. Hadn't even thought about restrictions etc. (Am somewhere between testing and trying to get it to a more finished stage.)

Thanks for reply. I'll give it another shot tonight.

#6
Firky

Firky
  • Members
  • 2 140 messages
Yeesh. OK. That was a good thread. Seems I suck at following basic instructions though.

It took me an hour, but I managed to make a female character, run the Jaden script for the module, export the script and character files, and then move and rename the .utc file to default_player.utc, put it in the override folder, and yes, she loads. She has hair. But the ugliest default armour I've ever seen. Her Templar armour (which I put on the character) is in her inventory but requires 22 str.

So - either raise her strength or make weightless Templar armour? Any instructions? I'm stuck.

On the second thing - the convo file. Solved! I'm stoked! Yes. The log (which I'd disappeared and forgotten about, for some reason,) said export of that file failed.

E: 20:36:11 - pride3.dlg - Exporter FAILED for resource: pride3.dlg
E: 20:36:11 - pride3.dlg - Export failed due to errors in the conversation
E: 20:36:11 - pride3.dlg - Line 90: Line references a plot but has no plot flag selected
W: 20:36:11 - pride3.dlg - Line 133: Line is at the end of a conversation but is not an End Dialogue node

I had an unfinished flag in the third part of the conversation because I was going to test things and come back to it. (I have a zillion interlocking flags and this one isn't important.) I figured it didn't matter but I guess the whole file refuses to export unless it's all good. I don't know what the last message is there, but it's now working!

Many, many thanks. If there are any easy ideas about how to change her strength to 22 or make weightless armour, let me know. Otherwise, I'll start looking into that next. :P

(I promised myself I'd actually make this silly thing playable. It's really just a collection of conversations, as I was learning the editor. Doesn't seem worth the effort. On the other hand, I'm really enjoying getting more of a handle on the other bits of the toolset, even if it's as basic as reading the log. :P)

#7
BloodsongVengeance

BloodsongVengeance
  • Members
  • 590 messages
heyas;

was line 133 a red stop icon or a yellow caution icon? because i don't think the 'not end dialogue node' causes it to fail. and, all that means is, you ended the conversation on the npc talking, and not the pc. just add an empty reply to that line and it will be fixed.

as for the plot flag, can you... turn off the reference to the plot for testing? put it back when the plot is done?

#8
Sunjammer

Sunjammer
  • Members
  • 925 messages

BloodsongVengeance wrote...

heyas;

was line 133 a red stop icon or a yellow caution icon? because i don't think the 'not end dialogue node' causes it to fail. and, all that means is, you ended the conversation on the npc talking, and not the pc. just add an empty reply to that line and it will be fixed.

It was the latter. You can tell by the W prefix in the log output. The first letter represents the type of icon. The prefixes/icons are:
  • S = summary (white information icon)
  • E = error (red stop/critical icon)
  • W = warning (yellow caution icon)
  • I = information (white information icon)

Firky wrote...

Edited: 2 new questions here. Thanks for help so far. Coming along.

I'm experimenting with these 2 things at the moment. I've had limited success with 1, and none with 2.

1. Is there some way to mark lines of a conversation "show once?" Not all lines in a conversation, but some lines? It gets more complex, but let's start from the beginning. :P

2. Is there a way to trigger a slide from some kind of tripwire as you walk across it? Any links to info related to that?

1. Select the line that you only want to "show once", click on the Plot and Scripting tab and in the Line Settings section you can select "once per conversation" or "once per game" from the Visibility drop-down list.

2. I take it you want the "tripwire" to be invisible and not an actual tripwire placeable used by some of the traps (though you could do that to). The way to do that is create a custom trigger resource which starts a custom slideshow "conversation" as I mentioned in one of your earlier threads. I suspect you're going to want to know how to do that so I'll go rustle up a quick step-by-step guide after I've posted today's Weekly Digest.

One last thing, please resist the temptation to use this forum to advertise you module (that's what the Announcements and Recruitment forum is for). Ideally the title of your thread should reflect the questions/issues/topics being discussed so that any modders that come after you have a better chance of finding the information you are hopefully benefiting from.

Modifié par Sunjammer, 14 mars 2012 - 07:28 .


#9
Firky

Firky
  • Members
  • 2 140 messages
(Don't worry. Ha. There's no temptation to advertise. Can't actually picture releasing it. Except to a couple of friends. Moment of madness and trying to edit the topic rather than make a new one. But what you say makes perfect sense for a useful forum.)

On 1. Whoops. I was doing it with links. That's much better. I'll consider that a solve.

On 2. Yeah. Invisible. Don't worry if you're busy. I'll have a look too. (Slowly.)


@Bloodsong - Not sure what you mean, but being able to have the plot there, in the convo file, and it not actually fire would be useful. That's what I was trying to do.

#10
Sunjammer

Sunjammer
  • Members
  • 925 messages
- Create your slideshow conversation: I think this post covers that but let us know if you have any issues.

- Create a new trigger resource: Either select File > New > Trigger from the Toolset's Menu Bar or right-click in the Palette Window and select New > Trigger. Enter a Name (you might find it helpful to give it the same name as the slideshow it is to start) and click the Okay button.

- Create and assign a new trigger event script: With the trigger resource open, click on the ellipsis button (...) in the trigger's Script property. When the Resource Open/Save window opens, click the New button. Enter a Name (again you might find it helpful to give it the same name as the slideshow it is to start) and click the Okay button.

- Add the actual code to the event script: Either right-click on the trigger's Script property and select Open Resource or open the Scripts tab in the Palette Window, locate your new script and open it. Insert the following code:

#include "wrappers_h"

void main()
{
    int bEventHandled;

    // deconstruct event
    event evCurrent = GetCurrentEvent();
    int nEventType = GetEventType(evCurrent);

    //--------------------------------------------------------------------------
    // Handle Specific Events
    //--------------------------------------------------------------------------

    switch(nEventType)
    {
        //----------------------------------------------------------------------
        // EVENT_TYPE_ENTER fires when any creature enters the trigger
        //----------------------------------------------------------------------
        case EVENT_TYPE_ENTER:
        {
            object oCreature = GetEventCreator(evCurrent);

            if(IsHero(oCreature))
            {
                BeginSlideshow(R"slideshow_conversation.dlg");
                DestroyObject(OBJECT_SELF);
            }

            break;
        }
    }

    //--------------------------------------------------------------------------
    // Unhandled Events
    //--------------------------------------------------------------------------

    if(!bEventHandled)
    {
        HandleEvent(evCurrent, RESOURCE_SCRIPT_AREA_CORE);
    }
}

- Replace the placeholder: in the above script slideshow_conversation.dlg is a placeholder and must be replaced with the full name (including the ".dlg") of your slideshow conversation.

- Paint the trigger into the area: open the area you want to display the slideshow in; select your new trigger in the Palette Window and click on the ground in the area. As you move the mouse a green line will follow it, click on the ground to define one edge of the trigger. Repeat as require and double click to close the trigger's outline. The outline will be replaced by a blue shape with yellow spheres at each corner. Use the yellow spheres to reshape or resize the trigger as required.

- Save and Export Resources: save and export your area, slideshow conversation, trigger and script.

Modifié par Sunjammer, 15 mars 2012 - 08:41 .


#11
Firky

Firky
  • Members
  • 2 140 messages
Many thanks for your time. Those look like instructions I can follow. And there's lots of new stuff for me to learn in there, too. Which is fun. I'll let you know how I go in a day or two.

#12
Firky

Firky
  • Members
  • 2 140 messages
!!!

Right first try - which is obviously a testament to clearly written instructions. My slides are all stretched wrong, but sizes were in the other thread. That'll be next.

Edit: Typically, though, I can't seem to get them the right size. They show a small portion in the middle of the image....

Edit again. Sigh. OK. When I was manipulating the image, I pasted something and didn't realise it slightly changed the ratio.

Got it to a point I'm happy with. Thanks again!

Modifié par Firky, 22 mars 2012 - 11:03 .


#13
Firky

Firky
  • Members
  • 2 140 messages
So. With regards the script three posts up...

I wanted to trigger a conversation from a trigger, instead of a slideshow. Wishfully thinking, I simply substituted BeginSlideshow with BeginConversation, and followed all of that above procedure, but it's incorrect. The log message I get reads, E: 18:49:28 - convo.nss - convo.nss(26): Declaration does not match parameters (BeginConversation) (while compiling var_constants_h.nss)

I have to mess with a variable? There's TALK variables of various kinds, but not sure how to mess with them.

Edit: Oooh-kay. Got it. Set Variable 2da to VAR_TRIGGER_TALK and then pop the .utc file name into the variable speaker slot. Oh, and the generic (?) script thingo from here. http://social.biowar...-2668090-1.html

(This toolset gets oddly more intuitive with time. It's cool like that. Forgive the dumb questions.)

Modifié par Firky, 11 avril 2012 - 09:16 .


#14
Sunjammer

Sunjammer
  • Members
  • 925 messages
The reason the script failed to compiled when you swapped the functions is because the functions have different parameters.

BeginSlideshow requires you provide the slideshow conversation resource for its one and only parameter.

Conversely BeginConversation requires you to provide the two objects (usually an NPC and the hero) and optionally the conversation resource as its parameters. If you omit the final parameter (the conversation resource) the creatures default conversation used.

Modifié par Sunjammer, 11 avril 2012 - 01:27 .


#15
Firky

Firky
  • Members
  • 2 140 messages
Thanks for all help so far.

NUMBER 1

Surely there must be a way to do this. What that way is eludes me.

What I want to do is - When a plot flag is set, a trigger "appears." (Like the blue thing you paint - which then fires off a slideshow, which I do know how to do, thanks to this thread.)

So. Flag A, B, C or D is set, Trigger 1 appears. But, Flag E is set, Trigger 2 appears. (Invisibly.)

Or, if necessary, just Flag "A" to Trigger 1 and Flag E to Trigger 2. I can mash down the 4 other flags to all be a version of just "A" in the last conversation if I have to.

Or, at worst case, is there a way to just turn a conversation directly into a slideshow? I don't want to do this. I want to finish the conversation, let the player read the journal, take a few steps and step on either Trigger 1 or Trigger 2, which are drawn as concentric rings around the protag. Only one trigger will "work."

Pleh. Any ideas?

NUMBER 2

Also. Changing the appearance of a talkie, non-companion NPC. This guy you talk to dies during dialogue but you keep talking to his body. (Not as creepy as it sounds. He's an actor in a play.) If necessary, I can hide a body, as prop, in the corner of another room and make a camera look down at the body and pretend its him for the rest of the conversation. But, it doesn't look right when the play continues (you break his conversation) and he's standing again.

Sigh. Assuming I can change his creature's appearance based on a flag, or something, then there's an "Intermission" to the play which is highly reactive to how you're ordering your path through the game. So, when the intermission is triggered, this guy may or may not be "dead." If he's dead, I want him to be standing again and then a body again afterward.

I'm reconcilled to the idea that this may not be possible. I'm sure it is, but I don't have the nouse for it? Any ideas?

Modifié par Firky, 30 avril 2012 - 11:04 .


#16
AmstradHero

AmstradHero
  • Members
  • 1 239 messages
NUMBER 1

I would have thought you could have one conversation slideshow and just have different nodes with conditionals to check for the plot flag you want?
i.e. You'll have 5 conversation nodes at the same, each with a conditional to determine whether it should fire.
If this doesn't work for some reason (or becomes too messy to handle), then you can accomplish it via scripting and have 5 separate slideshows. The easiest way would be to create a new trigger blueprint with a custom script. On player entry, have it check the plot flags you're interested in, and then fire off the appropriate slideshow.

NUMBER 2

Here's where you want to use some smoke and mirrors. Create two instances of the actor blueprint in the level.

Set a variable (It's SPAWN_DEAD or something like that) so that one of them is "dead" (you may also want to make them non-interactive) and place the other one as normal. Give the two instances of the creature different tags so that you can play with them in scripting. All you need to do is a plot that you can repeatedly set the flags for - make sure you create two flags and make sure the "repeatable" option is set.

One flag will set the dead actor's state to active:
e.g. SetObjectActive(GetObjectByTag("deadactortag"), TRUE);
It should also use the same function to disable the "live actor" - by passing FALSE.
The other flag should do the opposite - enable the live actor and disable the dead actor.

Then you can call these two flags via scripting or dialogue as you choose.

#17
Firky

Firky
  • Members
  • 2 140 messages
Hi Amstrad. Thanks for help.

I hadn't even thought of the slideshow having conditions, for some reason. That makes perfect sense. And that's really simple. It totally sounds like it should work. Shall try tonight and report back.

Hmm. I think I get your dead body instructions. But I do want to be able to start another conversation with him after he's dead. Which might screw that up. But, that's a good idea to start with. (I was blank.) I'll try.

Thanks heaps!

#18
Firky

Firky
  • Members
  • 2 140 messages
Nice one. NUMBER 1 nearly works. Now the player can run over and over the trigger until they meet a condition and it fires.

Strangely, the slides themselves aren't showing. The slideshow dialogue is. But I'll have a muck around and see what's up with that, next.

Edit: Got the slides working. I simply needed to put dialogue in the conditional line and then link the 4 different conditional lines back to the second line. I was trying to do it with comments but, for some reason, a conditional line with no dialogue doesn't show the slide.

Modifié par Firky, 01 mai 2012 - 09:23 .


#19
Firky

Firky
  • Members
  • 2 140 messages
With number 2 - I've made some progress, but (after 4 hours) haven't managed it.

I have a dead body who looks like the character. He's currently lying next to the alive version in the area. Their names are desire.utc and desire_dead.utc (He's a desire demon.)

I have a plot called DEAD_OR_ALIVE and two flags DEAD and ALIVE

I've tried to find/write/edit a couple of scripts, and I've tested the ones that haven't gotten a nasty red cross in the log, or crashed my toolet, but I really have no idea what I'm doing. I think I know how to make the script fire from the plot, and I know how to make the plot repeatable, and how to set it as an action in the convo editor, but the script must be wrong, because it's not being handled and going to the core script.

I can't find an example of a script like this. That deals with SetObjectActive from a flag.

Any ideas - examples, gratefully accepted.

(Please excuse my lack of understanding scripting. I'm actually starting to learn some of the basics, enough to experiment and try for 4 hours, anyway. But, I was really just trying to make a playable module around the stuff I didn't know. It's totally a scratch together effort. But, by far its worst crime is saying that this guy is dead and then leaving him standing there.)


PS. My latest efforts have been trying to change a copy of plot_core. It occurs to me that I might need a defined flag. I've been trying with a main. I haven't actually used defined before? Is that what I'm doing wrong?

Edit: Eeek. Also. I think I'm having this problem. http://social.biowar.../8/index/488914

Currently log is telling me that there is "no right bracket on expression" on a line.

I reinstalled DAO and the toolset before staring this small module. I'm too scared to patch it. :P (But that's a problem for another day, hopefully. I wonder if I can just make a new script, for now.)

Edit: (Whoops. There was no bracket. But when I put it in, toolset crash. Blerg. Tomorrow.)

Modifié par Firky, 01 mai 2012 - 01:17 .


#20
AmstradHero

AmstradHero
  • Members
  • 1 239 messages
First: don't make any changes to plot_core or any of the _core scripts. That can make BAD THINGS happen.

What you need to do is to create a new script associated with your plot and have it trigger actions when flags of that script are set.

1) Create a new script.  Call it whatever you like, but I frequently name the same as the plot. so DEAD_OR_ALIVE in this case.

2) In the scripting window, click the fourth icon on the little window next to the main script editing area. f() is all the available functions (very useful!), X is variables (won't use this often, if ever), C is constants (useful for functions where you need to pass particular constants like an object type or the like) and the paper icon is for script templates. That's the one you want

3) Double click "custom plot events.txt". This will automatically create a script template for a plot.

4) You'll see //#include "PLOT_NAME_GOES_HERE" up the top of the script.  Remove the double slash and change the plot name to PLT_PLOTNAME - in your case - PLT_DEAD_OR_ALIVE. This allows the script to read plot flags from the plot.

5) You'll see two "switch(flag)" statements.  The first one is the one you're interested in, because that deals with normal flags. The second one is for defined flags, which allow you to check a complex series of variables and then return TRUE or FALSE. This is more likely to be used for complex dialogue conditionals than anything else. You want flags that you can set and make things HAPPEN, so you want the first one.

6) Add a new handler for each plot flag: this will look like
case DEAD:
{
ACTION CODE GOES HERE!
}
break;

case ALIVE:
{
ACTION CODE GOES HERE!
}
break;

7) The blueprint names aren't important. What's important is the TAG assigned to the creature. These must be unique in order for you to get the behaviour you want,. The tag appears in the properties of the object when you select it in the area editor.  Assuming that the tags are "desire" and "desire_dead", you'd probably want something like:
case DEAD:
{
SetObjectActive(GetObjectByTag("desire_dead"), TRUE);
SetObjectActive(GetObjectByTag("desire"), FALSE);
}
break;

case ALIVE:
{
SetObjectActive(GetObjectByTag("desire_dead"), FALSE);
SetObjectActive(GetObjectByTag("desire"), TRUE);
}
break;

8) Save your script. Assuming you've done everything right, it should compile fine and not throw any errors. If it does, make sure that you've got the plotname correct in the include line, and that your plotflag names are the same as in the plot. Make certain that those "break;" lines are in there too. If they're not... then you'll get weird and undesirable behaviour in the game.

9) Open up your plot (if you haven't already).

10) In the script property, click the ... button on the right. You'll have to click on the row first before they'll show up.

11) Navigate to the new script you just created, and double click on it. That will assign it to be used to handle events from this script. Anything not explicitly handled by the script will still be passed to plot_core. The script name should appear in the properties sheet as well.

12) Set the plot flags from within conversation at the desired points to enable/disable the alive/dead version of the desire demon.

That should be all that is necessary to get it to work.

Modifié par AmstradHero, 01 mai 2012 - 01:21 .


#21
Firky

Firky
  • Members
  • 2 140 messages
Bahahaha. It works. My desire demon actor is now yoyo-ing up and down as he dies in the play, takes a break for intermission, and gets into a verbal stoush with an audience member. (It's a highly silly story.) And, by setting desire's conversation also to desire_dead, you can talk with the "dead" body too.

Thanks Amstrad!

I was actually fairly close. (Because that script template is similar to plot_core, obviously.) But I was trying to get the actual flag first. And I wasn't using the breaks.

Also, I had no idea there were script templates. I've been looking through them and they're great. And I just learned some more stuff.

#22
AmstradHero

AmstradHero
  • Members
  • 1 239 messages
Happy to help, and glad it worked. I'd certainly be interested to check out what you've done once it's completed!

The script templates are great, but there are a few constants that are missed. EVENT_TYPE_TEAM_DESTROYED in an area script is the first one that comes to mind, and that has been a handy constant on more than one occasion.

#23
Firky

Firky
  • Members
  • 2 140 messages
Last two questions. I'm pretty sure. (Thanks for lots of help.)

1. Is it possible to set too many triggers on top of each other? Those 4 conditions setting off one slideshow and the 1 setting off the other slideshow work fine. I exactly repeated the process and lay two more triggers over the top of the original two. These second two don't work at all.

2. These two slideshow triggers ^ that do work. Is it possible to concurrently make them transport the player to a different room in the same area? I've written the waypoint tag in next to TRIGGER_AT_DEST_TAG and the area tag in for TRIGGER_AT_DEST_AREA_TAG. Obviously that's too simple. It doesn't work. :P Any ideas? Which doesn't involve laying a 5th trigger on top of this mess.

PS. Just to be as explicit as possible - for no 1. The reason for layering the triggers is that it's a play. There is only one stage. The player always delivers her lines from slightly off centre right, so that is where she always is located at the end of any major conversation. I've put the triggers directly around where she is standing to trigger slideshows for good ending, bad endings, intermission and end of intermission. There may be a better way to do this, if layering triggers, for slideshows with different flag conditions, is indeed the problem.

Modifié par Firky, 04 mai 2012 - 11:48 .


#24
AmstradHero

AmstradHero
  • Members
  • 1 239 messages
I haven't tried to layer lots of triggers on top of each other, so I'm not sure how that would work.

I think you may actually be getting into the territory where you just want ONE trigger, and then use defined plot flags to determine what course of action to take.

Okay, so... Defined Plot Flags.

Defined Plot Flags are NEVER "set". You can't use WR_SetPlotFlag() and you can't set them in the conversation editor. Instead, you use these to check more complex situations.

So remember how I told you that in the second section of a plot script, the second switch statement was for defined plot flags. So what you need is a plot with several defined flags. In order to add a defined plot flag, you need to press CTRL-D in the plot editor, instead of CTRL-M for a "main" plot flag.

Based on what you've said, you'll want 5 of these: Good ending, bad ending 1, bad ending 2, intermission, and end of intermission.

Now, you'll need case statements for each of these plot flags, of course with breaks after the braces {} for each one.

The purpose of defined plot flags is to check other plot flags and then return TRUE or FALSE.  The idea is that you can only check a single plot flag in a conversation conditional, so you use a defined flag to do more complex processing. So, if you only want a line to show if: The player is a dwarf, the player is female, and the player is currently in a romance with NPC X, a defined flag is probably the best way to do it.

The trick is to query other plot flags (you'll need to #include them up the top if they're from other plots) to determine whether this flag should be true.  I'll demonstrate with an example:

case DWARF_FEMALE_ROMANCING_NPC:
{
    if ( (GetCreatureRacialType(oPC) == RACE_DWARF) &&
         (GetCreatureGender(oPC) == GENDER_FEMALE) &&
         (WR_GetPlotFlag(NPC_ROMANCE, PLAYER_IS_ROMANCING) )
    {
         nResult = TRUE;
    }
}

So basically, you check the various flags you need to check, and if the appropriate criteria are met, then you set nResult to TRUE.

Now, while you can't use WR_SetPlotFlag() with defined plot flags, you can use WR_GetPlotFlag(), because this will run the script to check the conditions and then return the result you want.

So I imagine what you'll want to move to is a single trigger with a custom trigger script. You'll want to modify the on_enter event to provide the behaviour you need. On enter, you'll want to do a series of layered if statements checking each of the defined plot flags you created. Then create custom behaviour to occur if these flags are true:

So in the EVENT_TYPE_ENTER, you'll probably want to check to make sure that it's the PC that's entering, and if so, have a series of statements like:
if (WR_GetPlotFlag(PLAY_STATE, GOOD_ENDING)
{
//run good ending
}
else
{
    if (WR_GetPlotFlag(PLAY_STATE, BAD_ENDING_1)
    {
        //run bad ending 1
    }
    else
    {
        if (WR_GetPlotFlag(PLAY_STATE, BAD_ENDING_2)
        {
            //run bad ending 2
        }
        else
        ... ///You get the picture
    }
}
If you need to move the player instantly to a location (though if you're running a slideshow, I didn't think the player's location mattered), UT_LocalJump or UT_PCJumpOrAreaTransition should do the trick.

Modifié par AmstradHero, 05 mai 2012 - 01:05 .


#25
Firky

Firky
  • Members
  • 2 140 messages
Blurg. Thankyou so much for your time.

I started trying to put the script together, but the actions that I currently have working with the triggers to slideshows do other stuff, too. Like, they have journal entries and are set by choosing dialogue.

Still thinking ....

(But thanks so much for your time. I learned something about defined flags, there.)


PS. The slideshow where I want to move the player is so that they see The End slideshow and are then dumped away from the play and into their bedroom. There's heaps of journal entries to collect and they may be quite different depending on the path taken through the mini-mod, so I thought the player might like to review the journal after The End. Especially if they get the bad ending and want to try for the good. Trying this bit now.

Edit: OK. I got the original plan working. With the layered triggers. It's not absolutely ideal, because each conditional trigger flashes every time you walk over it, which is bad, but my mod commits worse crimes. It will do.

FYI - Here is how I did it. (But, like I said, it's a scratch solution, not really something someone would likely actually want to use.)

So, in the original script for triggering a slideshow that Sunjammer posted, I had to remove the line, DestroyObject(OBJECT_SELF); in order for the player to be able to run over the ending scripts multiple times, so the trigger was still there when they met the conditions. (At least it worked when I removed DestroyObject, so I assumed that is what happened.) The intermission slide is triggered by a flag and works exactly the same way. I'd already removed DestroyObject. The condition that sets it, however, wasn't cleared. So maybe it wasn't firing because you'd be perpetually stuck in the slideshow. So I made a new plot for the intermission slideshow so that I could cancel the slide's flag immediately, before the end of intermission. And now it works. Yay.

No, hang on. That makes no sense. I never cancelled the flags for the endings, yet they show and after they show, you can run around over the trigger again.

Whoa. I have no idea what I did. But it works. Lets go with that. Until it fails.

Edit: Ohhh-kay. It failed again. But the failure helped me figure it out. It failed to trigger the Act 2 slideshow because I haven't set a stage there yet and the PC snapped out of the flag setting conversation on top of the trigger. When the PC is positioned so that she has to walk/run a few steps before hitting the trigger it fires, but not when she pops out of conversation on top of it. Which is why the concentric rings for the ending slideshows consistently worked.

I hadn't considered this because I begin the minimodule with a slideshow. How did I make the slideshow work? I put a trigger for it on top of the waypoint where the PC starts. So, I figured if that worked, popping out of a conversation onto the top of a trigger would be fine. Evidently it isn't.

(But, I'm happy. Still need to do the last transition or jump or whatever, then I'm done - after some serious dialogue polishing. Also. I'm so glad I found the find and replace function. I'd spelled the word "elicit" wrong about 70 times. Not exaggerating. :P)

THANKS FOR HELP

Modifié par Firky, 05 mai 2012 - 02:54 .