[Freeciv-Dev] [patch #3320] Add ai type argument to Lua edit.create_player()
Update of patch #3320 (project freeciv): Status: Ready For Test = Done Open/Closed:Open = Closed ___ Follow-up Comment #8: Replying to an old comment: Making script able to request certain ai module to be used creates another situation similar to tileset/ruleset interdependencies that are considered buggy to some extend at least. Gotta remember that Lua scripts don't always have to be fully general and ruleset-agnostic (although any scripts *we* write probably should be). Scripts can be attached to a ruleset or scenario, in which case hardcoded things like find.terrain(Forest) are entirely appropriate. Admittedly I'm less sure exactly when you'd use this ai_type argument -- IIRC what made me think of it (other than generality) was the idea that when testing new AIs, you might write a script to give reproducible results or specific scenarios with finer control than server commands or the editor give you. Anyway, committed now. I'll add a warning when I get round to updating the wiki http://freeciv.wikia.com/wiki/Events_Reference_Manual for 2.4. ___ Reply to this item at: http://gna.org/patch/?3320 ___ 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 #3320] Add ai type argument to Lua edit.create_player()
Update of patch #3320 (project freeciv): Category:None = general ___ Follow-up Comment #5: From the bad options we have here, committing your patch is least bad. Lets not be overprotective. If someone uses that argument when it's not absolutely necessary, it's his/her script that breaks. We should document it with appropriate warnings, of course. ___ Reply to this item at: http://gna.org/patch/?3320 ___ 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 #3320] Add ai type argument to Lua edit.create_player()
Update of patch #3320 (project freeciv): Planned Release: 2.4.0,2.5.0 = 2.4.0-beta1, 2.5.0 ___ Follow-up Comment #4: if we don't do it now, we won't ever be able to That means that this is blocker even for 2.4.0-beta1, doesn't it? ___ Reply to this item at: http://gna.org/patch/?3320 ___ 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 #3320] Add ai type argument to Lua edit.create_player()
Update of patch #3320 (project freeciv): Status:None = Ready For Test Assigned to:None = jtn Planned Release: 2.5.0 = 2.4.0,2.5.0 Summary: Add ai type argument to Lua create_player() = Add ai type argument to Lua edit.create_player() ___ Follow-up Comment #2: I looked at this because I thought it would be trivial. Of course it turned out not to be entirely so, but I learned something relevant to 2.4.0. * It turns out that our scripting arrangements don't support optional arguments as I thought they did. So it's not possible to add arguments in a backward-compatible way. * But! Some time in 2.4 development, a number of global functions were put in the edit module, so create_player() becomes edit.create_player(). For pre-existing functions a global wrapper create_player() was left behind (for functions new in 2.4, only the new name is available, edit.climate_change()). All this had completely passed me by. * So, 2.4 is the natural point to add an extra argument -- the old name create_player() won't take it, the new name edit.create_player() will. Technically this is too late given file format freeze, but if we don't do it now, we won't ever be able to, for script backward compatibility reasons. Lots of words, small patch, which is attached. Will commit to S2_4 unless someone objects. (file #15939) ___ Additional Item Attachment: File name: trunk-S2_4-lua-create-player-ai-type.diff Size:3 KB ___ Reply to this item at: http://gna.org/patch/?3320 ___ 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 #3320] Add ai type argument to Lua edit.create_player()
Follow-up Comment #3, patch #3320 (project freeciv): Have to think about the philosophy of loadable ai modules and scripting. Should script ever be allowed to assume something about ai modules currently loaded, or should they be totally agnostic to each other? Making script able to request certain ai module to be used creates another situation similar to tileset/ruleset interdependencies that are considered buggy to some extend at least. No, I don't know the answers, but I hope some discussion so we do know them before committing/rejecting this patch. ___ Reply to this item at: http://gna.org/patch/?3320 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev