Civilization 5 Modding Dead.

for the most part yes you can do those things via lua scripts.
as it stood when things first came out, it was very possible to teach AI with lua.

Well if you are right on this, then they have made a genius work with the scripting layer. I seriously doubt this, since the script functionality is constrained by the native dll functions on which they are built, and so I dont believe, that such versatality is possible unless the whole game is a script, but it is not. Its really, really hard to believe what you are saying, and yes ofcourse, you neet to teach the AI to use new features which you introduced yourself. Whats the point in enabling stacking or creating religion if the AI doesnt know how to handle it, or handles it ineffectively. You say you can do all this with LUA??? I dont think so...
 
as it stood when things first came out, it was very possible to teach AI with lua. it was just a matter of how much work someone would want to put into scripting such a thing. i don't see how it will be all that much easier with source, i mean when it comes to teaching AI you'd imagine a lot of conditions to monitor and base decisions off of, logically it wouldnt be all that much different than with lua to add new things

of course editing, changing, copying bits to make something new, all from the source could help speed things up
The big difference for the AI, I think, is that you'll be able to integrate reasoning for a new mechanic directly into existing decision-making. If you add a new empire-wide factor it needs to affect existing decisions, so you'll be able to add it to the algorithms for those, and so on.
 
Well if you are right on this, then they have made a genius work with the scripting layer. I seriously doubt this, since the script functionality is constrained by the native dll functions on which they are built, and so I dont believe, that such versatality is possible unless the whole game is a script, but it is not. Its really, really hard to believe what you are saying, and yes ofcourse, you neet to teach the AI to use new features which you introduced yourself. Whats the point in enabling stacking or creating religion if the AI doesnt know how to handle it, or handles it ineffectively. You say you can do all this with LUA??? I dont think so...
You can make decisions about new features, that aren't alternatives to existing ones (so not suitable for, say, unit actions) in Lua; you can't make new features impact decisions about existing features.
 
Well if you are right on this, then they have made a genius work with the scripting layer. I seriously doubt this, since the script functionality is constrained by the native dll functions on which they are built, and so I dont believe, that such versatality is possible unless the whole game is a script, but it is not. Its really, really hard to believe what you are saying, and yes ofcourse, you neet to teach the AI to use new features which you introduced yourself. Whats the point in enabling stacking or creating religion if the AI doesnt know how to handle it, or handles it ineffectively. You say you can do all this with LUA??? I dont think so...
it is very versatile. if you turn on the console you can browse the 'tables' that shows everything available through the api. it's really extensive. those examples you listed, religion, great generals, very much implementable. great generals being the easier of the two ;)

couldnt say about corps since im not sure what they're supposed to do in game.

this is not to say that with lua you can make it civ5->civ4. i've read ideas over the past months where doing something would be impossible with the API, though these were often due to not being able to do something against the game mechanics, and i guess this is where the dll comes in

ETA:
You can make decisions about new features, that aren't alternatives to existing ones (so not suitable for, say, unit actions) in Lua; you can't make new features impact decisions about existing features.

the code in here in particular the *track* functions, shows how you can actually take over control of AI unit actions. also some basic functions taking over AI city builds as well. lua lets us do all that

though this ties back to what i wrote above about making your custom goal AI. just improving the AI movement and war, there's so much to consider: tiles, friendly units, unit strength, overall strategic goal, etc. and of course then that ties itself into production and scientific goals.. its mind boggling. i suppose thats where flavors come in to make the civ programmers job easier
 
Look, what I think, and correct me if I am mistaken, that the C++ source is the game itself excluding the graphical engine (gameboy or whatever ) - so for example you cant change hexes into squares therein. But it directly interfaces with the engine, and for example it contains full AI code, so you can completly rewrite the AI. It also creates an interface for LUA, so LUA is nothing else but the exposed interface functions and callbacks, so you, as a scripter, are severly restricted to what and how is exposed to you.
absolutely right, the DLL being also limited on the sound and multiplayer part I guess.

So how is this not a HUGE difference?
because you completely underestimate what we can do with the available callbacks

And I dont believe you can make Civ5 Civ4 like with LUA. Or are you telling me, you can add corporations, religion, unit stackig, great generals etc via LUA? No, you cant, but I bet you can do it with the dll source. But correct me, if I am wrong.
We can do corporations, religions, great generals, vassals, colonies, revolutions, culture flipping, etc... all with Lua.

I don't even think it will be easier to do in C++

But it will run faster, and I suppose, that for big mods conversion from 4 to 5 it's really easier (and faster) to wait for the source and convert the C++ core code of the mod to the new game engine than to translate it in Lua (and then back to C++ when available for performance)

See my sig for Tile flipping as an example.
 
I seriously doubt this, since the script functionality is constrained by the native dll functions on which they are built, and so I dont believe, that such versatality is possible unless the whole game is a script, but it is not. Its really, really hard to believe what you are saying

So you call him a liar, even though WE'VE DONE THESE THINGS, and you haven't even tried. Very nice.

Lua is extraordinarily flexible, and people have already come up with some spectacular uses, including religions and such. And seriously, unit stacking is in the XML; you change one value, and POOF, stacked units.

Here's a few modest changes I've added, through Lua, in my own mod:
> Nuke interception, with the percentages dynamically changing based on how many civs you're at war with and how many have anti-nuke systems (i.e., your enemies pool their interception abilities against you, with a diminishing returns aspect and some caps)
> EDIT: Forgot to mention Terraforming. Plant jungles, plant forests, create or remove hills, create new resource deposits, change snow into tundra into plains or desert into grassland, that sort of thing.
> Non-nuke bombardment weapons that damage all enemy units adjacent to the target unit as well.
> "Critical hit" abilities for units to deal extra damage or to spontaneously heal themselves at the start of a combat.
> Barbarians healing, and being given random promotions as the game goes on to make them more dangerous.
> A unit that steals promotions from the units it fights
> Wonders that give you a chance of stealing techs from other civs, in three different ways
> Units that can move across both land and sea
> A "Rookie" promotion that goes away after a unit's first fight, giving him -25% to combat but double XP in that first fight.
> A psionic class of units that adjust their strength based on the strength of the unit they're fighting; when fighting a stronger unit they'll get up to 25% stronger, when fighting a weaker unit they'll get up to 25% weaker.
> An "Empath" specialist that gives +1 Happiness to its city, and whose Great Person can be used to create a custom Monolith improvement that gives +3 Happiness in addition to its normal yields.
> A Wonder that gives every OTHER civ a permanent -10 to their Happiness.
> Buildings that give temporary promotions to friendly units that start their turn in that city
> Buildings that give temporary promotions to enemy units that are in your territory
> A national wonder that gives you warnings when another civ gets close to completing a Wonder of their own.
> A building type that adds a random chance of triggering a 1-turn Golden Age, with the chance depending on how many of those buildings you have and how big your empire is as a whole.
> A project that makes every Great Improvement (Academy, Manufactory, etc.) generate Great Person points of the appropriate type.
> When you build a spaceship, instead of ending the game it gives you a few extra bonuses (free policy, free tech, golden age), and any other civ that finishes their own spaceship within a randomized window will get a lesser bonus. At the end of that window, barbarians swarm all over the world, spaceships no longer can be built, and a few other mod-specific events trigger; after that point, special barbarian bases will begin to randomly spawn inside players' territory and create units until destroyed, with the types of units spawning becoming more dangerous as time goes on.
> A new victory condition that starts a 20-turn timer, causes everyone to declare war on you, and shrinks your cities by 1 each turn until the timer ends, at which point you win if you're still alive and no one else has won some other way.

There's more, but this should give an idea of what can be done, and all of the above use a grand total of FIVE Lua events. (Start of turn, end of turn, start of combat, end of combat, on unit created.) Okay, I also use a sixth event, start of game, but not for any of the above. Most of the above aren't even that complicated, so with a little effort you can add all sorts of things. The only real limitation, as mentioned before, is that the AI can't easily be taught to use these new functions so most of them have to be done in "passive" ways where the AI has no decisions to make. The DLL will allow us to fix that, but even within the limits we have now there's a tremendous amount that can be done.

And there are HUNDREDS of other events out there...
 
> It won't trigger if you're in Strategic View
> If one of the two participants is a city (either unit attacking city or city attacking unit) you'll have the player ID of the city's owner but no way to tell which city it is
> If the attacking unit is a nuke (which targets a hex instead of a city or unit), there'll be no positional information passed to the function to let you figure out which hex is being attacked or which players are being affected.

OT, but have you tried to use "plot = unit:LastMissionPlot()" on the attacking unit ?
 
OT, but have you tried to use "plot = unit:LastMissionPlot()" on the attacking unit ?

Don't think so; I didn't think the mission plot structures were used on attacks. I'll try it when I get home; that WOULD make things quite a bit easier, since I'd finally be able to add a few custom anti-city abilities I'd been developing (a missile that destroys city defensive structures, for instance).
 
ok, just tested with land and air units, seems to return the attacked plot, don't know for nukes.
 
because you completely underestimate what we can do with the available callbacks
No, problem is, most posters here seem not to understand that LUA is a subset of functions of the game which is in C++ which's dll source were talking about or maybe they do not understand the difference between native code and scipts. They seem to think these can substitute each other. The problem is not that how much stuff you can acheive with LUA directly or via workarounds, but that you must rely on firaxis developers to add new functions, new parameters etc, instead of just adding it yourself and then use it yorself in LUA if you like LUA so much. This is what I mean by HUGE difference.
 
No, problem is, most posters here seem not to understand that LUA is a subset of functions of the game which is in C++ which's dll source were talking about or maybe they do not understand the difference between native code and scipts. They seem to think these can substitute each other. The problem is not that how much stuff you can acheive with LUA directly or via workarounds, but that you must rely on firaxis developers to add new functions, new parameters etc, instead of just adding it yourself and then use it yorself in LUA if you like LUA so much. This is what I mean by HUGE difference.
I don't think anyone would argue against the idea that there's a big difference in the theoretical limitations. However, you seem to be implying throughout that there are huge practical limitations at the moment, and the limitations are actually quite, well, limited.
 
I don't think anyone would argue against the idea that there's a big difference in the theoretical limitations. However, you seem to be implying throughout that there are huge practical limitations at the moment, and the limitations are actually quite, well, limited.

Exactly what I was about to say.

And as a modder, I don't see a huge difference between a function used to calculate culture spreading in Lua and the same function in C++

I don't see the huge difference between implementing a vassalage system à la civ4 in Lua and C++

etc, etc...

IMO the broken graphical tools are making a bigger difference than the absence of dll access for huge conversion, that and the lack of documentation on the available lua callbacks (That is something we need the source for)
 
I don't think anyone would argue against the idea that there's a big difference in the theoretical limitations. However, you seem to be implying throughout that there are huge practical limitations at the moment, and the limitations are actually quite, well, limited.

Well yes, if the theoratical limitation holds in practice. And as I see it does. Again: The number of things you can do in LUA is limited to a finite set of functions. The number of things you can "both practically and thoratically" do in the source code is UNLIMITED (excluding graphical engine, audio etc., but that is not available for LUA either.). Its not about C++ or LUA, if the core game would have been written in LUA and the modding layer in C++ (which ofcourse is nonsense), than I would ask: when will LUA source will be released.
 
Questions about using all of these new LUA functions:

1) How does it affect loading times for the mod (when you enable it)?
2) How does it affect performance in-game (turn-times)?
3) How difficult is it to debug these LUA functions?
4) When you scripted these LUA functions, I assume you created a brand new LUA file as opposed to modifying originals?

@Spatz
 
1) How does it affect loading times for the mod (when you enable it)?

No significant difference that I've been able to note, although since I rarely play an unmodded game any more it's hard to do a direct comparison. Someone who only occasionally uses my mod would be a better source for this answer.

2) How does it affect performance in-game (turn-times)?

Same as above. I've specifically avoided large-overhead loops (like looping over the entire map), so none of my functions require significant execution time, and the best I can say is that when I play I don't notice significant slowdown.

3) How difficult is it to debug these LUA functions?

Trivial. You type things like:
Code:
print("Name: ",bName,mPlayer:GetName(),row.StealTechPercentCivs,row.StealTechChance);
and the print statement will execute in your FireTuner with all of the variables. While it's not as convenient as a true graphical debugger with breakpoints and such, it suffices for what you can do with Lua.

4) When you scripted these LUA functions, I assume you created a brand new LUA file as opposed to modifying originals?

Correct. If you download my mods, and go into the Lua directory for each, you'll see files that I created. In my Balance mod there's just a small HeadStart.lua; the Content mod adds Terraform.lua, SpatzEndTurn.lua, SpatzMove.lua (not currently used), SpatzStartTurn.lua, SpatzUnit.lua, and the big one is SpatzWonders.lua, which covers all of my building/project bonuses and nearly everything involved with my space race event overrides. My Content mod also includes copies of WhysUtils.lua (Whys' utility functions for the save/load functionality) and Whys' CustomNotificationPanel.lua and BuildingResources.lua files.
 
Thanks, mate. I'm looking into LUA soon and I want to get a handle on how it affects the gameplay.
 
Here's a few modest changes I've added, through Lua, in my own mod:
<impressive list>

There is a mod I want to create, but it's held up on needing key Lua functions. I have the map ready along with the Lua to throw out the first 5 months of reinforcements.

Is it possible now, to do the following?

1) limit a hex to 1 combat per player turn
2) limited replacements/healing, and handled by the AI
3) scripted reinforcements considered by the AI
4) zone based weather effects, and considered by the AI
5) maxHP set for each unit
6) an air unit can perform either offensive or defensive support on each turn
7) no city production (all cities are puppets). Replacement points can either be used to replace loses in live units, or to reconstitute eliminated units.
 
may be wrong, but :
1/ no, need the dll or a CanAttack game event
2/ yes, but define "handled by the AI"
3/ yes, and again define what you want of the AI
4/ depend of what you plan
5/ difficult
6/ see 4
7/ yes
 
> "handled by the AI"

As applied to limited replacements, the AI (and player somehow) would now have a limited set of replacements so would have the additional task of prioritizing how they are allocated.

As applied to scripted reinforcements, when considering where to defend it will be essential to know where reinforcements are coming. If there are currently 4 units available, but 8 are needed in that area, then if another 4 are not coming then it would be best to retreat.


> maxHP

I need this to be easy. A new XML field, and modifications to the section of the code that implement healing so that it stops at the appropriate value.
 
Back
Top Bottom