View unanswered posts | View active topics It is currently Wed Dec 11, 2024 11:07 am



Reply to topic  [ 80 posts ]  Go to page 1, 2, 3, 4, 5, 6  Next
 Simple Lua requests thread. 
Author Message

Joined: Mon Dec 10, 2007 9:54 pm
Posts: 250
Reply with quote
Post 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)?


Tue Aug 26, 2008 10:46 am
Profile
User avatar

Joined: Sun May 11, 2008 12:50 pm
Posts: 899
Reply with quote
Post 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?


Last edited by Roon3 on Tue Aug 26, 2008 12:43 pm, edited 1 time in total.



Tue Aug 26, 2008 11:08 am
Profile WWW
User avatar

Joined: Tue Apr 01, 2008 4:49 pm
Posts: 1972
Location: The Netherlands
Reply with quote
Post Re: Simple Lua requests thread.
So this way we can force people to use the landing pads in my maps? ;-) This stuff rocks.


Tue Aug 26, 2008 11:32 am
Profile

Joined: Mon Dec 10, 2007 9:54 pm
Posts: 250
Reply with quote
Post 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


Tue Aug 26, 2008 11:38 am
Profile
User avatar

Joined: Fri Jan 26, 2007 3:22 am
Posts: 1451
Reply with quote
Post 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.


Tue Aug 26, 2008 1:03 pm
Profile
User avatar

Joined: Tue Apr 01, 2008 4:49 pm
Posts: 1972
Location: The Netherlands
Reply with quote
Post 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. :)


Tue Aug 26, 2008 1:28 pm
Profile
User avatar

Joined: Sun Nov 11, 2007 5:08 pm
Posts: 11
Reply with quote
Post 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'.


Tue Aug 26, 2008 9:41 pm
Profile
User avatar

Joined: Tue Aug 26, 2008 11:38 pm
Posts: 26
Location: Kansas (contrary to popular belief Kansas does in fact have computers)
Reply with quote
Post 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.


Tue Aug 26, 2008 11:41 pm
Profile
User avatar

Joined: Sun May 18, 2008 8:30 am
Posts: 732
Reply with quote
Post 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).


Tue Aug 26, 2008 11:46 pm
Profile
User avatar

Joined: Tue Aug 26, 2008 11:38 pm
Posts: 26
Location: Kansas (contrary to popular belief Kansas does in fact have computers)
Reply with quote
Post 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


Wed Aug 27, 2008 12:17 am
Profile
User avatar

Joined: Sat Nov 03, 2007 9:44 pm
Posts: 1916
Location: Flint Hills
Reply with quote
Post 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)


Wed Aug 27, 2008 12:40 am
Profile

Joined: Thu Aug 16, 2007 10:09 am
Posts: 163
Reply with quote
Post 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!


Wed Aug 27, 2008 7:55 am
Profile

Joined: Sat Jan 13, 2007 11:04 pm
Posts: 2932
Reply with quote
Post 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"?


Wed Aug 27, 2008 12:32 pm
Profile
User avatar

Joined: Sun Nov 11, 2007 1:49 pm
Posts: 785
Reply with quote
Post 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:


Wed Aug 27, 2008 8:06 pm
Profile
User avatar

Joined: Sat Nov 03, 2007 9:44 pm
Posts: 1916
Location: Flint Hills
Reply with quote
Post 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?


Wed Aug 27, 2008 11:58 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 80 posts ]  Go to page 1, 2, 3, 4, 5, 6  Next

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.115s | 14 Queries | GZIP : Off ]