Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Petition, allow quest.txt to write messages and play sounds. #821

Closed
Danimal696 opened this issue Apr 20, 2020 · 29 comments
Closed

Petition, allow quest.txt to write messages and play sounds. #821

Danimal696 opened this issue Apr 20, 2020 · 29 comments

Comments

@Danimal696
Copy link

I have prepared a nice sound for when a quest is added or updated. But i cant neither inform the player with a text message (msg=Quest updated) or directly play the sound (soundfx=soundfx\writing.ogg) from quest.txt. I can do it from the npc.txt but i think the rigth place should be into quests.

@Danimal696
Copy link
Author

Danimal696 commented Apr 23, 2020

Hello again, sorry to keep using the issues as a forum but i need some pointers again. I want to make a few quest of kill this kind of enemy that drops meat and bring me 30 of it. How do i get around to it? i looked at Krolan´s emerald quest, but its not a good example since its handled as required/set_status.

How do i manage the game to check i have X meat(or something else) in my possesion when talking with the quest giver and only complete the quest if i have the required amount. And how to make "remove_item=" take more than 1 item; remove_item=1:5 should take 5 potions but only takes one.

@dorkster
Copy link
Collaborator

Internally, the engine clears and re-evaluates the quest log every time there is a campaign status update. So without storing some extra state, adding message/sfx there would cause them to trigger every time this happens. It just made more sense to delegate this type of behavior to Events.

What you could do if you want a common message + sound cue for quests is create a script like so:

# scripts/new_quest.txt
[event]
msg=Quest added.
soundfx=soundfx/new_quest.ogg

# any map or npc event
[event]
script=scripts/new_quest.txt

The "item:quantity" syntax isn't universal (I think it only works for NPC stock). But there's no reason it shouldn't be adapted for requires_item, requires_not_item, and remove_item. I'll work on adding it for 1.12.

reward_item would also be a good candidate to support this syntax, but doing so would conflict with the existing syntax. Perhaps the colon syntax could be supported, but only if the quantity is explicitly defined:

# rewards 5 of item id 1
reward_item=1,5

# rewards 1 each of item ids 1 & 5
reward_item=1:1,5:1

# meanwhile, both of these would be the same
requires_item=1,5
requires_item=1:1,5:1

Not ideal, because it's inconsistent. But backwards compatibility would be maintained.

@Danimal696
Copy link
Author

So i guess "fetch X objects" quest are out. Ill change it to kill one strong individual then.

@Danimal696
Copy link
Author

Danimal696 commented Apr 25, 2020

Yet another question, it seems all attacks have a hardcoded visual cooldown when used, can it be changed? i want to give heavy weapons a longer cooldown while attacking (power.txt ->cooldown=800ms) but i can see that with this two cooldown bars start working, the first a very short one cooldown (i suspect harcoded), and then the cooldown bar for my assigned time (it starts taking into account the correct passed time, so its over half always).

I tried going into stats.txt "cooldown" but it doesnt affect it either, so i checked all other mods and saw that none of them address the problem and just stick to super fast attacks, "Shield" power is the only exception in which you can see what i mean.


one more, whats the proper sintax for replace power?
replace_power=600,601 this one?;

The idea is that all weapons have a power i assigned by weigth(different weigths have different cooldown), 600->ligth weapons, 601->medium, 602-> heavy. So when a heavy weapon is equiped it will overwrite the power of the others so you cant use it as fast as a dagger.
Its that how it works or is it something else? I tried it but it just creates all 3 powers on the action bar instead of overwriting the current one.

@dorkster
Copy link
Collaborator

The first "cooldown" that you see is based on the character's attack animation. So in the case of fantasycore, this is 400ms for the swing animation (see animations/hero.txt).

While you could make a separate animation for slower weapons, it would be much easier to add bonus=attack_speed,80 to heavy weapons for 80% attack speed.


That the correct syntax for replace_power, but the power that you replace shouldn't be a power that can be normally used. In your example, power 600 should just have the name/description/icon for the power. Then 601, 602, 603 should be the light, medium, heavy versions respectively. This is how we do the different ammo types (stones & arrows) for ranged weapons in flare-game.

@Danimal696
Copy link
Author

Danimal696 commented Apr 25, 2020

I cant seen to make anything work, i migth be doing everything wrong.
First, the speed, i tried bonus=attack_speed,80 and attack_speed=80 on the heavy attack, but the animation is still fast as always. (im putting these line in powers.txt)
Second, i created a dummy swing that does nothing, then 3 daggers, each have one of the 3 attack types power calls. But when i equip then, it doesnt overwrite the dummy and creates a new atttack action icon, im posting my powers below:


#Dummy swing power to be replaced by real ones at equiping weapons
[power]
id=600
name=Dummy swing
icon=1
description=Dummy melee attack


#Fast swing for daggers and ligth weapons
[power]
id=601
name=Fast swing
type=fixed
icon=1
description=Fast melee attack
new_state=swing
face=true
use_hazard=true
base_damage=melee
lifespan=33ms
radius=1.0
starting_pos=melee
replace_power=600,601
replace_power=602,601
replace_power=603,601

#Medium swing for average weigth weapons
[power]
id=602
name=Swing
type=fixed
icon=1
description=Average speed melee attack
new_state=swing
face=true
use_hazard=true
base_damage=melee
lifespan=33ms
radius=1.0
starting_pos=melee
cooldown=500ms
replace_power=600,602
replace_power=601,602
replace_power=603,602

#Slow swing for heavy weigth weapons
[power]
id=603
name=Heavy swing
type=fixed
icon=1
description=Heavy melee attack
new_state=swing
face=true
use_hazard=true
base_damage=melee
lifespan=33ms
radius=1.0
starting_pos=melee
cooldown=800ms
#attack_speed=80
#bonus=attack_speed,80
replace_power=600,603
replace_power=601,603
replace_power=602,603

@dorkster
Copy link
Collaborator

Sorry, I should have clarified this: Both bonus and replace_power are properties of items, not powers.

# In items/items.txt

# normal weapon
replace_power=600,602

# light weapon
bonus=attack_speed,120
replace_power=600,601

# heavy weapon
bonus=attack_speed,80
replace_power=600,603

@Danimal696
Copy link
Author

Danimal696 commented Apr 26, 2020

Thanks, such simple detail was giving me quite the headache. Now i properly set up this, just a few trivial things came out.
-Each time i change daggers a new power icon is created, but since it gets replaced i end up with 3 icons representing the very same power(all 3 change at the same time when changing dagger), its not game breaking but, could it be fixed in some way?
-bonus=attack_speed,80 does nothing, its just a flavour text thing? i tried changing 80 to 10 but it has the same result. Only cooldown=ms seems to properly affect attack time.

@dorkster
Copy link
Collaborator

  • It's not immediately apparent to me why you're getting multiple power icons. Can you post/send me your items.txt and powers.txt?
  • I completely forgot something about attack speeds. Checking the log, I saw: EffectManager: Attack speeds less than 100 are unsupported.. I think this is something that I can fix, so I'll work on that.

@Danimal696
Copy link
Author

Sent you a mail, its from my hotmail account.
For items, the ones i used are at the end (777+) just testing items for now, for powers, the only ones im working with yet are just 600,601,and 602. All the others are from alpha and no name mod.
As for the attack speed, it seems it only works when the speed is risen (ex. 200%) but not when lowered below 100%.
Thanks for your help.

@dorkster
Copy link
Collaborator

I've fixed the attack speed problem: flareteam/flare-engine@d1a5e85

I think I see your problem with replace_power. Here's roughly what you should do:

### powers.txt
# this is a meta power. Use this power ID in your power tree and in the class default action bar
[power]
id=603
name=Swing
description=Basic melee attack
icon=1
meta_power=true

### items.txt
# fast dagger
replace_power=603,600

# medium dagger
replace_power=603,601

# heavy dagger
replace_power=603,602

@Danimal696
Copy link
Author

Danimal696 commented Apr 26, 2020

Thanks for coming to the rescue each time, its finally working well now; so, is there a way i can get the newest version of the engine without building it? i can wait for it no problem but it would be nice to know either way.

@dorkster
Copy link
Collaborator

Here's a fresh Windows build: https://drive.google.com/open?id=1IGHd3QgRhRA-jjq-Pv4GjGZlKR1lNix3

@Danimal696
Copy link
Author

Danimal696 commented May 10, 2020

Hello again, i loved some of the new little details like the minimap colour upgrade, thanks for the up-to-date build. Sorry for taking so long to answer but its just i wont post without need to avoid bloating the section. Now, if you dont mind i have a couple of questions about graphics:

  • Icons declarations(for inventary new weapons and objects): im making new items, i saw the blend file to create the new icons (quite smart, i thougth they were hand made pixel art), but when im dealing with using new icons ingame i dont know how it really works; an item calls an icon number on its .txt but i couldnt find anywhere where the icons are declared. So does the engine just count them based on their size, like if i add a new icon, the engine will count the whole .png file and auto-number them all?

Characters: i havent started to make new ones out of fear; i know i can reuse the blender-skeleton and export as-if using the generic animation .txt. But i want to create more non bipedal enemies, so far i saw 2 methods, declaring by hand everything which i would prefer to avoid like the plague:
[stance] frames=4 duration=800ms type=back_forth frame=0,0,374,830,50,50,29,45 frame=0,1,155,392,43,50,17,46 frame=0,2,258,253,49,55,10,47 and the like...

Or using this other,
[run] position=4 frames=8 duration=533ms type=looped
With this one, do i only need to tell the duration, valid action name, and the position the action starts on the spritesheet? Will it it work for something not human?

@dorkster
Copy link
Collaborator

Icons

You are correct. The engine counts the icons from left-to-right, top-to-bottom in the available icon images. By default, the engine will just look for images/icons/icons.png, but you can use multiple images by setting up engine/icons.txt. Ex:

# The number is to define where the engine should start counting icons.
# So the first icon in "icons_empyrean.png" will be id 256
icon_set=0,images/icons/icons.png
icon_set=256,images/icons/icons_empyrean.png
icon_set=512,images/icons/icons_crafting.png
icon_set=1024,images/icons/icons_overlay.png

FYI, the icon size is set in engine/resolutions.txt:

# icons are always square, so this is 32x32
icon_size=32

Animations

The second style is for non-packed animations, and is likely what you want to use to get started. Refer to the Animation Definitions wiki page for a better explanation.

@Danimal696
Copy link
Author

Danimal696 commented May 11, 2020

Thanks Dorkster, by the way how is you new mod doing? It was a continuation to Empyrean, i think? I remembered something, do you mind if i use some of your magical item declarations? it would save me lots of time to populate the list.

@dorkster
Copy link
Collaborator

I haven't really been working on it lately. Usually whenever I touch Flare, I end up doing engine stuff.

do you mind if i use some of your magical item declarations?

Go right ahead.

@Danimal696
Copy link
Author

Hi again, is this the correct sintax? the potion is supposed to clean all debuffs but nothing happens (tried to clean bleeding with no success):
post_effect=status_restore,15,33ms

What does that 15 value mean?

@dorkster
Copy link
Collaborator

status_restore is not an effect type. What you're looking for is immunity. The "15" is the effect magnitude. But the magnitude is ignored for the immunity effect, so you can just set it to 0.

post_effect=immunity,0,33ms

If you want, you can create a custom immunity effect called status_restore in powers/effects.txt, which will allow you to customize its icon/animation/etc:

[effect]
id=status_restore
name=Status Restore
type=immunity
#icon=
#animation=
#can_stack=

A list of valid effect types can be found here: https://github.com/flareteam/flare-engine/wiki/Attribute-Reference#effectmanager

@Danimal696
Copy link
Author

Danimal696 commented Jun 15, 2020

Hello, i have another question, how do i control the dead of a boss class enemy? I know i can create an "on_clear" event , but thats for small maps with not many enemies; what about boss mixed into big maps?
Ex: kill the alpha wolf and the war boar. They are both on the same big map with many of their followers plus random enemies sprinkled everywhere, how do i handle it? all examples i have found resolve it by a story unique drop; i dont want that, is there no way to set an status on a particular enemy death?

@dorkster
Copy link
Collaborator

is there no way to set an status on a particular enemy death?

In the enemy definition, use defeat_status. For example, defeat_status=my_status would set the campaign status my_status.

@Danimal696
Copy link
Author

Thanks for your express answer :)

@Danimal696
Copy link
Author

Danimal696 commented Jun 23, 2020

Hello, i came agaisnt something strange, today i fully finished a wolf model. But something strange happens when it dies, after the animation fully plays ( =play once; it also does the same with the other animations) the wolf model moves a bit upwards/sideways like searching for an invisible center. Im sure its not the animation or blender fault (i have applied all modifiers and reseted its center). Any ideas? i was able to see the stocks models veryyyy rarely do it as well.

@dorkster
Copy link
Collaborator

That is actually intentional. Stationary objects would appear to "jitter" when the camera moved due to how their floating point positions got mapped to the screen. To fix it, we move these objects to "friendly" positions that map consistently to pixel coordinates. Here's the function from Utils.cpp:

void FPoint::align() {
	// this rounds the float values to the nearest multiple of 1/(2^4)
	// 1/(2^4) was chosen because it's a "nice" floating point number, removing 99% of rounding errors
	x = floorf(x / 0.0625f) * 0.0625f;
	y = floorf(y / 0.0625f) * 0.0625f;
}

@Danimal696
Copy link
Author

Guess ill just ignore it then, the effect is a bit strange since im adding blood pools to enemies and it "jumps" a bit.

@Danimal696
Copy link
Author

Wolf enemy pack, in case you want to include it in sources:
https://opengameart.org/content/wolf-monsters-animated

@Danimal696
Copy link
Author

Danimal696 commented Dec 9, 2020

Hi again dorkster, i got a big doubt, how does the loot rng selection system work? I use loot lists, but i tried to add duplicates calls to it at an enemy txt in the hopes of creating a "spring of loot" from a boss
Ex; My common calls(works fine):
loot=loot/level_2-4.txt
loot=loot/level_low.txt <- potion and jewels inside only

I tried this, but it didnt work at all, sometimes drop some gold and potions, its like its ignoring the other items (is there a max for loot lists calls on enemy.txt?):
loot=loot/level_2-4.txt
loot=loot/level_2-4.txt
loot=loot/level_2-4.txt
loot=loot/level_low.txt
loot=loot/level_low.txt
loot=loot/level_low.txt

After this i experimented with the loot list itself (loot/level_2-4.txt )and tried this:

  • gold
    loot=currency,25,10,40
  • normal clothes
    loot=30,100
    loot=31,100
    loot=32,100
    The result should be perhaps gold and one piece of each loot, but its not like that, at most i get 2 pieces or 1 piece and gold, like there is a hardcap of 2 somewhere? help please?

@dorkster
Copy link
Collaborator

dorkster commented Dec 9, 2020

You can define the min/max number of loot drops for an enemy by using the loot_count key in the enemy definition. For example, if you wanted the enemy to drop between 2 to 5 items, you would use:

loot_count=2,5

The loot key basically adds items to the table where those 2-5 items will be picked from. As long as there is one item in the table with a 100% drop chance, you will get between 2-5 items. If not, then you could get unlucky with the rolls and get less than 2 items.

@Danimal696
Copy link
Author

I also found this :
drop_max=2 in engine/loot.txt
, but it doesnt allow fine adjustements like your solution. You have my thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants