ADRIFT Forum


The place to discuss the ADRIFT Interactive Fiction toolkit

Portable Holes and Free Looking

This forum is the place to learn about and discuss ADRIFT 5. Feel free to mention any bugs you find here, but please also add these to the Bugs & Enhancements list.

Please also refer to the ADRIFT 5 Wiki for more information.

Portable Holes and Free Looking

Postby The0didactus » Sun Apr 12, 2020 12:12 pm

My upcoming game for our impromptu "escape" comp will require two things that I'm not sure how to do. I figure it's worth theorizing about them now so that I can implement them when the design process starts.

The first, I imagine, relatively simple...I just can't think of how to do it. So a simple teleport trap is easy to implement in ADRIFT: you make a task that triggers whenever any player is in the trap room, and it moves them. How does one implement a MOBILE teleport trap that the player can put down wherever? Imagine an item called "The Portable Hole". I'd like it to be the case that whenever any character is in the same room as the portable hole, if the portable hole is not in a player's inventory, the characters are moved somewhere else. To my knowledge ADRIFT lacks a "whenever [any character] is in the same room as [item]"/"move [any character] in the same room as [item]" function, but it could be something I've overlooked. One could make an event that "checks" every character in the whole game with a separate task, but this could get hairy.

The second is one of those deceptively complicated ones. How does one "stop time" to allow for things like the help menu or looking. Normally, I do this in a manner similar to Denk's method but that fails in one critical area: character movement. Lets say we have lots of characters running around: guards at a palace for example. I can imagine some way to stop and start movement by pausing their walk with the "look" command and resuming it with any other command...but that would require creating separate stop/start instructions like this for EACH WALK. Anyone have some other brilliant way to do this?
The0didactus
 
Posts: 293
Joined: Sun Mar 30, 2014 8:20 pm
Points: 150

Re: Portable Holes and Free Looking

Postby Denk » Sun Apr 12, 2020 2:30 pm

The0didactus wrote:How does one implement a MOBILE teleport trap that the player can put down wherever? Imagine an item called "The Portable Hole". I'd like it to be the case that whenever any character is in the same room as the portable hole, if the portable hole is not in a player's inventory, the characters are moved somewhere else.

I think the details on how this should work could influence how you would implement it. For instance, how can the player pick up the portable hole, if he immediately gets teleported away from the hole when entering the room?

The0didactus wrote:One could make an event that "checks" every character in the whole game with a separate task, but this could get hairy.

I would personally do this. It isn't so difficult. You just make a character group with all the characters who need to be checked and call the "check"-task using the character group as a parameter. Then the "check"-task will go through all the characters one at a time. I can imagine that it would be practical to handle the player character with one task and NPCs with another task. If you would like to see a demo on this, let me know.

The0didactus wrote:How does one "stop time" to allow for things like the help menu or looking. Normally, I do this in a manner similar to Denk's method but that fails in one critical area: character movement. Lets say we have lots of characters running around: guards at a palace for example. I can imagine some way to stop and start movement by pausing their walk with the "look" command and resuming it with any other command...but that would require creating separate stop/start instructions like this for EACH WALK. Anyone have some other brilliant way to do this?

I don't think there is another way than suspend/resume each walk, but I would love to be proven wrong.
----------------------------------------------------------------------
The Bash Saga:
1. The Dragon Diamond 2. The Way Home 3. Stone of Wisdom
----------------------------------------------------------------------
User avatar
Denk
 
Posts: 538
Joined: Mon Feb 22, 2016 6:21 pm
Location: Hjørring, Denmark
Points: 251

Re: Portable Holes and Free Looking

Postby The0didactus » Sun Apr 12, 2020 3:38 pm

Believe it or not, I've never used a command with a group as a parameter. What is the language used for that?
That would probably solve the problem just fine.
The0didactus
 
Posts: 293
Joined: Sun Mar 30, 2014 8:20 pm
Points: 150

Re: Portable Holes and Free Looking

Postby Denk » Sun Apr 12, 2020 4:37 pm

The0didactus wrote:Believe it or not, I've never used a command with a group as a parameter. What is the language used for that?
That would probably solve the problem just fine.

It is a very powerful technique once you get to know it. It is an ACTION as shown here:
LoopThroughCharacters.png
LoopThroughCharacters.png (35.12 KiB) Viewed 671 times

For some reason, it is not sufficient to use the key of the group (Npcs), you also have to add a mandatory property (not so important which once as long as it is mandatory), e.g. Gender, so the full parameter is: Npcs.Gender

It is probably easier to see what is happening in a taf-file, so I made a quick demo:
Attachments
LoopThroughCharacters.taf
(23.15 KiB) Downloaded 30 times
----------------------------------------------------------------------
The Bash Saga:
1. The Dragon Diamond 2. The Way Home 3. Stone of Wisdom
----------------------------------------------------------------------
User avatar
Denk
 
Posts: 538
Joined: Mon Feb 22, 2016 6:21 pm
Location: Hjørring, Denmark
Points: 251

Re: Portable Holes and Free Looking

Postby The0didactus » Sun Apr 12, 2020 5:40 pm

WOW! I had no idea you could do that.
This is another one of those things that I just did manually before. Probably coulda shaved 10-20 hours off of Tingalan with this, but whatever. This is a huge help both for the thing I'm gonna make this coming weekend AND for Lost Coastlines.

The portable hole example is actually quite different than what I intend to do. You'll see quite soon.
The0didactus
 
Posts: 293
Joined: Sun Mar 30, 2014 8:20 pm
Points: 150

Re: Portable Holes and Free Looking

Postby DazaKiwi » Sun Apr 12, 2020 10:03 pm

I have made a walk/pause demo. Using an event and the controllers in walk you can get characters to pause and resume their walk when certain tasks run.

Demo details..


1 Guard that will patrol around Loc 1 - 4 clockwise in a loop and Guard 2 will Patrol Loc 6 - 8 anti-clockwise (They begin right away).

When you enter pause command or look direction (eg. 'look east' will display adjac loc desc) the Guards will stop moving for 2 turns before resuming (an event controls how long he will have to wait).

Note: Unfortunately if you clone a character in adrift and then alter the clones walk it will also change the original/parent character's walk also (even if you add a new walk entirely it will automatically duplicate it in the parent character too) as if they are in sync, this is unfortunate because it means you have to manually create a new character, then manually add their patrol and set the pause and resume for each guard you have in your game. However you could work around this if you have a big game, creating 5-10 Guards and set up each one with multiple different patrol routes and when the player enters a zone move some of the guards could be moved to a fixed starting point and switch to another patrol walk for that area. This demo does not feature this.
Attachments
CharWalk_Look_Pause_v2.taf
(16.81 KiB) Downloaded 24 times
User avatar
DazaKiwi
 
Posts: 755
Joined: Thu Oct 21, 2010 9:05 am
Location: New Zealand
Points: 61

Re: Portable Holes and Free Looking

Postby The0didactus » Sun Apr 12, 2020 10:20 pm

Yes, I discovered this unfortunate cloning side-effect in one of my abandoned attempts to make a tactical game using ADRIFT with rotating guards exactly as you described. That, I think, firmly locks down any possibility of making a "small" ADRIFT game with many moving characters that have pause-able movements. I think for this game I'm just going to bite the bullet on it and have characters move on every action, even typos and 'sees' and stuff like that. This will add to the frenetic nature of what I expect to be possibly my most random and chaotic game.

Denk's method, above, is a HUGE timesaver and I'm not quite certain I'll be able to make the game in 2 eight hour shifts.
The0didactus
 
Posts: 293
Joined: Sun Mar 30, 2014 8:20 pm
Points: 150

Re: Portable Holes and Free Looking

Postby The0didactus » Wed Apr 15, 2020 12:28 am

So I've been having a LOT of fun with Denk's check system...quick question though, why can't I get it to work with objects...what's a mandatory property I can use.

Everything I try causes the system to barf all over.
The0didactus
 
Posts: 293
Joined: Sun Mar 30, 2014 8:20 pm
Points: 150

Re: Portable Holes and Free Looking

Postby Denk » Wed Apr 15, 2020 12:44 am

The0didactus wrote:So I've been having a LOT of fun with Denk's check system...quick question though, why can't I get it to work with objects...what's a mandatory property I can use.

Everything I try causes the system to barf all over.

I got lucky - my first guess was: StaticOrDynamic
That worked. I.e. if the key of the object group is "Objects1" the total parameter will be "Objects1.StaticOrDynamic" (without quotation marks)

Having said that, I am not sure why some properties work and others don't :?
Attachments
LoopThroughObjects.taf
(23.49 KiB) Downloaded 27 times
----------------------------------------------------------------------
The Bash Saga:
1. The Dragon Diamond 2. The Way Home 3. Stone of Wisdom
----------------------------------------------------------------------
User avatar
Denk
 
Posts: 538
Joined: Mon Feb 22, 2016 6:21 pm
Location: Hjørring, Denmark
Points: 251


Return to ADRIFT 5.0

Who is online

Users browsing this forum: No registered users and 11 guests