Aller au contenu

Photo

Dialogue line calling another dialogue


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

#1
alschemid

alschemid
  • Members
  • 475 messages
It seems I have no idea what I'm doing, so I need some help.

I have changed the den220_edwina.dlg from the single player campaing and I set it to module SP and owner mine module, and added a few lines to it. I have made a second dialogue dentav_loghain.dlg with the same properties as the other (module SP and owner mine module - should I do that?).

Now I want the last line of the first dialogue to call the second, basicaly I want start a conversation between the PC and Loghain using my dialogue file and not his default dialogue. So I have a script in the Action Script of the last dialogue line, the script I have set to module and owner to mine module (should I do that?), and it goes like this:

#include "events_h"
#include "global_objects_h"
#include "utility_h"

void main()
{  
     object oPlayer = GetMainControlled();
     object oLoghain = GetObjectByTag("gen00fl_loghain", 1); 
     UT_Talk(oLoghain, oPlayer, R"dentav_loghain.dlg",TRUE);
}

When a change the script to load a cutscene it works fine, so I think my problem is the script. Any help is appreciated.
Thanks:blush:

#2
Proleric

Proleric
  • Members
  • 2 346 messages
Try dropping the second parameter from GetObjectByTag. The first instance of an object is 0, not 1. 0 is the default.

#3
alschemid

alschemid
  • Members
  • 475 messages
oh! it worked. Thanks

Where can I find the function's syntax, the parameters it uses and their default values?

#4
Proleric

Proleric
  • Members
  • 2 346 messages
If you double-click on a function in your script (or single-click on a function in the list) you will see the syntax in the Help window.

You can also see this information in the wiki, with a few additional comments.

#5
alschemid

alschemid
  • Members
  • 475 messages
I have another question...

I would like to use this same script to go through all my followers to place them in different positions and set them to perform some animation, before the dialogue starts.

How can I get which follower is there? And how can I get the henchman number of the follower?

#6
Proleric

Proleric
  • Members
  • 2 346 messages
There's more than one way of determining which follower is there.

The most general approach is to use the GetPartyList function, which, for the player, returns an array of the current party member objects including the player. Once again, the first entry is element zero, not element one. IIRC the table contains the followers in the same order as the portraits on screen.

For the OC, it may be easier to use the plot flags in gen00pt_plot (e.g. GEN_ALISTAIR_IN_PARTY, which is true if Alistair is in the party).

Custom followers will have similar flags if the author has heeded the advice of the Follower Tutorial on the wiki.

For the OC (only), the function Approval_GetFollowerIndex in approval_h returns a unique follower number (1=Alistair ... 10=Loghain). I'm not sure whether that was the number you had in mind?

#7
FollowTheGourd

FollowTheGourd
  • Members
  • 572 messages
Another thing could be in the conversation cinematics tab for stages, like HENCHMAN 1, HENCHMAN 2, etc.

This thread seemed to go into some details on that. Probably something that should be distilled into the wiki even. Not sure if you can control which follower gets assigned to which HENCHMAN #, or if it's just the same as what you see in the portraits (or something).

If you wanted exact control over their location, I guess you might have to not use those special henchman tags. If you look in cir300_sloth_demon.dlg of the single player module, you can see what they did there. The root cinematics tab shows the stage "places" for most followers, but no tags assigned there. Then in the relevant dialogue line, the tag gets filled in. Don't ask me why some "place/tag" pairs are things like "morrigan/gen00fl_sten" or "sten/HENCHMAN1", but other lines have things like "morrigan/gen00fl_morrigan".

Modifié par FollowTheGourd, 24 novembre 2010 - 08:39 .


#8
Proleric

Proleric
  • Members
  • 2 346 messages
Ah, perhaps I was being too literal in my understanding of "before the conversation starts". I agree that it's better to start the conversation with a stage and add animations to it, if that's what the OP intends.

#9
alschemid

alschemid
  • Members
  • 475 messages
Actually you were not too literal, Proleric1, that was exactly what I asked, I was looking for a function that calls the followers list. I would love only use the stage, but I got a problem here:

I have a cutscene and then the dialogue, in the cutscene I have 5 spots: Loghain, Dog, Shale, Hench 1 and Hench 2, everything works fine if I map Loghain's dummy to hench:gen00fl_loghain, otherwise I have two of him one in Loghain's spot and the other in Hench 1 or 2 spots, depending of the order I picked him.

But in the dialogue using the stage I can not place them in their spots, if I pick Loghain first he will be placed in his spot because I called a script first to do so, but he will be the hench 1 no matter what I do, then hench 2, which in this situation should be placed in hench 1 spot, appears in hench 2 spot, and hench 3, which should be placed in hench 2 spot, is behind me. I tried using the hench:gen00fl_loghain in the dialogue too, since it works in the cutscene, but that made no difference, probably because in the toolset_henchman.2da the StageSpecial column for Loghain is 0? I have to try change that...but changing a 2da file for such a small thing that a script could do....:huh:... of course, If I knew how to script it. :lol:

I could use the follower's tag in the script to place them, but it will not work with custom followers, and I need to know also the order they were picked.
Proleric1, do you know how I can search through the scripts to find a function? I would like see how the GetPartList is used.
Thanks!:D

Modifié par alschemid, 24 novembre 2010 - 02:41 .


#10
Proleric

Proleric
  • Members
  • 2 346 messages

alschemid wrote...
Proleric1, do you know how I can search through the scripts to find a function? I would like see how the GetPartList is used.
Thanks!:D

DAToolChest is invaluable.

#11
alschemid

alschemid
  • Members
  • 475 messages

Proleric1 wrote...
 IIRC the table contains the followers in the same order as the portraits on screen.

You are right, the index is exactly the same as the portrait order.
DAToolChest doesn't like me since it crashes when I press the search scripts button. <_<
Is there a easy way to extract all the scripts from the toolset?

But I think I've found what I was looking for in the partyfollow.nss script and zz_partylist.nss. How can I print something in the screen? this DEBUG_PrintToScreen doesn't work and the DisplayFloatMessage has a limited number of lines.

Also do you now in which file is the structure declaration of the follower? I see that the follower has some variables in it like state and substate how can I see all of the followers' variables?

Edit: How can I make the NPC play an animation using the script?

Modifié par alschemid, 24 novembre 2010 - 11:47 .


#12
Proleric

Proleric
  • Members
  • 2 346 messages
If DAToolChest isn't working, you may need to use the Settings option to specify paths.

I have the Dragon Age 2DA folder set to Program Files > Dragon Age > Packages > core > data, Backup and Output folders set to destinations in Documents. The rest are null (default).

Most game resources are packed in .erf files which you can open in the toolset and then export. Unfortunately, AFAIK this doesn't apply to script sources, because they aren't needed in game. So I guess you'd need to use SQL to read them from the toolset data base. I might be wrong about that, because I've never had to do it.

I don't have a better solution for printing debug info. I imagine for large volumes of text you could figure out how to enable logging.

I'm not sure what you mean by "structure declaration of the follower" - can you give me some context?

CommandPlayAnimation is the basic animation script function - see also Ambient Animation in the wiki. However, if you want the animation to persist in conversation, you might be better advised to read that thread about how to get followers working in conversation. My experience is that it's much easier to make animations happen in conversation mode, once you've been through the learning curve of mastering stages.

#13
alschemid

alschemid
  • Members
  • 475 messages
I have the paths set for the DAToolChest, it complains that it is not a valid Win32 application and that Unhandled exception has ocurred in the aplication... perhaps because I'm using windows xp 64.

I'll probably use the stage after all, since once they are placed in their positions by the script if I use a stage in the dialogue and don't add them to the stage, they disappear. But the script will be useful though because after the conversation I want them in their positions performing an animation and not following me around, in the camp_functions.h there is a Camp_FollowerAmbient function, I think it is exactly what I want.

The CommandPlayAnimation reads from which file to get the nAnim value? The anim_base?

Modifié par alschemid, 25 novembre 2010 - 10:15 .


#14
Proleric

Proleric
  • Members
  • 2 346 messages
Yes, CommandPlayAnimation refers to the ANIM_base 2da.

To have followers performing scripted animations after the conversation ends, you'll either want to remove them from the party (like when they're in camp), or temporarily disable the regular follower AI so that it doesn't take control of their actions.

#15
alschemid

alschemid
  • Members
  • 475 messages
Is it possible to enable the Hold Position using script?

#16
Proleric

Proleric
  • Members
  • 2 346 messages
I suspect that SetFollowPartyLeader does this, but I haven't tested it. There's a wrapper Party_SetFollowLeader in core_h which sets the follow status of the entire party.

#17
alschemid

alschemid
  • Members
  • 475 messages
Both work nicely, the followers stay in place untill you change mode.:)

I have a problem though, I have made a dialogue with two entries each with a conditional plot flag, then I have a script to place the followers in their position depending of the plot flag and call the dialogue using the UT_talk. The first time I call the dialogue it works, the second time it doesn't, the followers are placed where they should be for each call... so should I make a new dialogue for each entry?Or it was supposed to work this way... and I messed something badly?

Edit: Oh worked!! I really messed the plot flags.... *and mumbles something about skip lines checked in the dialogue*

Hmmm... how can I close a door in the area using a script? Is the SetPlaceableState? because there is no state DOOR_CLOSED, and there is a PLACEABLE_ACTION_CLOSED but no SetAction function....:blink:

thanks.

Modifié par alschemid, 30 novembre 2010 - 08:24 .


#18
Proleric

Proleric
  • Members
  • 2 346 messages
SetPlaceableState to PLC_STATE_DOOR_UNLOCKED closes it IIRC.