Jump to content


Photo

Two Questions


  • Please log in to reply
3 replies to this topic

#1 Adder

Adder
  • Member
  • 57 posts

Posted 29 September 2005 - 10:31 AM

While writing Banters and Interjections for my NPC-Mod I ran into a few (well, two) problems. They're probably very simple to solve but since I'm rather clueless, some help would be nice. :)

1. The Banters between my Layne and some of the Bioware-NPCs should run in a special order. So the third Banter for example will only occur if the LOCALS for one and two are set on 1. When I tested the whole thing the first two Banters (Initiated by Layne) work fine. The third one (initiated by Aerie) however won't.
What I suspect to be the problem is that the variables are local-files, so Aerie's file cannot check what's going on in Layne's file.
Is that right and (more importantly) is there a way around it?

2. I wanted to add some Interjections with some of the peasants, which I coded like this (I'm not doing the following with Copy and Paste, so spelling mistakes are possible)

APPEND Celvan

IF ~InParty("Layne")
See("Layne")
!StateCheck("Layne",STATE_SLEEPING)
RandomNum(2,1)
Global("celvanlayne","Ar0300",0)~
BEGIN layne
SAY ~poem~
IF ~~ THEN DO ~SetGlobal("celvanlayne","Ar0300",1)~ EXTERN ~LayneJ~ celvan
END
END

When I tested this and similar dialogs all that appeared were the usual Bioware ones. Did I do something wrong or did I just have very bad luck with the randoms? :unsure:
"Face it, if crime didn't pay, there would be very few criminals"
-Laughton Lewis Burdock-

#2 Sir BillyBob

Sir BillyBob
  • Modder
  • 5315 posts

Posted 30 September 2005 - 04:52 AM

Locals on one NPC can't be checked on another (that I know of). What I do is setup a global at a point in the series of banters. That way, the others involved in the bantering know when their parts come into play. For example, 2 banters between NPC A and B. After the second, a Global is set. NPC C can now add in a banter relating to the other two banters.

To force a banter at a particular area, use the AR0300 or whatever area name. Just remember that you can't use that variable outside of this area. So don't go checking to see if AR0300 is "1" when you are on AR0400.

Tired of Bhaal? Try some classics mods instead:
Classic Adventures
Official Classic Adventures Website


#3 jcompton

jcompton
  • Modder
  • 492 posts

Posted 30 September 2005 - 10:54 AM

While writing Banters and Interjections for my NPC-Mod I ran into a few (well, two) problems. They're probably very simple to solve but since I'm rather clueless, some help would be nice.  :)

1. The Banters between my Layne and some of the Bioware-NPCs should run in a special order. So the third Banter for example will only occur if the LOCALS for one and two are set on 1. When I tested the whole thing the first two Banters (Initiated by Layne) work fine. The third one (initiated by Aerie) however won't.
What I suspect to be the problem is that the variables are local-files, so Aerie's file cannot check what's going on in Layne's file.
Is that right and (more importantly) is there a way around it?


As was mentioned, the best way to address this problem is probably simply by using global variables instead of locals, but if you absolutely have to stick with locals for some reason (or you have to deal with some existing Bioware locals) you can always do something like this in the relevant creature script:

IF
Global("somevar","LOCALS",1)
Global("onlydothisonce","LOCALS",0)
THEN
RESPONSE #100
ActionOverride("othercre",SetGlobal("somevar","LOCALS",1))
SetGlobal("onlydothisonce","LOCALS",1)
END

2. I wanted to add some Interjections with some of the peasants, which I coded like this (I'm not doing the following with Copy and Paste, so spelling mistakes are possible)

[code=auto:0]APPEND Celvan


My guess is that this is a weighting problem and your new state, which is being appended to the bottom of the stack, can't be reached. A lot of incidental characters like peasants always have a True()-type statement at the bottom of their DLG lists so that they will always have something to say. Try putting this one as WEIGHT #-1 (or somewhere else that's appropriately not the bottom) and see if the situation improves.

#4 Adder

Adder
  • Member
  • 57 posts

Posted 01 October 2005 - 01:51 AM

Ah, thanks for the advices. I'll give it a try :)
"Face it, if crime didn't pay, there would be very few criminals"
-Laughton Lewis Burdock-