Login  Register
 



Post new topicReply to topic
 
Author Message
 PostPosted: 21 Jul, 2007 
 
User avatar

Joined: 26 Apr, 2007
Posts: 174
Location: Winnipeg, Manitoba, Canada
Offline
Hello there. I currently want to try out a TD-style map, though I need somewhere to learn how to write scripts or triggers for maps. If possible, I would like a site or thread that has information for beginners to scripting for maps so that I have some bearing as to what goes where and what affects what. Thanks kindly ^_^

_________________
Chirmaya's Hiragana Turret Defense v1.2
Defense and Attack v1.0 Work in Progress
Supreme Commander Online Mod Assistant v1.0 Work in Progress


Top
 Profile  
 PostPosted: 21 Jul, 2007 
 
User avatar

Joined: 16 Feb, 2007
Posts: 555
Location: Holland
Offline
Well, i suggest to open up the SupCom campaign maps and learn from them, best way to it in my opinion just trial and error the best method of learning.

_________________
TA Veteran | SupCom Mapper
Box-o-Scripts™ Custom map scripts!
[Competition]Best User Made Map!
Death, Panic, Disaster, Your work here is done my boy.. Oh yess...


Top
 Profile  
 PostPosted: 21 Jul, 2007 
 
User avatar

Joined: 08 Apr, 2007
Posts: 526
Location: Colorado, US
Offline
You should first look into LUA syntax and how it flows. Knowing how to "debug" your lua script can be useful too.

I know there is a TD style map posted onto the Vault already. Visually, it was unappealing, but it got the job done. Have a look through their _script.lua to see what they did.

I agree with Dark as well. The campaign maps have loads of script in them to learn from.

You can also "unzip" the "Supreme Commander\gamedata\lua.scd" file and use lua functions that the devs created. To use a function of one of inside on of these files, you can make a reference to the file as an external resource.

Code:
#At the top of the _script file, or at the start of a funtion
#I'm importing the file from 'Supreme Commander\gamedata\lua\sim\ScenarioUtilies.lua'
#by using the reference below
local ScenarioUtils = import('/lua/sim/ScenarioUtilities.lua')

#calling a function from the ScenarioUtils.lua file from within a function in our _script.lua
ScenarioUtils.InitializeArmies()

_________________
Image
Mapping: 1, 2


Top
 Profile  
 PostPosted: 21 Jul, 2007 
 
User avatar

Joined: 14 May, 2007
Posts: 169
Location: Australia
Offline
Yeah, there is no real tutorial of any sorts for map scripting.

A lot of what goes into a map script is pretty much the same as writing a sim-side mod, so you might find some useful information over in the modding info thread

Firstly, you need to familiarize yourself with lua syntax (and if you're coming from another programming language, you need to keep in mind some differences, such as LUA arrays starting from index 1, not 0!)

Then either download some other scripted maps from the vault (probably the existing TD map), or use the campaign maps as a guide.

As LeVirus said, it's a good idea to get WinRAR or something, and extract the lua.scd file somewhere. This way, when you see a line of code such as "ScenarioUtils.InitializeArmies()" and want to know exactly what it does, you can open up "...\lua\sim\ScenarioUtilies.lua" and search for "InitializeArmies".

_________________
ImageImage


Top
 Profile  
 PostPosted: 21 Jul, 2007 
 
User avatar

Joined: 26 Apr, 2007
Posts: 174
Location: Winnipeg, Manitoba, Canada
Offline
Thank you all very much. That gives me all that I need to know to get started with great direction ^_^

_________________
Chirmaya's Hiragana Turret Defense v1.2
Defense and Attack v1.0 Work in Progress
Supreme Commander Online Mod Assistant v1.0 Work in Progress


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic



Quick Tools

Search for:
Jump to:  

© 2002-2010 Gas Powered Games Corp. All Rights Reserved. Gas Powered Games is the exclusive trademark of Gas Powered Games Corp.
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
 
Home| Games | Company | News & Press | Support
  Terms of Use   |    Copyright Information   |    Privacy Policy