Data Realms Fan Forums
http://45.55.195.193/

Simple Lua requests thread.
http://45.55.195.193/viewtopic.php?f=73&t=12102
Page 1 of 6

Author:  Dal [ Tue Aug 26, 2008 10:46 am ]
Post subject:  Simple Lua requests thread.

Figured we could use one instead of spawning a topic for every little thing. To start us off, I'm looking to restrict the player drop zones; how would I move any rocket or dropship on my team to a specified area (if not already there)?

Author:  Roon3 [ Tue Aug 26, 2008 11:08 am ]
Post subject:  Re: Simple Lua requests thread.

Code:
   
for actor in MovableMan.Actors do
       if (actor.ClassName == ACDropship or actor.ClassName == ACRocket) then
              if SceneMan.Scene:WithinArea("<blablabla>", actor.Pos) then
                   actor.Pos.X = < area you want him to go to here>;
         actor.Vel.X = actor.Vel.X;
         actor.Vel.Y = actor.Vel.Y;
      end
          end
    end


Cover the map top with that and you should be done. :grin:

Also how do you give velocity to the weapon the actor is currently holding?

Author:  Gotcha! [ Tue Aug 26, 2008 11:32 am ]
Post subject:  Re: Simple Lua requests thread.

So this way we can force people to use the landing pads in my maps? ;-) This stuff rocks.

Author:  Dal [ Tue Aug 26, 2008 11:38 am ]
Post subject:  Re: Simple Lua requests thread.

Thought you'd enjoy that one as well, Gotcha. ;) Thanks for the help, Roon. Is there a way to set up an 'If not' trigger so we don't have to cover the top of the map?

Edit: I don't think we have control over individual items yet. (:() Someone could probably tell you how to make all weapons going flying across the room, though. :P

Author:  Daman [ Tue Aug 26, 2008 1:03 pm ]
Post subject:  Re: Simple Lua requests thread.

Dal wrote:
Thought you'd enjoy that one as well, Gotcha. ;) Thanks for the help, Roon. Is there a way to set up an 'If not' trigger so we don't have to cover the top of the map?

Edit: I don't think we have control over individual items yet. (:() Someone could probably tell you how to make all weapons going flying across the room, though. :P



I'm not at my computer at the moment, but I am pretty sure that there is MovableMan.HeldDevices or something of the sort.

Author:  Gotcha! [ Tue Aug 26, 2008 1:28 pm ]
Post subject:  Re: Simple Lua requests thread.

Dal wrote:
Thought you'd enjoy that one as well, Gotcha. ;)


You betcha. With all this new stuff to add I'll even have to hire new staff to help me out. :)

Author:  Normandy [ Tue Aug 26, 2008 9:41 pm ]
Post subject:  Re: Simple Lua requests thread.

Would it be possible to allow actors to pick up explosives this way?

I was thinking something along the lines of 'Actor picks up Weapon, which activates script that destroys the weapon while adding the actual explosive to the actor's inventory'.

Author:  coilgunner4 [ Tue Aug 26, 2008 11:41 pm ]
Post subject:  Re: Simple Lua requests thread.

Someone should make a lua Landmine, like a butterfly mine or just something simple like a pressure sensitive type. That would be tight, I'm still reading up on Lua but I should get there soon.

Author:  CandleJack [ Tue Aug 26, 2008 11:46 pm ]
Post subject:  Re: Simple Lua requests thread.

Someone should make a spaceship mission that has 0 gravity, but the inside of the ship uses lua to simulate artificial gravity. They go away after destroying the reactor9which is the mission objective). After that, you have to get to the escape pod room and escape(I have no idea if lua can replace actors with other actors).

Author:  coilgunner4 [ Wed Aug 27, 2008 12:17 am ]
Post subject:  Re: Simple Lua requests thread.

CandleJack wrote:
Someone should make a spaceship mission that has 0 gravity, but the inside of the ship uses lua to simulate artificial gravity. They go away after destroying the reactor9which is the mission objective). After that, you have to get to the escape pod room and escape(I have no idea if lua can replace actors with other actors).


that's intense

Author:  Azukki [ Wed Aug 27, 2008 12:40 am ]
Post subject:  Re: Simple Lua requests thread.

Could someone help me remove a helddevice from an actor's inventory?

Right now, I've got
Code:
    for actor in MovableMan.Actors do
        if SceneMan.Scene:WithinArea("objectivereturnarea", actor.Pos) and actor.HeldDevice==objective and actor.Team == 0 then
           self.RedTeamPoints = self.RedTeamPoints + 1;
          actor.RemoveItem("objective");
          print (self.RedTeamPoints);
        end
    end   

objective is the HeldDevice. As is, I get the following in the console when the if conditions are met.
Quote:
ERROR [line of RemoveItem] attempt to call field 'RemoveItem' (a nil value)

Author:  robowurmz [ Wed Aug 27, 2008 7:55 am ]
Post subject:  Re: Simple Lua requests thread.

Your problem there is that the function RemoveItem doesn't actually exist. Try gibbing the helditem.
We could make a weapon stripper outside the enemy base in a campaign. Just like Half Life 2!

Author:  numgun [ Wed Aug 27, 2008 12:32 pm ]
Post subject:  Re: Simple Lua requests thread.

Heh, first loop through all the weapons and make them forcefully drop and them gib them right away. Although what would be funny if someone was carrying a powerful plasma cannon with a fragile energy cell that is ment to explode if an enemy hits there (a character flaw, you know.) and if someone unfortunate carrying that or a bomb, he's gone for good.

Maybe theres a Delete() function that would simply make the gun go "poof"?

Author:  war_man333 [ Wed Aug 27, 2008 8:06 pm ]
Post subject:  Re: Simple Lua requests thread.

robowurmz wrote:
Your problem there is that the function RemoveItem doesn't actually exist. Try gibbing the helditem.
We could make a weapon stripper outside the enemy base in a campaign. Just like Half Life 2!


Ok lua isn't so bad afterall! :grin:

Author:  Azukki [ Wed Aug 27, 2008 11:58 pm ]
Post subject:  Re: Simple Lua requests thread.

robowurmz wrote:
Your problem there is that the function RemoveItem doesn't actually exist. Try gibbing the helditem.
We could make a weapon stripper outside the enemy base in a campaign. Just like Half Life 2!

How would I select it in order to gib it though?

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