Simple Lua scripting question

Jaythekiller

Warlord
Joined
Sep 15, 2006
Messages
185
Location
Ajaccio,Corsica,france (Europe)
Hi everyone I have some questions about Lua

I'm new to Lua and I want to make a simple Lua script to reduces Barbarian number,
because in my mod there only are four civs and four city states on a huge map and they are growing up very fast at the moment

First,is it possible to do it by Lua scripting?

Then,which function should i use

Most important,what is the syntax for it,

And also, can i write a simple line of code or should i include it in a specific file

That would help me understand some things before i get further

Thank you :)
 
Hi everyone I have some questions about Lua

I'm new to Lua and I want to make a simple Lua script to reduces Barbarian number,
because in my mod there only are four civs and four city states on a huge map and they are growing up very fast at the moment

First,is it possible to do it by Lua scripting?

Then,which function should i use

Most important,what is the syntax for it,

And also, can i write a simple line of code or should i include it in a specific file

That would help me understand some things before i get further

Thank you :)

The element you may be looking for .......

PHP:
<GameData>
	<Table name="Defines">
		<Column name="Name" type="text" primarykey="true" />
		<Column name="Value" type="variant" />
	</Table>

:
:
:
<Row Name="BARBARIAN_CAMP_ODDS_OF_NEW_CAMP_SPAWNING">
			<Value>2</Value>
:
:

This is found in GlobalDefines.xml

I am not sure how you access it from LUA but would be interested to know as well.

I cannot find any refs to it in the firetuner table browser. Nor can I find any Lua code that references it.
 
Thanks for the tip
Would have prefer do it with Lua as to learn how to use it (was my initial goal indeed :D)
Not so bad,i will do that with XML and i'll find an other idea for a first try with Lua :)
 
Yes it would be better with LUA which just changes that on load. Providing an updated XML will work, but I don't think it will have the mod compatibility you may desire .... if someone else is providing a modified globaldefines in their mod.
 
I'm not sure, but i think i can only update this value in a separate file,no need to copy the entire GlobalDefines.xml and modify the value in it
The only compatibility issue i see is if someone modify this value in his mode
 
Back
Top Bottom