View unanswered posts | View active topics It is currently Tue May 28, 2024 10:48 am



Reply to topic  [ 4 posts ] 
 Lua? spawning stuff 
Author Message

Joined: Fri Mar 20, 2009 12:11 am
Posts: 16
Reply with quote
Post Lua? spawning stuff
So im pretty new to this whole lua buisness, and the wiki is alittle bit over whelming. at the moment i would like to know how to spawn a actor(if its possible) and also how to spawn one on either red/green team. can anyone help? or is this not possible?


Sun Aug 09, 2009 9:42 pm
Profile
User avatar

Joined: Sun May 31, 2009 1:04 am
Posts: 308
Reply with quote
Post Re: Lua? spawning stuff
Here's an example on how to make an AHuman.
Code:
local actor = CreateAHuman("Dummy");
actor.Team = 0; --Red team
actor.Pos = Vector(0,0); --Will move him to the top right cornor of the scene.
MovableMan:AddActor(actor);


Sun Aug 09, 2009 9:47 pm
Profile

Joined: Fri Mar 20, 2009 12:11 am
Posts: 16
Reply with quote
Post Re: Lua? spawning stuff
mhm thanks. so vector is the location where they wil be placed?


Sun Aug 09, 2009 9:49 pm
Profile
User avatar

Joined: Sun Jul 13, 2008 9:57 am
Posts: 4886
Location: some compy
Reply with quote
Post Re: Lua? spawning stuff
yes, and it can be relative, for example, if you wanted it to be placed 20 pixels down from whatever was running the script, you could use actor.Pos = self.Pos + Vector(0,20)


Sun Aug 09, 2009 9:56 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 4 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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.015s | 14 Queries | GZIP : Off ]