Data Realms Fan Forums
http://45.55.195.193/

Enemy Spawning at edge of map
http://45.55.195.193/viewtopic.php?f=8&t=30423
Page 1 of 1

Author:  Pantera1993 [ Tue Feb 21, 2012 5:52 am ]
Post subject:  Enemy Spawning at edge of map

I remember there was a map where the enemy actors spawned at the edge of the map without dropships, it wasn't X-wrapped. I was wondering how I would do something like this, and also if anyone knows where this map went.

Author:  Bad Boy [ Tue Feb 21, 2012 7:15 pm ]
Post subject:  Re: Enemy Spawning at edge of map

This should work fine though I may end up making a mistake or two:
Code:
local actor = nil;
actor = CreateAHuman("Actor name" , "actor module.rte"); -- eg. ("Soldier Heavy" , "Coalition.rte");
actor.Team = whatever team -- eg. self.CPUTeam if you've defined it
actor.AIMode = Actor.AIMODE_SENTRY; -- or Actor.AIMODE_GOTO (you have to define a waypoint for this), Actor.AIMODE_BRAINHUNT, etc.
actor.Pos = Vector(10 , y) -- y would be the value at which the actor is on the ground. You can do this using functions but I find it easier to just place an actor in scene maker and check his y coordinates in the scene's ini (though that's probably cause I don't know the functions that do it for you very well)
MovableMan:AddActor(actor)

Obviously you'll need to add values for everything but this is the basic code. It's pretty much the same as spawning an actor in a dropship except you add the actor instead of the dropship and you give him a position to spawn at.


Also, have you checked out weegee's mission making tutorials? These are incredibly useful and teach you most of what you need to know for simple mission making. The rest you can learn by writing missions and getting confident at it and by looking through various activities. Personally, I'd recommend swarm for that. It deals with a lot of things the tutorials don't while not being too ridiculously complex in most places. Though ultimately what activities you should look at depends on what you're trying to achieve.
The wiki is also very useful for making missions. Specifically the Index of all Luafiable objects and the Listing of known functions will help you a lot.

Author:  Pantera1993 [ Tue Feb 21, 2012 9:33 pm ]
Post subject:  Re: Enemy Spawning at edge of map

Yeah I've looked through the tutorials before but the mission I wanted to make at the time was way too complicated for me. They have been helpful for getting the basics of the activities down, and I'll be referring to them a lot for the mission I'm working on now.

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