Author Topic: The DO command, Esacpe Area and function calls (1)  (Read 3104 times)

Offline lennon

  • Planewalker
  • *****
  • Posts: 71
  • Gender: Male
The DO command, Esacpe Area and function calls (1)
« on: July 19, 2004, 02:41:39 PM »
I've just reviewed Mazzy's '.d' file and discovered

       DO ~EscapeArea~

Is this the command to use after a 'kick out' dialogue, when they or the PC says that they're not hanging around? (I reckon by using state variables I can write an area script to spawn or respawn the character where required in these circumstances (possibly using the Delainy tutorial techniques).

Is their a list of permitted functions that can be invoked by the DO clause, or is their a site or page that might help?

TIA

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7246
Re: The DO command, Esacpe Area and function calls (1)
« Reply #1 on: July 19, 2004, 03:09:27 PM »
EscapeArea() is used primarily for "leaving the game forever" situations. It would not be used for a standard NPC kickout.
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

Offline lennon

  • Planewalker
  • *****
  • Posts: 71
  • Gender: Male
Re: The DO command, Esacpe Area and function calls (1)
« Reply #2 on: July 20, 2004, 04:10:35 AM »
What should be used to make the character walk away from the group as if to return to their home? e.g. When Mazzy says to look her up in Trademeet.

Offline Kismet

  • Devil's Minion #5
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 653
  • Gender: Female
  • Veni; Vidi; Velcro.
    • Pocket Plane Group
Re: The DO command, Esacpe Area and function calls (1)
« Reply #3 on: July 20, 2004, 08:37:43 AM »
I belive you'd want to use MoveGlobal()
Cailean - An archer NPC for the insatiably nosy!  Guaranteed more fun than shampooing cats!

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Re: The DO command, Esacpe Area and function calls (1)
« Reply #4 on: July 20, 2004, 01:12:54 PM »
MoveGlobal() doesn't do the walking thing, though.  EscapeAreaMove() might do it, or MoveBetweenAreas(), but that last one needs coordinates for the NPC to walk to.
Earn Money Sleeping.

Offline Andyr

  • Dance Commander
  • PPG
  • Planewalker
  • *****
  • Posts: 3178
  • Gender: Male
    • The Gibberlings Three IE mod community
Re: The DO command, Esacpe Area and function calls (1)
« Reply #5 on: July 20, 2004, 01:30:39 PM »
Perhaps you could try RandomWalk() for a few seconds then MoveGlobal to get that effect?
"We are the Gibberlings Three, as merry a band as you ever did see..." - Home of IE mods

<jcompton> Suggested plugs include "Click here so Compton doesn't ban me. http://www.pocketplane.net/ub"

I am unfortunately not often about these days so the best way to get hold of me is via email.

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Re: The DO command, Esacpe Area and function calls (1)
« Reply #6 on: July 21, 2004, 12:49:54 AM »
Or, y'know, you could just use EscapeAreaMove().

From action.ids:
108 EscapeAreaMove(S:Area*,I:X*,I:Y*,I:Face*)

So that's be EscapeAreaMove("ARxxxx",[xcoordinate.ycoordinate],0 to 15)
Earn Money Sleeping.

Offline lennon

  • Planewalker
  • *****
  • Posts: 71
  • Gender: Male
Re: The DO command, Esacpe Area and function calls (1)
« Reply #7 on: July 21, 2004, 05:11:19 PM »
Cut out of Mazzy's *.d file, which I extracted using Weidu

Quote
DO ~SetGlobal("MazzyHappy","GLOBAL",1)
       RevealAreaOnMap("AR2000")
       EscapeAreaMove("AR2002",341,400,11)~

However, given the problem I am trying to solve, and my assumption that  EscapeAreaMove takes arguments as to the destination, how do you select the area parameter (although destination is OK) and the X,Y parameters when you don't know where you are going to be when you execute this code?? [ I suppose that one could choose area corner and hope that your not in view of the area corner.

I'm off to IESDP to check the definition of EscapeAreaMove but hlp from you guys would be good.

Also, if its questionable as to how to do this, how is the "kick out for rejoin" done by those of you who've finished, (I know I could download & examine, and maybe I will)  :)

TIA

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Re: The DO command, Esacpe Area and function calls (1)
« Reply #8 on: July 21, 2004, 06:00:54 PM »
You mean you want the person to escape to the corner of the current area you're in?

MoveToPointNoInterrupt([x.y]) would work for that.
Earn Money Sleeping.

Offline Diana

  • Neophyte
  • Planewalker
  • *****
  • Posts: 251
  • Gender: Female
Re: The DO command, Esacpe Area and function calls (1)
« Reply #9 on: July 21, 2004, 06:49:24 PM »
Back from dissection so if anyone can shed some light on what is happening here I'd apreciate it.

This is what I culled from a mod which I think assigns dialogue to a script file via the .tp2.  (I really don't know WEIDU all that well)

COPY ~myfile/bcs/copy~ ~override~
REPLACE 999994 @1
REPLACE 999995 @2
REPLACE 999997 @3
REPLACE_TEXTUALLY 999996 ~%Sdrem%~
REPLACE 999998 @4

I figured out that the @ references are coming from the setup.tra files.  but how does WEIDU know to assign each of the text strings properly to the DISPLAYOVERHEAD or DISPLAYSTRINGHEAD in the appropriate  bcs?  Does it know it from the first line to associate all the succeeding commands to that particular .baf/bcs file?

That is what is holding me up on doing cutscenes.

And this REPLACE_TEXTUALLY, I've never seen this before.  Is this is the WEIDU documentation so I can study it some more?

Thanks.

Offline Kismet

  • Devil's Minion #5
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 653
  • Gender: Female
  • Veni; Vidi; Velcro.
    • Pocket Plane Group
Re: The DO command, Esacpe Area and function calls (1)
« Reply #10 on: July 21, 2004, 06:58:22 PM »
You don't need to use REPLACE to put dialog into a .bcs file.  In a cutscene, CutsceneId() determines who the owner of the script is (quite frequently it's Player1, but it doesn't have to be.)  If someone other than CutsceneId() is doing the action then you need to use ActionOverride).  DisplayStringHead() doesn't need ActionOverride because the actor is implicit in the command: DisplayStringHead("SomeNPC",~Some text~)

Take a look at Cloakwood Squares for examples.  That's one big cutscene with DisplayStringHead() stuff all over the place.
Cailean - An archer NPC for the insatiably nosy!  Guaranteed more fun than shampooing cats!

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7246
Re: The DO command, Esacpe Area and function calls (1)
« Reply #11 on: July 21, 2004, 07:01:57 PM »
Back from dissection so if anyone can shed some light on what is happening here I'd apreciate it.

This is what I culled from a mod which I think assigns dialogue to a script file via the .tp2.  (I really don't know WEIDU all that well)

COPY ~myfile/bcs/copy~ ~override~
REPLACE 999994 @1
REPLACE 999995 @2
REPLACE 999997 @3
REPLACE_TEXTUALLY 999996 ~%Sdrem%~
REPLACE 999998 @4

I figured out that the @ references are coming from the setup.tra files.  but how does WEIDU know to assign each of the text strings properly to the DISPLAYOVERHEAD or DISPLAYSTRINGHEAD in the appropriate  bcs?  Does it know it from the first line to associate all the succeeding commands to that particular .baf/bcs file?

This method of coding is mostly obsolete and discouraged now, but back before WeiDU had things like script-compiling and the ability to insert text strings in compiled scripts and dialogue actions, the way to get new strings into a script was to put a placeholder strref value in there (like 99999) and then use TP2 REPLACE to replace that value with a string. WeiDU would add that string to the .tlk (so let's say it became strref 80001 in this example), and automatically take that new strref value and replace the 99999 with whatever the new value was (80001.)

Quote
And this REPLACE_TEXTUALLY, I've never seen this before.  Is this is the WEIDU documentation so I can study it some more?

Everything is in the WeiDU docs at least a little bit. :) REPLACE_TEXTUALLY does basically what it says: rather than trying to compile a new text string it literally just replaces one chunk of text with another. However, I can't immediately guess what's going on here and I don't recognize the code.

Suffice it to say that you really should avoid coding like this whenever possible. Generally you can just design your BAF with things like

IF
(blah)
THEN
RESPONSE #100
DisplayStringHead(@1)
END

and compile the BAF with a TRA file attached to it, and voila, @1 gets assigned from the TRA and you have a string.
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

Offline Diana

  • Neophyte
  • Planewalker
  • *****
  • Posts: 251
  • Gender: Female
Re: The DO command, Esacpe Area and function calls (1)
« Reply #12 on: July 22, 2004, 07:34:40 PM »
Quote
and compile the BAF with a TRA file attached to it, and voila, @1 gets assigned from the TRA and you have a string
And that's the clinker.  I'm trying to debug an old mod and I'm not as far along the WEIDU path as most of you.  And most of the examples i've been studying still use what I posted above.

Thanks for the Cloakwood Squares suggestion.  I'll download and take a look at how it was structured tomorrow when I have access to a printer at work so I can study it on paper.

Thanks all!  And like they say...Allez modding! :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)?: