Q: multi IF dependent says
#1
Posted 13 August 2002 - 03:07 PM
I'm pretty new at using WeiDu (by the way, thanks for such a great program, its so much fun :).
Anyway, my question, is it possible to have something like this:
IF ~~ THEN BEGIN 0
IF ~AreaCheck("AR0001")~ THEN SAY ~Your in area 0001~ DO ~~ EXIT
IF ~AreaCheck("AR0002")~ THEN SAY ~Your in area 0002~ DO ~~ EXIT
END
I can sort of see it being done with multiple blocks, but is it possible similar to how I have written it? I've browsed the forum, readme, examples, test files and a tutorial or 2, and not seen it done, but I might have missed it.
Thanks for your patience,
/bt_igi
#2 -jcompton-
Posted 13 August 2002 - 03:30 PM
In very basic terms, you would want those conditions to be in the state trigger slot.Hi there,
I'm pretty new at using WeiDu (by the way, thanks for such a great program, its so much fun .
Anyway, my question, is it possible to have something like this:
IF ~~ THEN BEGIN 0
IF ~AreaCheck("AR0001")~ THEN SAY ~Your in area 0001~ DO ~~ EXIT
IF ~AreaCheck("AR0002")~ THEN SAY ~Your in area 0002~ DO ~~ EXIT
END
I can sort of see it being done with multiple blocks, but is it possible similar to how I have written it? I've browsed the forum, readme, examples, test files and a tutorial or 2, and not seen it done, but I might have missed it.
Thanks for your patience,
/bt_igi
IF ~AreaCheck("AR0001")~ THEN
BEGIN area0001
SAY ~You are in Area 0001.~
IF ~~ THEN EXIT
END
IF ~AreaCheck("AR0002")~ THEN
BEGIN area0002
SAY ~You are in Area 0002.~
IF ~~ THEN EXIT
END
Or, you could do this.
IF ~~ THEN BEGIN start
SAY ~I am going to say something different depending on what area you are in.~
IF ~AreaCheck("AR0001")~ THEN GOTO area0001
IF ~AreaCheck("AR0002")~ THEN GOTO area0002
END
IF ~~ THEN BEGIN area0001
SAY ~You are in Area 0001.~
IF ~~ THEN EXIT
END
IF ~~ THEN BEGIN area0002
SAY ~You are in Area 0002.~
IF ~~ THEN EXIT
END
(Note that you don't have to have a "DO" if you're not actually DOing an action. Note also in the second example we don't have anything special in the state triggers of the places we branch to.)
#3
Posted 13 August 2002 - 03:51 PM
Ah well, thats not so bad I guess, I just wondered if it could be done neater.
I'll use something akin to your second example I think, so thanks for posting it
And thanks for the promt reply.
/bt_igi
Visit the IESDP
#4 -jcompton-
Posted 13 August 2002 - 04:11 PM
#5
Posted 13 August 2002 - 10:16 PM
The Infinity Engine DLG format requires that you have one separate state for each statement said by an NPC to the player.So I have to have a block for each area check / reply?
Ah well, thats not so bad I guess, I just wondered if it could be done neater.
I'll use something akin to your second example I think, so thanks for posting it
And thanks for the promt reply.
/bt_igi
Convenient syntax can hide that from you (see CHAIN, as suggested, or "multi-say" for something different but on a similar theme) but under the hood there's still one state per SAY.
After a bit of working with tools like these you'll notice that all of the mods have the same sort of dialogue structure (from a bird's eye view) ... that's because it's all the DLG format really supports. Different things could be hacked in through special scripting conditions, but it would take vast individual effort.
Good luck with WeiDU. I think you're the first person to call it "fun". :-)
#6
Posted 14 August 2002 - 09:27 AM
I havent moved on to CHAIN and MULTI-SAY, yet, I'll just stick with what I (sort of) know for now, until I have it nailed. Things are going well enough, although dialog I am writing is getting pretty big.
Since I'm here, I might as well ask my next question... which I've just solved :-) Thanks for the help you would have given anyway
/bt_igi
Visit the IESDP
#7 -jcompton-
Posted 14 August 2002 - 09:53 AM
#8
Posted 14 August 2002 - 10:30 AM
EDIT: Sorry for all the questions, but this will be the last one for a while (I promise). I notice theres a command for adding references to the .tlk manually, how can you be sure this doesnt overwrite anything? If you can be sure? I'm trying to use DisplayStringHead(Myself,xxxx) to display a string over my head,but I dont know where it will be added in the .tlk, unless I specify it with --strapp. Is it possible without overwriting some random thing? Thanks
Anyway, got to dash, or I'll never finish
/bt_igi -waving to the friendly people :-)
Visit the IESDP
#9
Posted 14 August 2002 - 02:51 PM
If you're thinking of STRING_SET, the answer is "YOU CAN'T". That's why the manual tells you not to use it. :-)EDIT: Sorry for all the questions, but this will be the last one for a while (I promise). I notice theres a command for adding references to the .tlk manually, how can you be sure this doesnt overwrite anything? If you can be sure? I'm trying to use DisplayStringHead(Myself,xxxx) to display a string over my head,but I dont know where it will be added in the .tlk, unless I specify it with --strapp. Is it possible without overwriting some random thing? Thanks
For what you are suggesting, put
DisplayStringHead(Myself,999999)
in your BAF and compile it to a BCS. In your TP2 file, put
COPY ~mymod/myscript.bcs~ ~override/myscript.bcs~
REPLACE ~999999~ ~Hello, this is a new string that will be over my head.~
When installed on the user's machine, 999999 will be replaced by the strref of a newly-minted string.
#10 -jcompton-
Posted 14 August 2002 - 03:28 PM
#11
Posted 15 August 2002 - 10:13 AM
What if someone else has used 999999 to do the same sort of thing? Or does WeiDu interpret 999999 as a "place at the next free space" sort of thing?
I've mostly been using guess work (fun fun fun and valen (sounds about the simplest npc out there) as reference work. I also occasionly look at solaufein. I've avoided Kesley (it seems to be the reason half these nifty command were added, so it would seem to be a bit over my head for now). I'm downloading Tashia now, its always nice to have something new to dissect.
/bt_igi
Visit the IESDP
#12
Posted 15 August 2002 - 05:54 PM
If you're still confused about this, ask again and someone will explain it in more detail.
#13
Posted 16 August 2002 - 09:22 AM
I've run out of questions now, so thanks for the help!
/bt_igi
Visit the IESDP
#14 -jcompton-
Posted 16 August 2002 - 09:26 AM
#15
Posted 28 August 2002 - 09:11 AM
Come back to this thread to extend my question.
My latest project is getting a sword to display a string when its equipped (ie. equip sword, text displays). The sword is made, the text is written, but linking the two...
The sword is set to display reference 999999. In the tp2 file, I've used
REPLACE ~999999~ ~My Text~
but it doesnt seem to work. When the sword is equipped the character name appears, but where the text should be is empty.
Looking at mymod.tp2, it says REPLACE can be used ot patch ASCII numbers in any file. I dont think the reference in the .itm file shows as ASCII, so is this option ruled out?
However, also looking at mymod.tp2, I think it could be possible using SAY XXX (line 69ish), but I dont know the XXX offset. Maybe if I changed the item to display reference 111111 and compared the files, found the offset of the difference and used that as the patch offset?
Hope someone can understand my question
/bt_igi
Visit the IESDP
#16 -jcompton-
Posted 28 August 2002 - 09:39 AM
What you want to do is something like
COPY ~scriptsource~ ~override\scriptdest~
REPLACE ~999999~ ~Your text~
#17
Posted 28 August 2002 - 10:06 AM
COPY ~item/iissw03.itm~ ~override/iissw03.itm~ REPLACE ~999999~ ~As you take hold of the sword in your hand, you hear a disembodied voice laughing, and a sense of imminent danger takes hold of you~ SAY NAME1 ~Short Sword~ SAY UNIDENTIFIED_DESC #6747 SAY NAME2 ~Magic Short Sword ~ SAY DESC ~A magic short sword~
/bt_igi
Visit the IESDP
#18 -jcompton-
Posted 28 August 2002 - 11:49 AM
#19
Posted 28 August 2002 - 01:25 PM
The .itm file stores the number of the string to display (the strref, i think it is called).
So, I guess it should be possible to patch the .itm file with the new offset, if I knew what offset weidu was giving my new string (or, a better way, figure out weidu enough to get it to do it for me).
(ummm... that still means I am looking for help if someone has any bright ideas
/bt_igi
Visit the IESDP
#20
Posted 28 August 2002 - 02:57 PM
If you're patching the sword ITM file, you really want to use SAY (yeah, these are arbitrary).Hiya,
Come back to this thread to extend my question.
My latest project is getting a sword to display a string when its equipped (ie. equip sword, text displays). The sword is made, the text is written, but linking the two...
The sword is set to display reference 999999. In the tp2 file, I've used
REPLACE ~999999~ ~My Text~
but it doesnt seem to work. When the sword is equipped the character name appears, but where the text should be is empty.
Looking at mymod.tp2, it says REPLACE can be used ot patch ASCII numbers in any file. I dont think the reference in the .itm file shows as ASCII, so is this option ruled out?
However, also looking at mymod.tp2, I think it could be possible using SAY XXX (line 69ish), but I dont know the XXX offset. Maybe if I changed the item to display reference 111111 and compared the files, found the offset of the difference and used that as the patch offset?
Hope someone can understand my question
/bt_igi
Use Near Infinity to find the Offset.