View unanswered posts | View active topics It is currently Thu Mar 28, 2024 10:53 pm



Reply to topic  [ 2 posts ] 
 Simple(?) Lua Request/Guidance 
Author Message

Joined: Sun Apr 24, 2011 12:19 am
Posts: 18
Reply with quote
Post 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.


Mon Jun 11, 2012 9:55 am
Profile
DRL Developer
DRL Developer

Joined: Tue Aug 11, 2009 5:09 am
Posts: 395
Reply with quote
Post 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.


Mon Jun 11, 2012 11:16 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.202s | 15 Queries | GZIP : Off ]