[Freeciv-Dev] [patch #4011] Lua: edit.change_terrain and edit.place_resource

2017-05-02 Thread Marko Lindqvist
Update of patch #4011 (project freeciv):

  Status:None => Duplicate  
 Assigned to:None => cazfi  
 Open/Closed:Open => Closed 

___

Follow-up Comment #10:

Handled at hostedredmine: https://www.hostedredmine.com/issues/657140

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #4011] Lua: edit.change_terrain and edit.place_resource

2016-01-20 Thread Marko Lindqvist
Update of patch #4011 (project freeciv):

 Planned Release: => 3.0.0  

___

Follow-up Comment #9:

As resources are becoming form of extras separate edit.place_resource() is not
to be added. edit.changed_terrain() would still be interesting.

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #4011] Lua: edit.change_terrain and edit.place_resource

2014-02-25 Thread J. M. Gorbach
Follow-up Comment #4, patch #4011 (project freeciv):

I checked another time... 

File: server/sanitycheck.c

Function: static void check_map(const char *file, const char *function, int
line)

Specific:
193   SANITY_TILE(ptile, cont  0);
and
195 if (!is_ocean_tile(tile1)) {
196   SANITY_TILE(ptile, tile_continent(tile1) == cont);
197 }

There is a warning when I start a game (file #19670), I open and close Editing
Mode and Turn Done.

Tileset problem, it's probably incompatible with the ruleset: Map topology and
tileset incompatible.

___

Reply to this item at:

  http://gna.org/patch/?4011

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #4011] Lua: edit.change_terrain and edit.place_resource

2014-02-25 Thread J. M. Gorbach
Follow-up Comment #5, patch #4011 (project freeciv):

In my patch from 'tile_change_terrain' to 'tile_set_terrain'.

Fix... but when I turn Grassland into Ocean (resource: Whales).

in begin_turn() [srv_main.c::881]: assertion 'cont  0' failed.
in begin_phase() [srv_main.c::972]: assertion 'cont  0' failed.

___

Reply to this item at:

  http://gna.org/patch/?4011

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #4011] Lua: edit.change_terrain and edit.place_resource

2014-02-25 Thread Marko Lindqvist
Follow-up Comment #6, patch #4011 (project freeciv):

You have not said anything about my comment #2. Are you recalculating the
continents? (note also the case that changing one ocean tile to land tile can
cause two continents to merge, requuiring complete reorganization of their
ids)

___

Reply to this item at:

  http://gna.org/patch/?4011

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #4011] Lua: edit.change_terrain and edit.place_resource

2014-02-25 Thread J. M. Gorbach
Follow-up Comment #7, patch #4011 (project freeciv):

Are you recalculating the continents?
Ehm... no, because I don't know where I have to look. I searched in the code
*num_continents* and *last_num_continents*. Maybe I have to work in
server/generator files (i.e. utilities.c) or in ai/default/ (i.e. aidata.c and
aidata.h) or elsewhere (common, client, etc).

If you have any advice it would be very much appreciated! 

___

Reply to this item at:

  http://gna.org/patch/?4011

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #4011] Lua: edit.change_terrain and edit.place_resource

2014-02-25 Thread Marko Lindqvist
Follow-up Comment #8, patch #4011 (project freeciv):

Well, editor needs to handle similar case of terrain changes, so checking
edithand.c... see check_edited_tile_terrains().

___

Reply to this item at:

  http://gna.org/patch/?4011

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #4011] Lua: edit.change_terrain and edit.place_resource

2014-01-04 Thread J. M. Gorbach
Follow-up Comment #3, patch #4011 (project freeciv):

I checked another time...

I added scripting lua (transform terrain -mountain- and place resource -gold-)
in the scenario. If I turn ocean, deep ocean or lake in mountains, there are
error messages. Same position, exactly on sanity_check().

If I turn plain in mountain, nothing... I don't know if swamp, glacier,
forest, hill or other terrains are ok, but I think so.



(file #19670)
___

Additional Item Attachment:

File name: europe-200x100-v2.sav  Size:60 KB


___

Reply to this item at:

  http://gna.org/patch/?4011

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #4011] Lua: edit.change_terrain and edit.place_resource

2013-10-30 Thread Marko Lindqvist
Follow-up Comment #2, patch #4011 (project freeciv):

cont is probably short for continent. You are not setting continent id
correctly ( 0 indicates the tile is oceanic).

___

Reply to this item at:

  http://gna.org/patch/?4011

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #4011] Lua: edit.change_terrain and edit.place_resource

2013-09-01 Thread Sveinung Kvilhaugsvik
Follow-up Comment #1, patch #4011 (project freeciv):

How you can debug the assertions (in case you didn't know):

The text in begin_turn() [srv_main.c::881] indicate that you should look at
the function begin_turn() in the file srv_main.c, line 881. If you don't have
the sources that gave the asserting failure apply your patch and compile again
to see were the problems now are located.

An assertion is something that the code assume always will be true. I suggest
following the data checked. In this case the variable cont. (Tips: Use a tool
so you won't have to locate everything by hand) Look forwards to see if the
new value breaks something. Look backwards to see if you changed it by
accident or if the new value is expected.

___

Reply to this item at:

  http://gna.org/patch/?4011

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #4011] Lua: edit.change_terrain and edit.place_resource

2013-07-17 Thread J. M. Gorbach
URL:
  http://gna.org/patch/?4011

 Summary: Lua: edit.change_terrain and edit.place_resource
 Project: Freeciv
Submitted by: gorb
Submitted on: Wed 17 Jul 2013 10:46:27 AM GMT
Category: general
Priority: 5 - Normal
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any
 Planned Release: 

___

Details:

Add two new lua functions in module edit:
edit.change_terrain, change terrain
edit.place_resource

I've tested with:

function map_labels()
  local terrain = find.tile(170,230)
  edit.change_terrain(terrain, 'Mountains')
  local terrain = find.tile(170,230)
  edit.place_resource(terrain, 'Gold')
end

function turn_cb(turn, year)
  if turn == 0 then
  map_labels()
  end
end

Works, the result is a transformation from deep ocean to mountain, with a
resource (gold), but there are messages. 
Only change function:

in begin_turn() [srv_main.c::881]: assertion 'cont  0' failed.
( 170,  230) at Mountains
in begin_phase() [srv_main.c::948]: assertion 'cont  0' failed.
( 170,  230) at Mountains

Both functions (change and place):

in begin_phase() [srv_main.c::948]: assertion 'cont  0' failed.
( 170,  230) at Mountains




___

File Attachments:


---
Date: Wed 17 Jul 2013 10:46:27 AM GMT  Name:
change_terrain_and_place_resource.diff  Size: 3kB   By: gorb

http://gna.org/patch/download.php?file_id=18310

___

Reply to this item at:

  http://gna.org/patch/?4011

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev