Do you mean you're trying to write the player's name in the quest description or something like that?hello and thanks for the great script.
I have noticed that I cant get the player name when using \PN, I was wondering if I am doing something wrong.
yes, if that is possible it would be greatDo you mean you're trying to write the player's name in the quest description or something like that?
I don't think we can specify \PN directly in 004_Quest_Data.rb without it being interpreted literally as text, but there is a way around this because we can overwrite any quest data on the fly. For example, I created a new method for testing this that overwrites the description for Quest1.yes, if that is possible it would be great
def overwriteQuestDesc(quest)
case quest
when :Quest1
QuestModule.const_get(quest)[:QuestDescription] = _I("Hello, World! My name is {1}.", $player.name)
end
end
activateQuest(:Quest1)
overwriteQuestDesc(:Quest1)
It worked like magic, thanks manI don't think we can specify \PN directly in 004_Quest_Data.rb without it being interpreted literally as text, but there is a way around this because we can overwrite any quest data on the fly. For example, I created a new method for testing this that overwrites the description for Quest1.
I put this at the bottom of 001_Quest_Config.rb but it could go anywhere outside of a class/module. Then, when I activate the quest, I do this:Ruby:def overwriteQuestDesc(quest) case quest when :Quest1 QuestModule.const_get(quest)[:QuestDescription] = _I("Hello, World! My name is {1}.", $player.name) end end
No matter what the original quest description was, the one we see on the UI is "Hello, World! My name is Red." (or whatever the player's name is). It's clunky but I hope it helps.Ruby:activateQuest(:Quest1) overwriteQuestDesc(:Quest1)
def overwriteQuestDesc(quest)
case quest
when :Quest3
if $game_variables[1] == 1
QuestModule.const_get(quest)[:QuestDescription] = _I("A note attached to Professor Hawthorn's Lab says that he's at the Library assisting with Storytime with the Lorekeepers. I haven't been to one of those in years... I wonder if it's changed any. Let's find out!")
elsif $game_variables[1] == 2
QuestModule.const_get(quest)[:QuestDescription] = _I("Now that I've returned to the lab with Professor Hawthorn, I can finally choose my very first Pokémon! This is such an exciting moment, I need to think it over very carefully... When I'm done with that, I should talk to the professor again.")
end
end
end
It goes in a script command in an event.Hey, I don't really know what I'm doing because I have looked over the meta data a lot and still don't know how it works. I put activateQuest(quest) with the colon on Quest with the id. So, can you please explain how this works, or where I put this? Thanks.
Sorry, I forgot to reply to you about this! I think we could do this in a somewhat clunky way. Open 002_Quest_Main.rb and find this line:hey man! Was wondering if there's a way to add multiple quests at once without having mutliple new quest messages appear (I'm trying to add like. 13 quests at once lol). There's probably a way to, but I'm pretty unfamiliar with working in scripts so I can't see an obvious way.
pbMessage(_INTL("\\se[{1}]<ac><c2=#{colorQuest("red")}>New quest discovered!</c2>\nCheck your quest log for more details!</ac>",QUEST_JINGLE))
pbMessage(_INTL("\\se[{1}]<ac><c2=#{colorQuest("red")}>New quest discovered!</c2>\nCheck your quest log for more details!</ac>",QUEST_JINGLE)) if !$game_switches[123]
pbMessage
code will work in a script command to display the "new quest" message. Try it and see. Otherwise, you might need to recreate the notification box referring to this Wiki page: https://essentialsdocs.fandom.com/wiki/MessagesI haven't included any code in the resource to make the quest option appear in the pause menu. You'll need to add that yourself. Unless v21 has changed this, you can just copy/paste this code into the relevant place in the scripts:The quest option doesn't show up in the pause menu, even though I successfully activated a quest (the "New quest discovered" message showed up). Is there anyway using v21 of Essentials could cause some issues?
MenuHandlers.add(:pause_menu, :quests, {
"name" => _INTL("Quests"),
"order" => 50,
"condition" => proc { next hasAnyQuests? },
"effect" => proc { |menu|
pbPlayDecisionSE
pbFadeOutIn {
scene = QuestList_Scene.new
screen = QuestList_Screen.new(scene)
screen.pbStartScreen
menu.pbRefresh
}
next false
}
})
“An error” is not enough to identify the problem, you need to share the full message.When I try to start a quest, it gives an error about the name Quest1. How do I fix this?
This is still a lot more useful than just "an error message". This says that you put the quest name in as a constant, when it should be a symbol, with the : in front - :Quest1, not just Quest1.Default RMXP (Which is what I am using) doesn't give very useful error messages. It says "NameError occurred while running script. Uninitialized constant Interpreter::Quest1"
I get this error when starting a quest now
[Pokémon Essentials version 20.1]
[v20.1 Hotfixes 1.0.7]
Script error in event 3 (coords 24,18), map 266 (Dolerite Town)
Exception: NameError
Message: uninitialized constant Interpreter::Quest14
***Full script:
activateQuest(Quest14, "yellow", false)
Backtrace:
(eval):1:in `execute_script'
033:Interpreter:143:in `eval'
033:Interpreter:143:in `execute_script'
034:Interpreter_Commands:1112:in `command_355'
034:Interpreter_Commands:116:in `execute_command'
033:Interpreter:133:in `block in update'
033:Interpreter:90:in `loop'
033:Interpreter:90:in `update'
032:Scene_Map:160:in `block in update'
032:Scene_Map:159:in `loop'
Do I just have to change the name to what the quest's name is?
You need to format it like in this comment. https://eeveeexpo.com/threads/3982/post-49253
How would I make it so that the quest menu pops up from using an item?
Hi!
I haven't thought about this too much, but you should be able to adapt the code for something like the Town Map.
Copy the PBS data for Town Map and rename it to Journal, as you say. Then, put this code in Item_Effects:
Make sure you have this bit of code somewhere (I have it at the bottom of 003_Quest_UI.rb - can't remember if I've added this since posting the resource):Ruby:ItemHandlers::UseInField.add(:JOURNAL,proc { |item| pbViewQuests next 1 })
See if that works for you.Ruby:# Utility method for calling UI def pbViewQuests scene = QuestList_Scene.new screen = QuestList_Screen.new(scene) screen.pbStartScreen end
The main takeaway is that you need your item to run the code pbViewQuests.I don't think that would work for me; the game I'm currently making doesn't have pbs files because it isn't using essentials.