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 wrongJay_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
Quest Editor
- TheLacus
- Posts: 1305
- Joined: Wed Sep 14, 2016 6:22 pm
Re: Syntax highlighting
- Hazelnut
- Posts: 3016
- Joined: Sat Aug 26, 2017 2:46 pm
- Contact:
Re: Syntax highlighting
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
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
- TheLacus
- Posts: 1305
- Joined: Wed Sep 14, 2016 6:22 pm
Re: Syntax highlighting
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?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
- Hazelnut
- Posts: 3016
- Joined: Sat Aug 26, 2017 2:46 pm
- Contact:
Re: Syntax highlighting
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.
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
- Interkarma
- Posts: 7247
- Joined: Sun Mar 22, 2015 1:51 am
Re: Syntax highlighting
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.
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.
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
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.
- Hazelnut
- Posts: 3016
- Joined: Sat Aug 26, 2017 2:46 pm
- Contact:
Re: Syntax highlighting
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?
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
- Interkarma
- Posts: 7247
- Joined: Sun Mar 22, 2015 1:51 am
Re: Syntax highlighting
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.
- Jay_H
- Posts: 4072
- Joined: Tue Aug 25, 2015 1:54 am
- Contact:
- Binarynova
- Posts: 6
- Joined: Sat Feb 17, 2018 3:47 am
Re: Syntax highlighting
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?
- Hazelnut
- Posts: 3016
- Joined: Sat Aug 26, 2017 2:46 pm
- Contact:
Re: Syntax highlighting
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