ghype's Problems:
Moderator: Forum Moderators
Forum rules
- Please use [code] BBCode tags in your posts for embedding WML snippets.
- To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Re: ghype's Coding Problems - Ability Work Only On Hit
Hey ghype.
I coded the "shock on hit" special, but it doesn't work. If the enemy is hit by this weapon, its WML shows that the number of strikes is reduced. But that doesn't change anything, it still uses all its strikes. Perhaps the number of strikes is copied before a combat. In other words, changing the number of strikes in a mid combat doesn't affect the current combat. Or maybe lua can help.
I checked that "swarm" special works the same way. Number of strikes is decreased when unit looses HP, but that doesn't affect the current combat.
Just in case posting the code.
I coded the "shock on hit" special, but it doesn't work. If the enemy is hit by this weapon, its WML shows that the number of strikes is reduced. But that doesn't change anything, it still uses all its strikes. Perhaps the number of strikes is copied before a combat. In other words, changing the number of strikes in a mid combat doesn't affect the current combat. Or maybe lua can help.
I checked that "swarm" special works the same way. Number of strikes is decreased when unit looses HP, but that doesn't affect the current combat.
Just in case posting the code.
Spoiler:
Author of SP scenario Dragon Fight and SP campaign Captured by a Nightmare.
Created The Rise of Wesnoth (alternative mechanics) version of the mainline campaign.
Created The Rise of Wesnoth (alternative mechanics) version of the mainline campaign.
Re: ghype's Coding Problems - Ability Work Only On Hit
Thanks for you time, I will look into this with the others, maybe they can make it work.
stuff I worked on: Dunefolk Rework - ghype's Daily Art
Re: ghype's Coding Problems - Ability Work Only On Hit
the number of strikes is determined when the attack begins, see also issue https://github.com/wesnoth/wesnoth/issues/1362
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
Re: ghype's Coding Problems - Ability Work Only On Hit
That is why I said you would need to manually simulate combat.
Re: ghype's Coding Problems - Ignore Specific Trait
Very simple. I want a unit to ignore one specific trait which is tis race has defined for it. But i don't want create a new movetype for that one unit only.
Is there an opposite of
Is there an opposite of
{MUSTHAVE_TRAIT}
like {IGNORE_TRAIT}
?stuff I worked on: Dunefolk Rework - ghype's Daily Art
Re: ghype's Coding Problems - Ignore Specific Trait
Ignore_race_traits and include traits it should have.
Re: ghype's Coding Problems - Ignore Specific Trait
thanks, that did it!
stuff I worked on: Dunefolk Rework - ghype's Daily Art
Re: ghype's Coding Problems
Hi ghype,
An even easier way to do this is with a special [attacks] instead of a dummy. This way the reduced strike is actually displayed in the attack menu before the battle begins, unlike if you use an event.
You can find an example if this in my add on under macros/abilities weapons.cfg
I have created my own shock special for one of the units.
An even easier way to do this is with a special [attacks] instead of a dummy. This way the reduced strike is actually displayed in the attack menu before the battle begins, unlike if you use an event.
You can find an example if this in my add on under macros/abilities weapons.cfg
I have created my own shock special for one of the units.
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon.
Re: ghype's Coding Problems
Oh well that would have saved us a lot of trouble. thanks for pointing this out.
stuff I worked on: Dunefolk Rework - ghype's Daily Art
Re: ghype's Coding Problems
The same special was described in the initial comment https://forums.wesnoth.org/viewtopic.ph ... 30#p639118 . The idea was to apply shock only on hit, which is currently impossible.The_Gnat wrote: ↑March 8th, 2019, 7:34 pm An even easier way to do this is with a special [attacks] instead of a dummy. This way the reduced strike is actually displayed in the attack menu before the battle begins, unlike if you use an event.
You can find an example if this in my add on under macros/abilities weapons.cfg
Author of SP scenario Dragon Fight and SP campaign Captured by a Nightmare.
Created The Rise of Wesnoth (alternative mechanics) version of the mainline campaign.
Created The Rise of Wesnoth (alternative mechanics) version of the mainline campaign.
Re: ghype's Coding Problems
@sergey - Thank you for that, I need to read better
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon.
- Acho161293
- Posts: 32
- Joined: January 29th, 2020, 10:54 am
- Location: indonesian
- Contact:
Re: ghype's Coding Problems
Add this text " hp_bar_scaling=0.01 " to unit type / unit.cfg
Example=
[unit_type]
id=absalom
name="Absalom"
race=undead
gender=male
image="absalom/absalom1.png"
profile="absalom/absalom1.png"
hitpoints=43
hp_bar_scaling=0.01 (PUT IN HERE AND IT IS WORK)
Example=
[unit_type]
id=absalom
name="Absalom"
race=undead
gender=male
image="absalom/absalom1.png"
profile="absalom/absalom1.png"
hitpoints=43
hp_bar_scaling=0.01 (PUT IN HERE AND IT IS WORK)
Re: ghype's Coding Problems
Thanks, but this one was already fixed.Acho161293 wrote: ↑February 6th, 2020, 11:31 pm Add this text " hp_bar_scaling=0.01 " to unit type / unit.cfg
stuff I worked on: Dunefolk Rework - ghype's Daily Art
Coding Problem: Multi-Hex Images
Hello there.
So I managed to place multi-hex images and they do appear in the game.
They however disappear once you move the courser over it and reappear once scroll out and back.
What am I missing?
So I managed to place multi-hex images and they do appear in the game.
They however disappear once you move the courser over it and reappear once scroll out and back.
What am I missing?
Code: Select all
[terrain_graphics]
map="
, *, *, *, *
* ,* , *, *, *
, *, *, *, *
* ,* , *, *, *
, *, *, *, *
* ,* , *, *, *
, *, *, *, *
* ,* , *, *, *
, 1, *, *, *
*, * , *, *, *
, *, *, *, *"
[tile]
pos=1
type=*^Vytb
no_flag=overlay
set_flag=overlay
[/tile]
[image]
name=terrain/scenery/tavern-inside.png
base=90,190
center=252,202
layer=0
[/image]
probability=100
[/terrain_graphics]
Code: Select all
{PLACE_IMAGE terrain/scenery/tavern-inside.png 8 21}
stuff I worked on: Dunefolk Rework - ghype's Daily Art
- beetlenaut
- Developer
- Posts: 2827
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: ghype's Coding Problems
The PLACE_IMAGE macro is for adding items to a hex like a storm trident or ring, so that's why it doesn't work now. You should use the map editor to make a map that has your tile in it. You just need the tile at the position marked "1", and the graphics will fill in the rectangle you defined. (You can also use [terrain] inside an event to modify a tile on the running map.)
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide