Author Topic: Is it a possible kind of pathing?  (Read 1244 times)

Offline Littiz

  • Planewalker
  • *****
  • Posts: 23
Is it a possible kind of pathing?
« on: September 24, 2005, 09:49:46 AM »
Asking the dialogue experts out there.
Unfortunately, I gave for granted that such a mechanism would work (and coded a lot of stuff) but it doesn't seem the case.

I'll post a simplified example.
I'd need to add replies, in case Viconia *isn't* entitled to interject, but, in case she is, the engine should remove all of the possible replies (thanx to the IF ~!something~ check), and let the CONTINUE button appear, with a direct transition to Viconia's line.
In my tests it doesn't work, but I'm hoping for someone to shed light on the matter, as I'm hoping to save a nice quantity of code :(


Code: [Select]
IF ~~ THEN BEGIN A
  SAY @1
  IF ~something~    THEN EXTERN ~VICON25J~ ViconiaInterject
  IF ~!something~   THEN REPLY @2 GOTO B
  IF ~!something~   THEN REPLY @3 GOTO F
  IF ~!something~   THEN REPLY @4 GOTO E
END

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: Is it a possible kind of pathing?
« Reply #1 on: September 24, 2005, 09:55:26 AM »
Quoting from the e-mail I sent you:

CHAIN blablabla (don't remember how to call it)
SAY ~Hello~
== somecre ~hi~
== Viconia IF ~InParty("Viconia")~ THEN ~OMG Beholders kill them!!!~
END
++ ~Uh oh...~ GOTO uhoh
++ ~Die!~ GOTO die

All transitions are copied in all states, and, if both are present, the engine chooses the ones without replies automatically).

See also Chloe's coding for similar examples (this one's APPENDs can be united in a single CHAIN IIRC, but the idea is the same) (hopefully LucyTheBeast won't kill me for having used her code) (this parenthesis has no purpose):

APPEND CHLOEJ
IF ~~ THEN BEGIN GTKUYrkai
    SAY @307
    = @308
    = @309
    = @310
    IF ~~ THEN REPLY @311 DO ~IncrementGlobal("ChloeInterest","GLOBAL",1)~ EXIT
    IF ~~ THEN REPLY @312 GOTO GTKUYrkai2
    IF ~~ THEN REPLY @224 GOTO GTKUYrkai1
    IF ~IsValidForPartyDialog("Aerie")~ THEN EXTERN AERIEJ GTKUYrkaiAvariel
END
END

APPEND AERIEJ
IF ~~ THEN BEGIN GTKUYrkaiAvariel
    SAY @313
    IF ~~ THEN REPLY @311 DO ~IncrementGlobal("ChloeInterest","GLOBAL",1)~ EXIT
    IF ~~ THEN REPLY @312 EXTERN CHLOEJ GTKUYrkai2
    IF ~~ THEN REPLY @224 EXTERN CHLOEJ GTKUYrkai1
END
END


EDIT: see sarev25a.dlg, state 0, for an in-game example.
« Last Edit: September 24, 2005, 10:01:11 AM by the bigg »
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7246
Re: Is it a possible kind of pathing?
« Reply #2 on: September 24, 2005, 09:59:42 AM »
The trick here is that the engine evaluates transitions bottom-up. So if you want something to supercede replies, you have to put it at the bottom of the transition stack.
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

Offline Littiz

  • Planewalker
  • *****
  • Posts: 23
Re: Is it a possible kind of pathing?
« Reply #3 on: September 24, 2005, 10:37:14 AM »
Thx JC and bigg!
It was surely one of the problems (how many things to learn yet, hey!).

I fear I'm still doing something wrong though: maybe the engine doesn't process the check as I'd want, otherwise the replies shouldn't be displayed in any case.
Yet, it's just a global check and everything seems fine.
I'll test more in the following days..

Offline Littiz

  • Planewalker
  • *****
  • Posts: 23
Re: Is it a possible kind of pathing?
« Reply #4 on: September 25, 2005, 03:56:13 AM »
Argh, among the rest I was doing mess with a duplicate copy of the dialog.
Can't tell what happened for sure but it works now :)
Thanx again!

At this point, I suspect that ordering might not be an issue if you exhaustively cover all cases with checks (as in the above example).
Does it makes sense?
(If I'm right, I might avoid revising tons of code ;D)

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: