[Introduction task] More feedback when no action can be done

Do you want to help out with Freeciv development? Then check out this forum.
sveinung
Elite
Posts: 436
Joined: Wed Feb 20, 2013 4:50 pm

[Introduction task] More feedback when no action can be done

Postby sveinung » Fri Aug 15, 2014 6:47 pm

I think working on this would be a good way to gain experience in changing Freeciv if you have some of the required skills. I hereby offer to give feed back on your patch, and when (/if) it becomes good enough, add it to Freeciv.

Skills you must learn/have to do this:
  • Playing Freeciv
  • Change a rule set (for testing)
  • Compile the Freeciv source code
  • Get the Freeciv 2.6 source code from SVN
  • C coding
  • Create a patch

Background
In Freeciv 2.6 it will be possible to create a rule set where a unit can do a spy action while transported over non native terrain. (Example: Land spy in a transport over Ocean Establishing an Embassy). It is also possible to change the rules so actions are illegal while transported no matter if they are over native terrain or not or even to require non native terrain. When no action is possible a message is given. If no units of the failing unit's type can do an action from inside a transport on non native terrain and it is inside a transport over non native terrain the player will be informed that this is the reason why it failed. Otherwise a generic message is given. This code is located in the function explain_why_no_action_enabled()* in the file server/unithand.c.

The task
Your patch will give a message for the requirement that the unit isn't transported. Bonus: give a message for the situations were it is required that the unit is transported or is on non native terrain.

When this is done post your patch to our patch tracker.

Hints
To test your changes you will have to modify a rule set so a unit requires the property you wrote a message for in all situations. Action enablers live in the ruleset file game.ruleset. Move the unit using the keypad on your keyboard so the path finding won't stop you from trying the illegal action.

How to create a patch, get Freeciv 2.6 from SVN and compile Freeciv is documented online. You can find good introductions to C for the programming skill set you already have by using Google. Try to remember reading your patch before sending it to make sure that test data like ruleset modifications wasn't accidentally included.

* update: used to be a part of unit_move_handling()

sveinung
Elite
Posts: 436
Joined: Wed Feb 20, 2013 4:50 pm

Re: [Introduction task] More feedback when no action can be

Postby sveinung » Tue Jan 13, 2015 1:13 pm

sveinung wrote:Your patch will give a message for the requirement that the unit isn't transported.

I had to do this my self to clear the way for making bombardment action enabler controlled. See patch #5709.

sveinung wrote:Bonus: give a message for the situations were it is required that the unit is transported or is on non native terrain.

Will do this my self unless someone has shown an interest in doing it by February.

sveinung
Elite
Posts: 436
Joined: Wed Feb 20, 2013 4:50 pm

Re: [Introduction task] More feedback when no action can be

Postby sveinung » Sun Mar 22, 2015 1:32 pm

sveinung wrote:
sveinung wrote:Bonus: give a message for the situations were it is required that the unit is transported or is on non native terrain.

Will do this my self unless someone has shown an interest in doing it by February.

Done.