Help with mission editor and lua

Help with mission editor and lua

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
daryl
Posts: 195
Joined: 08 Oct 2006, 10:33

Help with mission editor and lua

Post by daryl »

Hi all,
I'm creating a mission with Mission Editor and I need to create GAIA units.

How I can create this kind of unit in Mission Editor ??
Last edited by daryl on 02 May 2013, 13:29, edited 1 time in total.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Help with mission editor and lua

Post by Forboding Angel »

What is M.E.?
User avatar
daryl
Posts: 195
Joined: 08 Oct 2006, 10:33

Re: Help with mission editor and lua

Post by daryl »

Forboding Angel wrote:What is M.E.?
Mission editor... sorry
User avatar
Silentwings
Posts: 3720
Joined: 25 Oct 2008, 00:23

Re: Help with mission editor and lua

Post by Silentwings »

I guess forb means, which Mission Editor are you using?
User avatar
daryl
Posts: 195
Joined: 08 Oct 2006, 10:33

Re: Help with mission editor and lua

Post by daryl »

Silentwings wrote:I guess forb means, which Mission Editor are you using?
i'm using Zero-K mission editor http://code.google.com/p/zero-k/wiki/Mi ... rStartPage
There are other mission editor?
User avatar
Silentwings
Posts: 3720
Joined: 25 Oct 2008, 00:23

Re: Help with mission editor and lua

Post by Silentwings »

Yes, there are other mission creators/editors/etc.

When I used the ZK mission editor a while back, I think it wasn't possible to create GAIA units, but probably one of the ZK guys can tell you for sure.

If I'm right, the best solution is to make a gadget that spawns the GAIA units you want and then just add that into the .sdz created by the ZK mission editor.
User avatar
KingRaptor
Zero-K Developer
Posts: 838
Joined: 14 Mar 2007, 03:44

Re: Help with mission editor and lua

Post by KingRaptor »

Use the Custom Action (alternate) action (a.k.a. the "Lua it" action).

Code: Select all

local gaia = Spring.GetGaiaTeamID()
local unitID = Spring.CreateUnit(...) -- pass gaia as the team arg here
GG.mission.AddUnitGroup(unitID, "My Group")
edit: fix case in code
User avatar
daryl
Posts: 195
Joined: 08 Oct 2006, 10:33

Re: Help with mission editor and lua

Post by daryl »

KingRaptor wrote:Use the Custom Action (alternate) action (a.k.a. the "Lua it" action).

Code: Select all

local gaia = Spring.GetGaiaTeamID()
local unitID = Spring.CreateUnit(...) -- pass gaia as the team arg here
GG.mission.AddUnitGroup(unitID, "My Group")
edit: fix case in code

please can you check my error?
i wrote:

Code: Select all

local gaia = Spring.GetGaiaTeamID()
local unitID = 
Spring.CreateUnit("palmx",100,0,100,0,GetGaiaTeamID())
GG.mission.AddUnitGroup(unitID, "groupa")
where "palmx" is the name of the unit and "groupa" is the group that i assigned to unit...

but i don't found this unit at position of the map..what i wrong?
User avatar
KingRaptor
Zero-K Developer
Posts: 838
Joined: 14 Mar 2007, 03:44

Re: Help with mission editor and lua

Post by KingRaptor »

Any errors in console/infolog?
Try creating the unit with a Y position of Spring.GetGroundHeight(100,100) instead of 0.
User avatar
daryl
Posts: 195
Joined: 08 Oct 2006, 10:33

Re: Help with mission editor and lua

Post by daryl »

KingRaptor wrote:Any errors in console/infolog?
Try creating the unit with a Y position of Spring.GetGroundHeight(100,100) instead of 0.
hi King,

probably i did a mistake whit the code.

now it work but i used this code:

Code: Select all

local unitID = Spring.CreateUnit("PalmForest006",100,0,100,0,Spring.GetGaiaTeamID())
Spring.SetUnitNeutral (unitID, true)
GG.mission.AddUnitGroup(unitID, "groupa")
and now a palm appear at position 100, 100 of the map and it is a neutral unit of group "groupa" :)

thx for help!!
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Help with mission editor and lua

Post by Jools »

I need help with zK mission editor. I got it running, but when I want to create a mission it has a empty list of maps and mods. I did set the path to spring.exe correctly, but how can I set the path to maps and mods?
User avatar
KingRaptor
Zero-K Developer
Posts: 838
Joined: 14 Mar 2007, 03:44

Re: Help with mission editor and lua

Post by KingRaptor »

Jools wrote:I need help with zK mission editor. I got it running, but when I want to create a mission it has a empty list of maps and mods. I did set the path to spring.exe correctly, but how can I set the path to maps and mods?
AFAIK it uses the unitsync of the Spring installation you set to find the maps/mods. Does spring.exe find those maps/mods when run directly?
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Help with mission editor and lua

Post by Jools »

Yes, but it does so using a variable in springsettings.cfg (SpringData = U:/bin/Spring/Data). I have spring.exe installed in C:\Spring, but the maps and mods are in U:/bin/Spring/Data. My C-drive is a SSD drive, so it's not a good solution to put all maps there (they are about 15 Gb)

I tested to create a mods and a maps dir in C:\Spring, and to put 1 mod and 1 map there. Then it finds them, but it crashes on Loading Mod (Unit Definitions).

Here's a pastebin of the error report windows wants to send:
http://pastebin.com/ySus8r2Q

Here's a pastebin on unitsync.log:
http://pastebin.com/ebAr22cd
User avatar
KingRaptor
Zero-K Developer
Posts: 838
Joined: 14 Mar 2007, 03:44

Re: Help with mission editor and lua

Post by KingRaptor »

When the crash window pops up, could you click on "Show Error Log" and post the last entry (at the bottom of the file)?
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Help with mission editor and lua

Post by Jools »

It wants to send 3 files to microsoft. You mean the last of these?

1) WERE9E1.tmp.WERInternalMetadata.xml
2) WER223.tmp.appcompat.txt
3) WER2B0.tmp.mdmp

File 3 is binary. You sure you want it pasted? Here is 1 and 2:

1: http://pastebin.com/MSjM3ZhR
2: http://pastebin.com/EUGqMnh8
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Help with mission editor and lua

Post by Jools »

Here's a pastebin from the debug log from windbg, in case it helps:
http://pastebin.com/J4wEaRW3

Here's another paste from windbg, where I now chose to break on next unhandled exception:

http://pastebin.com/XR1V3sSR
User avatar
KingRaptor
Zero-K Developer
Posts: 838
Joined: 14 Mar 2007, 03:44

Re: Help with mission editor and lua

Post by KingRaptor »

I'm looking for a text file (My Documents/My Games/Spring/MissionEditorErrors.txt), linked from the dialog box that pops up when Mission Editor crashes. Is it not even getting that? o_O

Image
Attachments
error.png
(12.93 KiB) Downloaded 2 times
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10450
Joined: 24 Jan 2006, 21:12

Re: Help with mission editor and lua

Post by PicassoCT »

I always wondered what ObjectOrientatedProblemSolving had to do with it all..
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Help with mission editor and lua

Post by Jools »

KingRaptor wrote:I'm looking for a text file (My Documents/My Games/Spring/MissionEditorErrors.txt), linked from the dialog box that pops up when Mission Editor crashes. Is it not even getting that? o_O
It's not getting to that dialog window, and I don't have such a file on my computer. The error i get is the standard windows error reporting one.

Also, I don't have anything installed under My Games. Mission editor is installed in U:\bin\Spring\Data\games and it has no other file there accompanying it.
Post Reply

Return to “Lua Scripts”