Poison Code

The place to post your WML questions and answers.

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.
User avatar
Lehor
Posts: 17
Joined: January 8th, 2013, 6:22 pm

Poison Code

Post by Lehor »

Hello,

does somebody of you know what the code of the weapon file of poison is?
I mean these files like absorb.cfg and so on which determine the functions of the special weapons.

Thank you for your answers!
Greetings Lehor
User avatar
Dugi
Posts: 4961
Joined: July 22nd, 2010, 10:29 am
Location: Carpathian Mountains
Contact:

Re: Poison Code

Post by Dugi »

Look into abilities.cfg maybe, but that isn't the exact code that is there. Poison is handled by the executable, there are no .cfg files that describe it.
Wussel
Posts: 624
Joined: July 28th, 2012, 5:58 am

Re: Poison Code

Post by Wussel »

Most annoying is that it is not possible to make stronger or weaker poison.

But maybe you find a way. Good luck.
User avatar
Dugi
Posts: 4961
Joined: July 22nd, 2010, 10:29 am
Location: Carpathian Mountains
Contact:

Re: Poison Code

Post by Dugi »

Wussel wrote:Most annoying is that it is not possible to make stronger or weaker poison.
???
You CAN make a purely WML-based imitation of poison, with all effects it should have, but possibly with different damage, healing possibilities, and so on. Also, the amount of damage poison does is a global setting that can be changed, although it is not recommended.
User avatar
Lehor
Posts: 17
Joined: January 8th, 2013, 6:22 pm

Re: Poison Code

Post by Lehor »

So what would the code for the poison be?

Greetings Lehor
User avatar
Pentarctagon
Project Manager
Posts: 5527
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Poison Code

Post by Pentarctagon »

Moved to WML Workshop as well.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
Wussel
Posts: 624
Joined: July 28th, 2012, 5:58 am

Re: Poison Code

Post by Wussel »

Hi, I gave up on messing with poison ability long ago.

Assuming you want an apprentice unit with weak poison say "4".

That would make it useless to change poison globally. Easiest way would probably be to "remember" who got poisoned by "apprentice" and add 4 HP back every turn.

I would not expect Dugi to write a useful wml version of poison for you.

It would be most easy to include more variety in the code say:

Damage each turn (1 to 12) standard 8
Kills at the end (Yes or No) standard No
Lasts how many rounds (1 to indefinite) standard indefinite

That would take a while and it would have to get on the radar of the developer. They probably know this and disregarded it because it makes the game more sophisticated.

Good luck and keep posting!
User avatar
Dugi
Posts: 4961
Joined: July 22nd, 2010, 10:29 am
Location: Carpathian Mountains
Contact:

Re: Poison Code

Post by Dugi »

I have not written any WML for him because of the way he asked for it. I don't like this attitude. A normal person would ask how to do it or something, but he told me to do it.

For specific poison-like abilities, the code would consist of a dummy weapon special (possibly also an object that colours the unit green, via apply_to=image_mod), an event that inflicts a status when the weapon special hits, a turn refresh event that would unpoison all units poisoned this way standing in a village or next to a healer and damage those who remain poisoned. Of course, this is quite easy, but still too long to write for somebody who asks in a rude way.
Varkarrus
Posts: 26
Joined: March 16th, 2013, 6:40 pm

Re: Poison Code

Post by Varkarrus »

Check again, he wasn't being rude at all. Also, it doesn't sound like he speaks English that well, so he gets at least a bit of a free pass.
User avatar
Dugi
Posts: 4961
Joined: July 22nd, 2010, 10:29 am
Location: Carpathian Mountains
Contact:

Re: Poison Code

Post by Dugi »

He broke the guideline 'ask, don't demand'. This was pretty much a demand, as if it was my or someone else's duty to help him. That is why I didn't reply. That is why nobody else replied except two posts that weren't helpful to him at all.

Anyway, I have already written the principal instructions to write the code. It is meaningless to give entire pieces of code to people with little coding knowledge, because they may place it incorrectly then, or do a small change wrongly and then report that it doesn't work. It happened many times. It is much better to help him to write the code, giving him hints, corrections and smaller pieces of code, until it gets assembled. This takes more time, but will teach him to use similar things and will make sure that he'll not ask two days later about another custom ability with similar properties.
User avatar
8680
Moderator Emeritus
Posts: 742
Joined: March 20th, 2011, 11:45 pm
Location: The past

Re: Poison Code

Post by 8680 »

Dugi wrote:He broke the guideline 'ask, don't demand'.
If you felt that Lehor’s post was in violation of the Posting Guidelines (specifically §1i thereof), then you ought to have reported it, per Posting Guidelines §5, as I have told you before.
Dugi wrote:This was pretty much a demand, as if it was my or someone else's duty to help him.
I disagree. “So what would the code for the poison be?” seems to me to be a perfectly valid question being asked.
Dugi wrote:That is why I didn't reply. That is why nobody else replied except two posts that weren't helpful to him at all.
Wussel’s post seems to me to be meant helpfully. Pentarctagon’s post doesn’t count, being merely a notice of thread movement, not constituting participation in the thread.
JaMiT
Inactive Developer
Posts: 511
Joined: January 22nd, 2012, 12:38 am

Re: Poison Code

Post by JaMiT »

Wussel wrote:They probably know this and disregarded it because it makes the game more sophisticated.
That would be better worded as "complicated" or "complex", not "sophisticated". One of the guiding principles of Wesnoth game design is "Keep It Simple-Stupid".[1] Greater sophistication in implementation (more-or-less meaning being able to handle variations) is usually good, provided the overall "simple stupid" guideline is not violated.

In this case, the question really is whether or not it is worth complicating the player's experience with poisons of various strengths. For example, suppose a player has poisoned units on the board -- how would the player know which are affected by the weaker (or stronger) poison and which are affected by standard poison? How would this difference be distinguished in the poisoning units? (And maybe some additional non-obvious complications that I cannot think of off the top of my head.) Is there enough benefit from this change to poison to warrant these complications for players?
User avatar
Pentarctagon
Project Manager
Posts: 5527
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Poison Code

Post by Pentarctagon »

JaMiT wrote:
Wussel wrote:They probably know this and disregarded it because it makes the game more sophisticated.
That would be better worded as "complicated" or "complex", not "sophisticated". One of the guiding principles of Wesnoth game design is "Keep It Simple-Stupid".[1] Greater sophistication in implementation (more-or-less meaning being able to handle variations) is usually good, provided the overall "simple stupid" guideline is not violated.

In this case, the question really is whether or not it is worth complicating the player's experience with poisons of various strengths. For example, suppose a player has poisoned units on the board -- how would the player know which are affected by the weaker (or stronger) poison and which are affected by standard poison? How would this difference be distinguished in the poisoning units? (And maybe some additional non-obvious complications that I cannot think of off the top of my head.) Is there enough benefit from this change to poison to warrant these complications for players?
An easy way to let players know would be to have it say something like "-X Poison" instead of just "Poison" where status conditions are displayed.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
Dugi
Posts: 4961
Joined: July 22nd, 2010, 10:29 am
Location: Carpathian Mountains
Contact:

Re: Poison Code

Post by Dugi »

If you felt that Lehor’s post was in violation of the Posting Guidelines (specifically §1i thereof), then you ought to have reported it, per Posting Guidelines §5, as I have told you before.
Posting Guidelines are not Forum Rules, they are just suggestions about good behaviour. Therefore, I don't think that breaking Posting Guidelines should be reported, but if the official interpretation is different, fine then.
Also, although I usually help with things like this, I have used my right that I do not have to reply, because I did not like the way he asked for it. And after Wussel's comment, I felt an urge to explain why I didn't reply.

Anyway, this guy first posted on 31st of may and last visited on 5th of june, so I don't believe that there is any reason to post anything here.
User avatar
8680
Moderator Emeritus
Posts: 742
Joined: March 20th, 2011, 11:45 pm
Location: The past

Re: Poison Code

Post by 8680 »

Dugi wrote:Therefore, I don't think that breaking Posting Guidelines should be reported, but if the official interpretation is different, […]
It is. And I do not contest your “right to not post”.
Post Reply