ADRIFT Forum


The place to discuss the ADRIFT Interactive Fiction toolkit

Quick Questions

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.

Re: Quick Questions

Postby Lumin » Mon Feb 10, 2020 11:01 pm

Heradite wrote:"Characters can also be placed into groups, so a class of school students could be placed together into a group so that the game can have them all react to the player the same way without having to add an individual restriction for each one.

In a role playing game with different "factions", the members of each faction can be placed in a group so that each individual knows how they should react to a member of a particular faction."

From the wiki

How do I do this? When I go to restrictions it has "Any Character", "Player Character", and then a list of individual characters. I'm trying to do the first one.



This is a separate thing from anything to do with restrictions so I'm not sure exactly what the context is here, but Groups > New Group > Group Type - Character is what that quote from the wiki refers to. You can then create properties that apply to everyone group, or refer to it with task actions/restrictions.
User avatar
Lumin
 
Posts: 2067
Joined: Fri Aug 06, 2004 5:48 pm
Points: 34

Re: Quick Questions

Postby Heradite » Mon Feb 10, 2020 11:20 pm

Lumin wrote:
Heradite wrote:"Characters can also be placed into groups, so a class of school students could be placed together into a group so that the game can have them all react to the player the same way without having to add an individual restriction for each one.

In a role playing game with different "factions", the members of each faction can be placed in a group so that each individual knows how they should react to a member of a particular faction."

From the wiki

How do I do this? When I go to restrictions it has "Any Character", "Player Character", and then a list of individual characters. I'm trying to do the first one.



This is a separate thing from anything to do with restrictions so I'm not sure exactly what the context is here, but Groups > New Group > Group Type - Character is what that quote from the wiki refers to. You can then create properties that apply to everyone group, or refer to it with task actions/restrictions.


I was trying to make it so that say a character walks into a room with let's say an axe.

Anybody in Group A and the same location would react by screaming. (In theory you would lose reputation with this group's faction)
Anybody in Group B and the same location would react by just eyeing the character. (In theory you would gain reputation with this group's faction)
So if you have say a Group A member and a Group B member in the same area one would scream, the other would just look at you. Behind the scenes, the reputations would change.

It's a system task. I think though I have to create a "Referenced character" which you can only do I think with a general task with a command that refers to a specific character. Since I wanted it to be passive, looks like I'll just forget about this for now.
Heradite
 
Posts: 9
Joined: Fri Feb 07, 2020 5:02 am

Re: Quick Questions

Postby Denk » Mon Feb 10, 2020 11:50 pm

Heradite wrote:I was trying to make it so that say a character walks into a room with let's say an axe.

Anybody in Group A and the same location would react by screaming. (In theory you would lose reputation with this group's faction)
Anybody in Group B and the same location would react by just eyeing the character. (In theory you would gain reputation with this group's faction)
So if you have say a Group A member and a Group B member in the same area one would scream, the other would just look at you. Behind the scenes, the reputations would change.

It's a system task. I think though I have to create a "Referenced character" which you can only do I think with a general task with a command that refers to a specific character. Since I wanted it to be passive, looks like I'll just forget about this for now.

It is definitely doable with system tasks, but among the more advanced things in ADRIFT since you want to loop through all characters in a room, check if someone has just arrived, and then let all the other characters react to the newly arrived character. I hope to look in to it tomorrow but no promises. If someone in the mean time wants to have a go at it, please do so ;)
----------------------------------------------------------------------
The Bash Saga:
1. The Dragon Diamond 2. The Way Home 3. Stone of Wisdom
----------------------------------------------------------------------
Denk
 
Posts: 394
Joined: Mon Feb 22, 2016 6:21 pm
Location: Hjørring, Denmark
Points: 111

Re: Quick Questions

Postby Lumin » Tue Feb 11, 2020 12:00 am

I'm going to experiment with that a bit but I'm pretty rusty at this stuff. At best I will manage some ugly hack that barely holds together and then someone else will come along with the pretty version right after.
User avatar
Lumin
 
Posts: 2067
Joined: Fri Aug 06, 2004 5:48 pm
Points: 34

Re: Quick Questions

Postby Lumin » Tue Feb 11, 2020 1:47 am

So a thing I find myself really wishing for now is a way to have a task check for an object property.

I don't think I'll be able to exactly emulate what Heradite wanted tonight, but I amused myself for a bit rigging up variables like Dangerous, Suspicious, Delicious, Valuable, and Horrible depending on how many cakes and bloody swords and severed heads and the like you decided to pick up and carry around. Instead of anything complicated with NPCs, I just swapped out entire groups with frightened or aggressive doppelgangers depending on how many questionable things you were holding when you walked into a room.

I feel like this would get annoying fast in actual gameplay though, it's the most natural thing in the world for an adventurer to carry around everything not nailed down and this would add a lot of inventory juggling with everything you do. I started messing around with a >wield command that would let you set an item to be the one you want people paying attention to (directly in your hand instead of undefined hammerspace with the rest of your inventory), but I really can't get sidetracked with this any further tonight.

I'm sure what Heradite is trying is doable, but as with a lot of things I think it's going to be a question of the amount of work involved versus what it adds to actual gameplay.
User avatar
Lumin
 
Posts: 2067
Joined: Fri Aug 06, 2004 5:48 pm
Points: 34

Re: Quick Questions

Postby Denk » Tue Feb 11, 2020 9:32 am

Heradite wrote:I was trying to make it so that say a character walks into a room with let's say an axe.

Anybody in Group A and the same location would react by screaming. (In theory you would lose reputation with this group's faction)
Anybody in Group B and the same location would react by just eyeing the character. (In theory you would gain reputation with this group's faction)
So if you have say a Group A member and a Group B member in the same area one would scream, the other would just look at you. Behind the scenes, the reputations would change.

It's a system task. I think though I have to create a "Referenced character" which you can only do I think with a general task with a command that refers to a specific character. Since I wanted it to be passive, looks like I'll just forget about this for now.
To handle this, the fundamental idea is to run a task for every combination of two NPCs at the end of every turn. How to do this is demonstrated in this demo:
NPCpairLoop.taf
(16.03 KiB) Downloaded 34 times
Every turn all characters say "hi" to every other character. This happens in the task "NPC1 says hi to NPC2". I have added the restriction that the NPCs must be in the same location if they are to say hi to each other. Also, I make sure that they do not say hi to themselves. Please note that NPCs which are leaving and entering at the same time, do not say "hi" to each other.

You can have multiple tasks like "NPC1 says hi to NPC2" which runs every turn for every possible pair of characters. e.g. one task could modify the reputation of %character2% if %character2% is in the same room as a Class A member and is carrying an axe. You can add further restrictions, e.g. that the characters have just met after being apart (this restriction will require that you store in a variable the previous location of all characters, to ensure that they were not in the same room in the previous turn).
----------------------------------------------------------------------
The Bash Saga:
1. The Dragon Diamond 2. The Way Home 3. Stone of Wisdom
----------------------------------------------------------------------
Denk
 
Posts: 394
Joined: Mon Feb 22, 2016 6:21 pm
Location: Hjørring, Denmark
Points: 111

Re: Quick Questions

Postby Heradite » Tue Feb 11, 2020 6:48 pm

Lumin wrote:So a thing I find myself really wishing for now is a way to have a task check for an object property.

I don't think I'll be able to exactly emulate what Heradite wanted tonight, but I amused myself for a bit rigging up variables like Dangerous, Suspicious, Delicious, Valuable, and Horrible depending on how many cakes and bloody swords and severed heads and the like you decided to pick up and carry around. Instead of anything complicated with NPCs, I just swapped out entire groups with frightened or aggressive doppelgangers depending on how many questionable things you were holding when you walked into a room.

I feel like this would get annoying fast in actual gameplay though, it's the most natural thing in the world for an adventurer to carry around everything not nailed down and this would add a lot of inventory juggling with everything you do. I started messing around with a >wield command that would let you set an item to be the one you want people paying attention to (directly in your hand instead of undefined hammerspace with the rest of your inventory), but I really can't get sidetracked with this any further tonight.

I'm sure what Heradite is trying is doable, but as with a lot of things I think it's going to be a question of the amount of work involved versus what it adds to actual gameplay.


Well that was just an example. But thanks for trying anyways!

Denk wrote:
Heradite wrote:I was trying to make it so that say a character walks into a room with let's say an axe.

Anybody in Group A and the same location would react by screaming. (In theory you would lose reputation with this group's faction)
Anybody in Group B and the same location would react by just eyeing the character. (In theory you would gain reputation with this group's faction)
So if you have say a Group A member and a Group B member in the same area one would scream, the other would just look at you. Behind the scenes, the reputations would change.

It's a system task. I think though I have to create a "Referenced character" which you can only do I think with a general task with a command that refers to a specific character. Since I wanted it to be passive, looks like I'll just forget about this for now.
To handle this, the fundamental idea is to run a task for every combination of two NPCs at the end of every turn. How to do this is demonstrated in this demo:

NPCpairLoop.taf
Every turn all characters say "hi" to every other character. This happens in the task "NPC1 says hi to NPC2". I have added the restriction that the NPCs must be in the same location if they are to say hi to each other. Also, I make sure that they do not say hi to themselves. Please note that NPCs which are leaving and entering at the same time, do not say "hi" to each other.

You can have multiple tasks like "NPC1 says hi to NPC2" which runs every turn for every possible pair of characters. e.g. one task could modify the reputation of %character2% if %character2% is in the same room as a Class A member and is carrying an axe. You can add further restrictions, e.g. that the characters have just met after being apart (this restriction will require that you store in a variable the previous location of all characters, to ensure that they were not in the same room in the previous turn).


I'll take a look into this. It might end up being too much work but if I can make it work, it'll be solid! Thanks!

You guys are very helpful. I appreciate it a lot!
Heradite
 
Posts: 9
Joined: Fri Feb 07, 2020 5:02 am

Re: Quick Questions

Postby Denk » Tue Feb 11, 2020 7:16 pm

I may not have explained it very thoroughly. You only need those two tasks in the example, no matter if you have six NPCS or 1000 NPCs. When you send the group twice to the task "NPC1 says hi to NPC2" (the task is called from "RunNPCmeetings"), all NPCs will be paired with each other. E.g. if you have 10 NPC's, the task will attempt to run 10*10 = 100 times. It will run less due to the restrictions.

So it isn't a lot of work. But it may be confusing for someone new to ADRIFT. :)
----------------------------------------------------------------------
The Bash Saga:
1. The Dragon Diamond 2. The Way Home 3. Stone of Wisdom
----------------------------------------------------------------------
Denk
 
Posts: 394
Joined: Mon Feb 22, 2016 6:21 pm
Location: Hjørring, Denmark
Points: 111

Previous

Return to ADRIFT 5.0

Who is online

Users browsing this forum: No registered users and 2 guests