Ir al contenido

Foto

adding talk triggers without modifying existing files


  • Por favor identifícate para responder
12 respuestas en este tema

#1
sapphim

sapphim
  • Members
  • 32 mensajes

So I've been restoring cut dialogue and I'd like to get certain lines/conversations to autoplay at specific points, but I don't want to have to modify areas/area scripts or reappropriate existing triggers to do so. And CreateObject() doesn't work to spawn new triggers.

 

I think it might be feasible to turn a trap into a talk trigger that can then be spawned in with PRCSCR but before I go any further down that line of thought I want to check, am I missing an obvious way to do this? (Or does someone want to make one for me?  :P )



#2
Tchos

Tchos
  • Members
  • 5.026 mensajes

It sounds like you're doing something similar to what I did for the OC in NWN2 to add new dialogue triggers to the OC without modifying the area files.  NWN2 uses many of the same functions, so this may be possible in DA:O as well.  Since CreateObject doesn't create triggers, what I did instead of spawning a trap was to create an invisible custom AoE effect with no visual or audio, but with my custom On Enter script attached to it, which behaves the same as a trigger, and any trigger scripts will work in an AoE just as well.  There was already a custom AoE defined in the vanilla tools, but its size was a little small for my purpose, so I created a larger one in the visualeffect.2da.

 

I spawned it at a location that I generated using the x, y, and z coordinates that I obtained either from an object I placed in the toolset and checked its properties, or in-game standing in a location and using the console to get my current coordinates (the command is "loc" in NWN2).

 

If you can't create a bare AoE without an object reference in DA:O, you can spawn an invisible object there instead which has the AoE applied.


  • A MerAnne le gusta esto

#3
sapphim

sapphim
  • Members
  • 32 mensajes

That's kind of exactly what I was hoping to do, since from my reading on the wiki it looks like all trap triggers reference the AOE 2da. I'll have to look into what's involved in just directly spawning an AOE and see what method works best for my purposes. Thank you.



#4
MerAnne

MerAnne
  • Members
  • 1.157 mensajes

Since you are creating a new Origin (per your announcement), it would really be better to duplicate the area for your own mod, make the modifications directly to the area and add the trigger.  What you are trying to do would be significantly more work than just creating your own area files and modifying those.

 

There are other options such as 'flag checking', but I would need more information. 



#5
sapphim

sapphim
  • Members
  • 32 mensajes

Since you are creating a new Origin (per your announcement), it would really be better to duplicate the area for your own mod, make the modifications directly to the area and add the trigger.  What you are trying to do would be significantly more work than just creating your own area files and modifying those.

 

There are other options such as 'flag checking', but I would need more information. 

 

I'm talking about my Oghren restoration (on the Nexus), actually, but as far as the origin mod is concerned I'm also trying to figure out how best to selectively redirect a few certain conversations with party members to custom dialogues without overriding any core or SP resources (so the origin will play nicely with other mods) so it's not entirely irrelevant.

 

If you could elaborate on flag checking that would be great because I'm not entirely sure what you mean. I have a conversation and an ambient line with Oghren that I need to get to autoplay in the Orzammar Hall of Heroes when certain conditions are met (i.e. when certain flags are set) (not at the same time!) but as far as I'm aware flags will only be checked when an event fires, such as a trigger being entered or during an area preload, etc.



#6
Tchos

Tchos
  • Members
  • 5.026 mensajes

Check to see if there's a function CreateEffectAtLocation or CreateEffectOnObject.  I used the former for mine.


  • A MerAnne le gusta esto

#7
MerAnne

MerAnne
  • Members
  • 1.157 mensajes

Then I would add it this way:

http://social.biowar...n_existing_Area

You can have the script check for the conditions (flags set) and cause a dlg file to 'play.  I'm not sure that you can get a specific banter line to play without altering the banter file.

 

With flag checking you write script so that the flag of interest is checked EVERY time there is an Event.  This can cause lag if you check too many flag ALL the time.



#8
Tchos

Tchos
  • Members
  • 5.026 mensajes

If you're talking about how to spawn it in the first place, I put my CreateEffectAtLocation in one of the scripts that fires when you enter the relevant area (On Client Enter in NWN2), first checking a local variable to see if it had already done this.


  • A MerAnne le gusta esto

#9
sapphim

sapphim
  • Members
  • 32 mensajes

@MerAnne D'oh! I didn't think to put the code to activate the dialogue directly into the PRCSCR script itself. Yes, that's a great suggestion. Thank you. I think spawning an AOE trigger will give me greater control over when exactly the dialogue plays but the reminder that PRCSCR can be used for more than just spawning things will no doubt prove very helpful.  :lol: (Luckily, I'm not messing with banter, just a run-of-the-mill ambient reaction.)

 

@Tchos dascript doesn't appear to have a CreateEffectAtLocation function after a cursory search, but it does have ApplyEffectOnObject. Or (if I'm understanding the way this works correctly) I could create a trap trigger with the AOE already applied and just spawn that in.

 

EDIT: Using PRCSCR and UT_Talk to initiate a dialogue on area load was really easy and works just perfectly. I'm still working on the trap implementation. The trap needs to be armed, which works fine if I let my custom script hand it off to placeable_core, but I'm slow at coding and am having issues with doing it myself.



#10
Tchos

Tchos
  • Members
  • 5.026 mensajes

Ah yes, I meant ApplyEffectToObject and ApplyEffectAtLocation, as they are in NWN2.  I was working from memory and sometimes the details are off.

 

ApplyEffectAtLocation(int nDurationType, effect eEffect, location lLocation, float fDuration=0.0f);

ApplyEffectToObject(int nDurationType, effect eEffect, object oTarget, float fDuration=0.0f);

 

ApplyEffectAtLocation actually creates an AoE object that has its own tag and can be selected with GetObjectByTag or any other object functions, but if DA:O doesn't include it, then it's still fine as long as there are invisible and intangible objects that can accept effects (waypoints don't seem to work, so it has to be a placeable. 

 

If you're creating a trap, then you should be able to apply a script directly to that instead of making an AoE that does it, but then you need to deal with removing all of the trap-related material like characters being able to detect it, disarm it, etc. 

 

If you apply the AoE to an invisible placeable (in NWN2, we have such a placeable called an ipoint -- maybe you do, too) instead of to a trap, then you don't have to deal with that, and the AoE handles the script On Enter, doing only what you tell it to.  In that case you would also want to destroy the invisible placeable (taking the effect along with it) after you're done.



#11
sapphim

sapphim
  • Members
  • 32 mensajes


Ah yes, I meant ApplyEffectToObject and ApplyEffectAtLocation, as they are in NWN2.  I was working from memory and sometimes the details are off.

 

ApplyEffectAtLocation(int nDurationType, effect eEffect, location lLocation, float fDuration=0.0f);

ApplyEffectToObject(int nDurationType, effect eEffect, object oTarget, float fDuration=0.0f);

 

ApplyEffectAtLocation actually creates an AoE object that has its own tag and can be selected with GetObjectByTag or any other object functions, but if DA:O doesn't include it, then it's still fine as long as there are invisible and intangible objects that can accept effects (waypoints don't seem to work, so it has to be a placeable. 

 

If you're creating a trap, then you should be able to apply a script directly to that instead of making an AoE that does it, but then you need to deal with removing all of the trap-related material like characters being able to detect it, disarm it, etc. 

 

If you apply the AoE to an invisible placeable (in NWN2, we have such a placeable called an ipoint -- maybe you do, too) instead of to a trap, then you don't have to deal with that, and the AoE handles the script On Enter, doing only what you tell it to.  In that case you would also want to destroy the invisible placeable (taking the effect along with it) after you're done.

 

Dragon Age has these:

ApplyEffectOnObject(int nDurationType,effect eEffect,object oTarget,float fDuration = 0.0,object oCreator = OBJECT_SELF,int nAbilityId = 0)
Engine_ApplyEffectAtLocation(int nDurationType,effect eEffect,location lLocation,float fDuration = 0.0,object oCreator = OBJECT_SELF,int nAbilityId = 0);
 
However, figuring out how to use these to do what i want is toooootally beyond my meager understanding. :mellow:  I've got the trap method working by letting placeable_core handle it for the moment. There's a "trap triggered!" floaty that I'd rather not have, but once I send it to a conversation it's not visible anyway.


#12
Tchos

Tchos
  • Members
  • 5.026 mensajes

Well, if the "Trap triggered!" message is not visible and you're happy with it, then no need to look further into it, but I'm sure it's not as far beyond your understanding as you think, with a little testing.  (It just involves declaring your effect and your location using functions with those names, and then using Engine_ApplyEffectAtLocation() instead of CreateObject().)



#13
dainbramage

dainbramage
  • Members
  • 469 mensajes

If you want to get rid of the trap message, you should be able to create an invisible aoe object like most aoe duration spells do (well, they have vfx but whatever). Try looking at the blizzard or spell_aoe_duration spellscripts, or else just use something like this in your PRCSCR script.

effect eAoE = EffectAreaOfEffect(myID, myScript);
Engine_ApplyEffectAtLocation(EFFECT_DURATION_TYPE_PERMANENT, eAoE, location);

Whenever someone enters the area it'll hit your script with EVENT_TYPE_ENTER