View unanswered posts | View active topics It is currently Wed Nov 22, 2017 9:57 am



Reply to topic  [ 11 posts ] 
 How to Spawn Bodies from Console? 
Author Message

Joined: Tue Nov 27, 2012 12:34 am
Posts: 2
Reply with quote
Post How to Spawn Bodies from Console?
Sorry if this is in the wrong place

I've been trying to spawn enemy bodies from the console for a while now, for testing matters. And I don't know how. I've looked at a few Lua tutorials, but they're just not helping with this.
Anyone know how? :???:


Tue Nov 27, 2012 12:49 am
Profile
DRL Developer
DRL Developer

Joined: Tue Aug 11, 2009 5:09 am
Posts: 395
Reply with quote
Post Re: How to Spawn Bodies from Console?
Copy and paste this in to the console:
Code:
a=CreateAHuman("Brain Robot") a.Pos=SceneMan:MovePointToGround(Vector(99,0),9,9) a.Team=0 MovableMan:AddActor(a)


Tue Nov 27, 2012 9:08 am
Profile

Joined: Fri Sep 10, 2010 1:48 am
Posts: 627
Location: Halifax, Canada
Reply with quote
Post Re: How to Spawn Bodies from Console?
This is a bit off-topic but since abdul already answered the question I hope it's okay.

Abdul I noticed you used a = ... instead of local a = ... Would that be local a or global a? I know the console can be used to change global variables but does it automatically write them as local? If that's the case, can you specify a variable as global from the console, e.g. global a = ...?


Tue Nov 27, 2012 7:05 pm
Profile
DRL Developer
DRL Developer

Joined: Tue Aug 11, 2009 5:09 am
Posts: 395
Reply with quote
Post Re: How to Spawn Bodies from Console?
I assume that 'a' will be a global, but haven't really thought about it. I just omitted the local to make the code as short as possible. If you want to know what variables and functions are global just print the contents of the _G table.


Tue Nov 27, 2012 8:47 pm
Profile

Joined: Fri Sep 10, 2010 1:48 am
Posts: 627
Location: Halifax, Canada
Reply with quote
Post Re: How to Spawn Bodies from Console?
Oh yeah, that's good to know; I'd forgotten all about _G table, thanks.


Tue Nov 27, 2012 10:02 pm
Profile

Joined: Tue Nov 27, 2012 12:34 am
Posts: 2
Reply with quote
Post Re: How to Spawn Bodies from Console?
Abdul Alhazred wrote:
Copy and paste this in to the console:

Thanks so much. :D


Tue Nov 27, 2012 11:10 pm
Profile

Joined: Wed Dec 28, 2011 4:18 pm
Posts: 86
Reply with quote
Post Re: How to Spawn Bodies from Console?
I know the topic is very old and I'm sorry about that.

But is it possible to spawn bodies holding specific HDFIREARM?


Sat Oct 26, 2013 2:45 pm
Profile

Joined: Fri Nov 23, 2012 5:42 am
Posts: 142
Reply with quote
Post Re: How to Spawn Bodies from Console?
Code:
a=CreateAHuman("Brain Robot") a.Pos=SceneMan:MovePointToGround(Vector(99,0),9,9) a.Team=0 a:AddInventoryItem(CreateHDFirearm("Medium Digger")) MovableMan:AddActor(a)


This should work.


Sat Oct 26, 2013 3:09 pm
Profile

Joined: Wed Dec 28, 2011 4:18 pm
Posts: 86
Reply with quote
Post Re: How to Spawn Bodies from Console?
Yeah it works! Thank you man :grin:


Sat Oct 26, 2013 4:27 pm
Profile

Joined: Fri Jun 15, 2012 3:22 am
Posts: 10
Reply with quote
Post Re: How to Spawn Bodies from Console?
Bad Boy wrote:
Oh yeah, that's good to know; I'd forgotten all about _G table, thanks.

Hey there... *rubs hands together*
So uhh...
Whats this _G table we speak of... and where can I find it O_o


Fri Nov 01, 2013 10:10 pm
Profile
happy carebear mom
User avatar

Joined: Tue Mar 04, 2008 1:40 am
Posts: 7086
Location: b8bbd5
Reply with quote
Post Re: How to Spawn Bodies from Console?
I assume it's the same _G table as mentioned in the Lua documentation.


Sat Nov 02, 2013 1:48 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 11 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.025s | 15 Queries | GZIP : Off ]