Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Hipshot

Pages: [1] 2 3 ... 31
1
Editor Discussion / Re: Simple quest and dialogue in Hammerwatch 2
« on: August 19, 2022, 08:36:26 PM »
It's easy to connect dialogue with the world, both from just brining up the speech bubble and when you accept something, for example from these:


AddRewardGlobalEvent(string event); -> Calls out an event as a quest reward or from a querryPrompt button.
AddStartGlobalEvent(string event); -> When you start a quest.
AddEffectGlobalEvent(const strin &in event) -> When you just bring up a speech bubble, whatevertype.

Then in the world you just use a GlobalEventTrigger to check if the condition is true, you can also do other things like check flags etc.

2
Editor Discussion / Simple quest and dialogue in Hammerwatch 2
« on: August 18, 2022, 04:16:42 PM »
The dialogue system can be very advanced and call on various features and systems in the game, it's almost impossible to give examples of everything one can do with it, it's one of those things where you just have to experiment and see if you can do "just that".
But at least a basic dialogue and quest is simple to set up and manage, this text will explain how you do that.

(The phrase called mymod, this should be replaced with the name of the mod or something else to make it easier to identify the mod later on.)

To start with you need to create an NPC to talk to, one that can give you the quest and where you will hand it in for a reward.
In the extracted resources, go into the folder, actors/npcs/quest and copy the file named npc_halvard.unit into your modfolder and change the filename to "npc_michael.unit'.
Open the new npc and find where it says:
Code: [Select]
%defblock Dialog
<f>0</f><s></s>
<f>6</f><s>tweak/quests/dialog_world.sval:npc_halvard</s>
<f>22</f><s></s>
%endblock

%defblock Schedule
<f>0</f><s>tavern_upstairs</s>
<f>6</f><s>halvard_idle</s>
<f>22</f><s>tavern_upstairs</s>
%endblock
Change it so it looks like this:
Code: [Select]
%defblock Dialog
<f>0</f><s>mymod_dialog.sval:npc_michael</s>
%endblock

%defblock Schedule
<f>0</f><s>michael_idle</s>
%endblock
This changes so the dialogue Michael uses are directed to a file in your modfolder and that he will be able to talk to you all hours of the day instead of just from 06 to 22 and he won't go to sleep either, he will just stand in one place whatever happens around him, you can also change where it says NPCNAME from Halvard to Michael to make it simpler to detect the npc in the game when debugging if needed.

Now you have an npc you can place in a mod level, you will have to restart the editor to see this new unit.
You will notice that when you walk up to Michael, you can't interact with him or anything like that. It's because he's missing his dialogue.

Let's add a dialogue and at the same time, add a quest to that.
We need another file to do this, a .mas file that will handle all dialogue and quests for NPCs in your mod. In the extracted resources, go into the folder tweak/quests and copy the file called world.mas into your mod folder.
Rename the file to mymod.mas. this file should contain all dialogue and quests for your mod, you can make more file if you feel it's easier or include like we have done in the base game, but in most cases you should be fine with only one file as in this example. Open the file.

To make it easier upon yourself, erase everything inside it and paste the following:
Code: [Select]
%include "scripts/Quests/GenerationHelper.inc"
%include "tweak/quests/experience_levels.inc"
void Execute()
{
//DONT CHANGE BELOW HERE
GenerateFiles("mymod_world.sval", "mymod_dialog.sval");
}

Now you have a clean basic structure where you can add dialogue trees and quests.

Let's give Michael a dialogue that will give you a quest that you can complete.
In the .mas file, copy what's below, either the entire thing or just what's missing from the clean one you just made.
Code: [Select]
%include "scripts/Quests/GenerationHelper.inc"
%include "tweak/quests/experience_levels.inc"
void Execute()
{

CreateDialog("npc_michael", "Michael Douglas");

AddQuestPrompt("quest-michaelsquest");
SetText("Hi, I'm looking for a few carrots, can you help me find these?");
SetActiveText("Did you ever find any carrots?");
SetFinishedText("Great, nom nom!");
SetAfterText("I just love carrots. I hope these lasts long!");

CreateQuest("quest-michaelsquest", "The Carrot Lover", "I love carrots, I can eat them all day if I had enough. You know, if you can bring me a hefty load, I will give you these rare boots? How about it?");
AddMissionCollectItem("carrot", 15, true);
AddRewardEquipment("feet", "epic", "expert");
AddRewardExperience(500);


//DONT CHANGE BELOW HERE
GenerateFiles("mymod_world.sval", "mymod_dialog.sval");
}

If we break down what we see here a bit. The first line, where it says CreateDialog is what defines a dialogue for an npc here we also have the name that will be displayed on the speech bubble, more or less the name of the NPC how it's shown to players in the game. After we have that defined, we can give the npc various different types of dialogue types like, TimedPrompt, DetailPrompt, QueryPrompt etc, but now we will use the QuestPrompt.

This is a break down of the quest prompt, the most basic usage of it:

AddQuestPrompt -> This must be the corrent ID of the quest you want attached to this dialogue.
SetText -> This is the speech bubble dialogue of the npc, the one that will lure the player to take the quest.
SetActiveText -> This is the speech bubble dialogue displayed while the quest is active (not finished).
SetFinishedText -> Short speech bubble text shown when you complete the quest, usually something like "thanks".
SetAfterText -> When the quest is complete, the npc will say this.

Then after that we will add the quest itself, the one that will show up in the quest log and give us a reward when we complete it, in this case, find 15 carrots and hand them to Michael. A quest can have a plethora of variables, too many to list now, this is just a simple quest so.

CreateQuest -> The first segment is the quest ID, this is the one you call from the QuestPrompt, then you have the quest name and last the quest description, these two are displayed when you push the button for more info and can also be seen in the quest log later on.
AddMissionCollectItem -> This one defines what item to find and how many of them, the true value is set if you also want to have these items removed from your inventory, in 99% of the cases you want this.
AddRewardEquipment -> These are the boots that you get as reward when you complete the quest.
AddRewardExperience -> And this is how much experience you gain.

If you want to make another npc with another quest, duplicate this entire text and rename the CreateDialog to something else, like npc_karen or so and then play around with different quest requirements, like change the carrot to apple or dirt, you can also give money as reward or take money from the player when he completes the quest.

3
Those values are unfortunate hardcoded into the game and can't be modded.

4
Editor Discussion / Re: Help with script icons in editor
« on: March 02, 2017, 08:43:03 AM »
This is an issue with newer drivers I think, at least on nVidia cards.

5
Editor Discussion / Re: Statue puzzle Help
« on: March 02, 2017, 08:42:09 AM »
So, Ive seen a few mods do this. The only thing I can say and I know it's not helpful, is that the game wasn't designed for this, it bugs out in multiplayer, it's not a stable way of doing things I'm afraid.

Enemies aren't always properly synced so puzzles like these tends to break in multiplayer, even if you have a really good ping to each other.

6
It's a good idea, but not really doable I'm afraid, in the way the system works.

7
It's probably better if he does so I won't forget!

8
You don't apply, we invite, but I'll remember that you want to be in! =D

9
Yes, there will most likely be some kind of closed beta for this game!

10
You will be able to test it in time =D

Glad you are following us on Youtube, you can also take a look at our twitter account where we post more often @ https://twitter.com/RealCrackshell

We will also in time remake this forum to support more games!

11
Sorry for not answering before about the spikes, but if you load the campaign level 2 and look how that's scripted, you see that there's a script that restarts the entire sequence on level load (I think if I remember correctly), this prevents spike bugs like these from happening!

12
We tried it, it was fun, act2 is nice, however, we died somewhere, cause there was some error with the spikes, I'm not sure where, perhaps Christian can tell you more.

I think it has to do with level change actually...

13
We are all looking forward to this update =D

14
We can test it tomorrow at work =)

15
Hammerwatch Discussion / Re: New To Hammerwatch!
« on: September 19, 2015, 09:06:01 AM »
If someone dies, the other person can just buy an extra life and then the other person will be resurrected =)

Pages: [1] 2 3 ... 31