View Full Version : Unit upgrades?

04-25-2009, 06:42 AM
If u have an archer can u upgrade him into a crossbowman or longbowman and the same with other units like swordsman to two-handers or spearman to pikes

04-25-2009, 02:30 PM
Dude you seriously need to search for these answers. This has been talked about already.

Go to "Search" and type in the subject you want to know about. If its been talked about (Which most things have) It will come up.

Andy Joslin
04-25-2009, 03:18 PM
No. Easily doable with a bit of scripting in your own scenario or unit, though. :)


var Button = Self:AddActioner("ToCrossbow")
Button.Details = "Upgrade to Crossbowman"
Button.ExtendedDetails = "200 Experience required."
Button.Icon = "Icons/crossbowman"
Button.Func=function (Self,MButton)
if Self.Experience>=200 then
var Crossbow=Self:NewObjectRelative({0,0,0},0,0,0,0,"Men-Units-Crossbowman")
elseif Self.Experience<200 then
NotifyPlayer(200-Self.Experience.." experience required to upgrade to crossbow")

It's that easy! I just typed that up in a few minutes. The "Button.Func" runs when the button is pressed. You could have anything in the button's function.

This is but an example of how easy it will be for users to drastically change the game with a small bit of editing.

04-25-2009, 06:36 PM
sorry sir im sure its easy for you because its what you do, but i see that and i look like this dood :eek: then after that i look like :confused:

04-25-2009, 07:07 PM
Thats exactly what I was thinking. But as long as the tutorial explains all I need I'll be good.

04-26-2009, 06:15 AM
I understand it, it's just a case of being able to come up with those kind of codes which will be difficult. Maybe experience with some .ini has helped :p

04-26-2009, 08:29 AM
i understand most of it, but dont expect me to find that on my own :D

Joseph Visscher
04-28-2009, 03:15 PM
LUA (http://en.wikipedia.org/wiki/Lua_(programming_language)) is quite easy and limitless when you get used to it, and we will have lots of reference for you and yea we do have a index for everything and such, might be confusing for the young people but its quite a basic language. They even refer some other easy languages with a quota of "Its as easy as LUA (http://en.wikipedia.org/wiki/Lua_(programming_language))!" :D

if Self.Experience>=200 then -- if your unit has over 200 xp then this section runs
var Crossbow=Self:NewObjectRelative({0,0,0},0,0,0,0,"-Men-Units-Crossbowman") -- spawns a crossbowman on the same location and rotation of the parent unit that has the button
ReplaceSelectedUnit(Self,Crossbow) -- selects the old parent unit AND the new crossbowman.
Self:Remove() -- removes the parent unit that had the button. ( and unselects it)

elseif Self.Experience<200 then -- if your unit does not have over 200 xp then this section runs
NotifyPlayer(200-Self.Experience.." experience required to upgrade to crossbow") -- displays message saying you do not have enough and how much you need.
end -- ends the function.

04-28-2009, 05:44 PM
Wow, nice script. So easy a caveman can do it.

04-29-2009, 11:25 AM
...:eek: ...:confused: ...:( guess im screwed and should go back to my cave:mad:

04-29-2009, 12:24 PM
KK nice knowing you

04-29-2009, 02:15 PM
As my knowledge of programming languages goes back as far as the ZX81 and even then was stretched at anything beyond a basic database i'm totally unfamiliar with scripts and there uses.
My basic understanding is they're used for modifying games such as user maps etc, As this game interests me more than most I've downloaded Lua for windows in order to have a look though i imagine it will be beyond me, But I would very much appreciate it if anyone could give me an overview of how a scripting language is used in general and if possible in DOF

05-06-2009, 10:48 AM
THis could be incorperated in to a mod

05-06-2009, 02:01 PM
Yeah but modes cant be used in mmorps mode...maybe not even in regular multiplayer

05-06-2009, 04:54 PM
maybe for skirmish multilayer , they will do it like medieval and so many others game had done , if U mod ur game u can play with ppl with the same mod ^^