One or two questions

One or two questions

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

Moderator: Moderators

Post Reply
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

One or two questions

Post by AF »

1) How do you load a groupAI via lua?
2) How would I draw an arbitrary string at a map co-ordinate?
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Post by trepan »

1) How do you load a groupAI via lua?
- Spring.SelectUnitArray()
- Spring.SendCommands({"aiselect Group AI Name"})
or
- Use Spring.SetUnitGroup(unitID, groupID) if a group with the
right GroupAI already exists

2) How would I draw an arbitrary string at a map co-ordinate?
- Spring.AddWorldText('text', posx, posy, posz) -- (attached to selected units)
or
- Use gl calls in DrawWorld() to setup the transformation, and then
draw the text with gl.Text(), and use the lua fontHandler
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

hmm how would I then get rid of that text in order to update it?
Post Reply

Return to “Lua Scripts”