Arkane wrote:Hello. I'm Arkane. I'm a musician and a voice actor. Being in alot of projects that require me to take the role of a medieval hero, or projects that require me to compose epic music for fantasy battles, I've been influenced in constructing my own RTS game. The thing is, I have 0 knowledge on coding and such. All I'm only good at audio in general as it is my job.
I was wondering, does Stratagus require coding for everything? Or are most of the things needed to run a WC2 esque game already laid down and the coding is just for something extra? (Imagine RPG Maker XP. Everything's there but the coding adds to the game) I am hoping for the former as, again, I have no idea how to code. Does Stratagus support in game dialogue aswell? Kind of like in SC:BW? Your units go through a trigger and it starts an event that makes one of your units talk and the like? If not, then I might go back to searching for a 2D RTS Engine.
Stratagus does require coding for many things, but to do things such as adding new units it is pretty much like filling a database. It is possible to have in-game dialogue in a Stratagus game, but it would need to be added through Lua. For instance, in Wyrmsun I added code that allows in-game dialogues for characters, by making use of Stratagus' triggers. Here is an example of how in-game dialogues are structured in Wyrmsun:
Code: Select all
Event(
"Pypo I",
"We come to make a bargain with you.",
0,
{"~!Listen to him", "~!Up axes!"},
{function(s)
end,
function(s)
end},
"gnome/icons/gnomish_recruit.png"
)
Each comma-separated element defines how the dialogue will be. The first element is the name of the character that will speak. The second element is what he will say. The third element is the player number of the player for whom you want the message to appear. The fourth element is an array with the options available - and the fifth element is an array with the effects for each of the options (in this example I didn't make the option effects do anything, to make things simpler). In the effects part you can do things such as making further dialogue events fire, adding units, and so forth. The sixth and last element is the path to the unit icon you wish to show up when the dialogue is shown (this last element is optional).
And here you can see how the end result looks like in-game:
The function that handles this is the following:
Code: Select all
function Event(event_name, event_description, player, options, option_effects, event_icon, event_image)
if (GetThisPlayer() == player) then
SetGamePaused(true)
local menu = WarGameMenu(panel(5))
menu:resize(352, 352)
menu:addLabel(event_name, 176, 11)
local l = MultiLineLabel()
l:setFont(Fonts["game"])
l:setSize(324, 208)
l:setLineWidth(324)
if (event_icon == nil) then
menu:add(l, 14, 40)
else
menu:add(l, 14, 112)
end
l:setCaption(event_description)
if (event_icon == "dwarf/icons/rugnur.png" and GetArrayIncludes(wyr.preferences.Heroes.Rugnur.upgrades, "unit-dwarven-thane")) then
event_icon = "dwarf/icons/rugnur_older.png"
end
if (event_icon ~= nil) then
event_icon = CGraphic:New(event_icon)
event_icon:Load()
local b = ImageWidget(event_icon)
menu:add(b, 153, 48)
end
if (event_image ~= nil) then
event_image = CGraphic:New(event_image)
event_image:Load()
local b = ImageWidget(event_image)
menu:add(b, 0, 0)
end
for i=1,table.getn(options) do
local option_hotkey = ""
if (string.find(options[i], "~!") ~= nil) then
option_hotkey = string.sub(string.match(options[i], "~!%a"), 3)
option_hotkey = string.lower(option_hotkey)
end
menu:addFullButton(options[i], option_hotkey, 176 - (224 / 2), 352 - 40 * (table.getn(options) - (i - 1)),
function(s)
SetGamePaused(false)
menu:stop()
option_effects[i]()
end
)
end
menu:run(false)
else -- AIs always choose the first option
-- option_effects[SyncRand(table.getn(option_effects)) + 1]()
option_effects[1]()
end
end
This Lua function is already n Wyrmsun, but if you wish to add it to another Stratagus game, you just need to paste it in one of the script files that are loaded when the game is ran, such as stratagus.lua.