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

How to Spawn Bodies from Console?
http://forums.datarealms.com/viewtopic.php?f=4&t=33026
Page 1 of 1

Author:  Cakebones [ Tue Nov 27, 2012 12:49 am ]
Post subject:  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? :???:

Author:  Abdul Alhazred [ Tue Nov 27, 2012 9:08 am ]
Post subject:  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)

Author:  Bad Boy [ Tue Nov 27, 2012 7:05 pm ]
Post subject:  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 = ...?

Author:  Abdul Alhazred [ Tue Nov 27, 2012 8:47 pm ]
Post subject:  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.

Author:  Bad Boy [ Tue Nov 27, 2012 10:02 pm ]
Post subject:  Re: How to Spawn Bodies from Console?

Oh yeah, that's good to know; I'd forgotten all about _G table, thanks.

Author:  Cakebones [ Tue Nov 27, 2012 11:10 pm ]
Post subject:  Re: How to Spawn Bodies from Console?

Abdul Alhazred wrote:
Copy and paste this in to the console:

Thanks so much. :D

Author:  Pumone [ Sat Oct 26, 2013 2:45 pm ]
Post subject:  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?

Author:  clunatic [ Sat Oct 26, 2013 3:09 pm ]
Post subject:  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.

Author:  Pumone [ Sat Oct 26, 2013 4:27 pm ]
Post subject:  Re: How to Spawn Bodies from Console?

Yeah it works! Thank you man :grin:

Author:  nomnum [ Fri Nov 01, 2013 10:10 pm ]
Post subject:  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

Author:  Duh102 [ Sat Nov 02, 2013 1:48 pm ]
Post subject:  Re: How to Spawn Bodies from Console?

I assume it's the same _G table as mentioned in the Lua documentation.

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