Data Realms Fan Forums
http://forums.datarealms.com/

Simple(?) Lua Request/Guidance
http://forums.datarealms.com/viewtopic.php?f=73&t=31212
Page 1 of 1

Author:  12GaugeHysterectomy [ Mon Jun 11, 2012 9:55 am ]
Post subject:  Simple(?) Lua Request/Guidance

Hi,

I've been working on a particular map for a while, and after becoming frustrated with the fact that the B27 update didn't fix the SkirmishDefence activity to make it so all teams obey their set landing zones, I decided the only other course of action would be to make it into a proper mission.

Could someone please provide me with a simple template for a script that places a braincase (Not a robot) at a specific point in the map (Called 'Cavern Base') for player 0, and spawns infinite waves of dropships/rockets/dropcrates that will contain ronin troops/equipment at a specific area box on the map?

I've been following the tutorials and stuff, but they don't seem to provide any instructions specific enough to help me figure out how to get this working. I have the .rte's directories/.inis all set up; I just need the LUA (As far as I can tell).

Cheers.

Author:  Abdul Alhazred [ Mon Jun 11, 2012 11:16 am ]
Post subject:  Re: Simple(?) Lua Request/Guidance

Here is a starting point; an example of how to spawn an actor in an area that has been defined in the Area editor:
Code:
         local Act = CreateAHuman("ActorName", "FolderName.rte")
         if Act then
            Act.Pos = SceneMan.Scene:GetArea("Area1"):GetCenterPoint()
            Act.Team = Activity.TEAM_1
            Act.AIMode = Actor.AIMODE_GOTO
            Act:AddAISceneWaypoint(SceneMan.Scene:GetArea("Area2"):GetCenterPoint())
            
            local Wpn = CreateHDFirearm("Medium Digger", "Base.rte")
            if Wpn then
               Act:AddInventoryItem(Wpn)
            end
            
            MovableMan:AddActor(Act)
         end



It is also possible to get a random point inside an area, instead of the center point.

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/