Quest Editor

For all talk about quest development - creation, testing, and quest system.
Post Reply
User avatar
TheLacus
Posts: 1305
Joined: Wed Sep 14, 2016 6:22 pm

Re: Syntax highlighting

Post by TheLacus »

Jay_H wrote: Fri Sep 07, 2018 7:52 pm Trying to use the "named" parameter when defining a quest NPC produces red underlines. Here's an example:

Code: Select all

Person _crow_ named The_Crow faction The_Crow male
Are you sure you can use named and faction at the same time? My understanding is that individual npcs are already their own factions, in fact you are using The_Crow for both. I believe faction value is just ignored here, but correct me if i'm wrong :)

User avatar
Hazelnut
Posts: 3014
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Syntax highlighting

Post by Hazelnut »

Yes you can specify both, in fact in this case it has to otherwise the faction which is an individual doesn't match correctly because it should have a name. I was just reading how the Person class worked, so I am assuming it's implemented correctly.

FYI I advised Jay how to get this working here: https://forums.dfworkshop.net/viewtopic ... 049#p15049
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
TheLacus
Posts: 1305
Joined: Wed Sep 14, 2016 6:22 pm

Re: Syntax highlighting

Post by TheLacus »

Hazelnut wrote: Sat Sep 15, 2018 4:29 pm Yes you can specify both, in fact in this case it has to otherwise the faction which is an individual doesn't match correctly because it should have a name. I was just reading how the Person class worked, so I am assuming it's implemented correctly.

FYI I advised Jay how to get this working here: https://forums.dfworkshop.net/viewtopic ... 049#p15049
Thank you for your answer Hazelnut, but i'm not able to put in practice what you said. In the link you posted, Jay_H changed Person _crow_ faction The_Crow to Person _crow_ named The_Crow faction The_Crow. From what i read in the Person definition interpreter, this means that factionData is set by SetupIndividualNPC() instead of SetupFactionAllianceNPC(); it looks like factionAlliance is simply not stored if a name is found. What am i missing?

User avatar
Hazelnut
Posts: 3014
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Syntax highlighting

Post by Hazelnut »

Hmm, in that case we will have to wait for Interkarma to weigh in as this is his code and I don't really understand it.

When I advised Jay it was after diagnosing that the code in QuestResourceBehaviour.DoClick() where it tests if the faction is an individual and then in ClickAllIndividualNPCs(int factionID) it gets person resources from active quests, checking person.IsIndividualNPC which only returns true if the parsing caused Person.SetupIndividualNPC() to be called. This is only called when the person line contains a name. It does look like the faction is simply unneccessary so maybe my advice should have been to replace it to give:

Person _crow_ named The_Crow male

This may be incorrect logic but that's what's currently there, and my advice to Jay was simply from reading the code and thus could have been wrong. Was just trying to help and reduce Interkarma's workload.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
Interkarma
Posts: 7234
Joined: Sun Mar 22, 2015 1:51 am

Re: Syntax highlighting

Post by Interkarma »

Individual NPCs are of type 4 in their faction data. They have unique sprites and appear in quests with the name defined in FACTION.TXT. Examples are "King Gothryd" and "Lady Brisienna". These NPCs are usually found automatically in their home location (e.g. Gothryd is in Daggerfall Castle) but can be moved or placed specifically for a quest (e.g. Lady Brisienna is placed to random tavern).

Faction Alliance NPCs are random NPCs generated at runtime. Their faction data defines themed male and female sprites to be shown when placed by a quest and they receive a random name. Most factions entries define flat data and could be used as a faction NPC. For example, it lets you place a member of the Thieves Guild somewhere as part of a TG quest and their sprite will look appropriately shady. Same concept for merchants, nobles, etc.

My understanding is that individual NPCs and faction NPCs are mutually exclusive. When setting up a Person resource, my code will prioritise individual NPCs over faction NPCs, you can't use both at once. In this case, the following should be all that's needed to use The Crow in a quest.

Code: Select all

Person _crow_ named The_Crow
I didn't look too deeply at Jay's original problem, I'm sorry. By the time I read the thread he seemed happy the problem was solved so I just moved on.

You're likely correct Hazelnut that something else is going on around the click itself. I'd need to look back at the original issue again. And thank you, your help is always appreciated. :)

User avatar
Hazelnut
Posts: 3014
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Syntax highlighting

Post by Hazelnut »

Thanks for the explanation, I think that TheLacus is correct and these are mutually exclusive - my mistake.

Jay, can you change that person definition again and check it works?
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
Interkarma
Posts: 7234
Joined: Sun Mar 22, 2015 1:51 am

Re: Syntax highlighting

Post by Interkarma »

I just posted more information to that bug report. I think it was just the usage of "give pc _reward_". This action always opens a message box with QuestComplete text.

User avatar
Jay_H
Posts: 4059
Joined: Tue Aug 25, 2015 1:54 am
Contact:

Re: Syntax highlighting

Post by Jay_H »

Hazelnut wrote: Wed Sep 19, 2018 10:54 pm Jay, can you change that person definition again and check it works?
Yep, just "named The_Crow" is enough, and it works fine in TheLacus' editor. We'll go with this simple iteration then.

User avatar
Binarynova
Posts: 6
Joined: Sat Feb 17, 2018 3:47 am

Re: Syntax highlighting

Post by Binarynova »

I did a search through this topic, and I see that it kind of came up, but I didn't see like a definitive answer or a download, so I just wanted to ask, is there a way to get this functionality in Atom.io?

User avatar
Hazelnut
Posts: 3014
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Syntax highlighting

Post by Hazelnut »

I figured out how to do this at one point but I didn't get around to documenting it. I tried what I could remember with a more recent release and it didn't work. I spent 0 time trying to figure out why. I can give you the info I can recall if you fancy working it out and reporting back. I may get around to doing this myself (I did intend to) but it wont be for a while.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

Post Reply