View unanswered posts | View active topics It is currently Thu Dec 26, 2024 3:40 pm



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

Joined: Sat Feb 03, 2007 7:11 pm
Posts: 1496
Reply with quote
Post Re: Simple Lua requests thread.
So how would I make it so something happens if a
certain ship isn't currently in the scene, but it is
"CreateACRocket"ed so it is defined.

And how do I detect if there are no actors on a team except for the brain in an "if" statement.


Thu Aug 28, 2008 2:05 am
Profile WWW

Joined: Mon Aug 25, 2008 1:03 am
Posts: 10
Reply with quote
Post Re: Simple Lua requests thread.
zalo wrote:
So how would I make it so something happens if a
certain ship isn't currently in the scene, but it is
"CreateACRocket"ed so it is defined.

MovableMan:IsActor(actor) will return true if the actor has a physical model in the scene.

So,
Code:
if not MovableMan:IsActor(ship) then
     -- do stuff
end


Quote:
And how do I detect if there are no actors on a team except for the brain in an "if" statement.

Loop through the actors in the scene - if any are on the right team and are not a brain, you have your answer.

Something like
Code:
local check = true;
for actor in MoveableMan.Actors do
     if actor.Team == 0 and MovableMan:IsAssignedBrain(actor) then
          check = false;
     end
end


Thu Aug 28, 2008 2:27 am
Profile

Joined: Sat Jul 26, 2008 9:15 pm
Posts: 4
Reply with quote
Post Re: Simple Lua requests thread.
OK, so I was playing the Force Unleashed Demo, and I was thinking, what if with Lua, we could use force powers??? Do you guys think it would be very hard once we get B22 with mods with Lua? Because that would be a really neat mod...


Thu Aug 28, 2008 2:28 am
Profile
Banned

Joined: Tue Aug 26, 2008 6:09 pm
Posts: 432
Reply with quote
Post Re: Simple Lua requests thread.
Avatar wrote:
OK, so I was playing the Force Unleashed Demo, and I was thinking, what if with Lua, we could use force powers??? Do you guys think it would be very hard once we get B22 with mods with Lua? Because that would be a really neat mod...
Yes, cause the adaptation of Lua will make it possible to do things NEVER DONE BEFORE WITH CC.

[sigh]


Thu Aug 28, 2008 2:29 am
Profile

Joined: Mon Aug 25, 2008 1:03 am
Posts: 10
Reply with quote
Post Re: Simple Lua requests thread.
Avatar wrote:
OK, so I was playing the Force Unleashed Demo, and I was thinking, what if with Lua, we could use force powers??? Do you guys think it would be very hard once we get B22 with mods with Lua? Because that would be a really neat mod...

Yeah, that should be doable. The only thing holding us back now is the inability to have a trigger for it. Something like a force push would be pretty easy to script.


Thu Aug 28, 2008 2:31 am
Profile

Joined: Sat Feb 03, 2007 7:11 pm
Posts: 1496
Reply with quote
Post Re: Simple Lua requests thread.
Thanks, That worked!

Here are some other questions I have, Mr.Tay.

1. What would the script be if I wanted any AHuman
that I've spawned to follow a path with defined way
points with Lua.

2. A DelayTimer so the If Statement doesn't run infinitely
fast until the If is false or if I need a delay between two
actions that are triggered by the same thing.

3. If you know, How does the
Code:
SetObservationTarget
code work? Does it only apply after there are no actors left to switch to? Could I use it for Cutscenes so it zooms to different parts of the level with the timer I mentioned earlier?


Thu Aug 28, 2008 3:04 am
Profile WWW
User avatar

Joined: Sun Apr 15, 2007 5:56 am
Posts: 1191
Location: outside the shithole called the University in the Forest
Reply with quote
Post Re: Simple Lua requests thread.
Is it possible to make a box which reduces the velocity of all craft and robots to zero and keeps it there, but does not effect clones or crabs?
Interference zone, ♥♥♥♥ yeah.


Thu Aug 28, 2008 5:15 am
Profile
DRL Developer
DRL Developer
User avatar

Joined: Wed Dec 13, 2006 5:27 am
Posts: 3138
Location: A little south and a lot west of Moscow
Reply with quote
Post Re: Simple Lua requests thread.
ProjektODIN wrote:
Avatar wrote:
OK, so I was playing the Force Unleashed Demo, and I was thinking, what if with Lua, we could use force powers??? Do you guys think it would be very hard once we get B22 with mods with Lua? Because that would be a really neat mod...
Yes, cause the adaptation of Lua will make it possible to do things NEVER DONE BEFORE WITH CC.

[sigh]

Actually, in this case, it would.
Take a look at this post on the dev log: http://www.datarealms.com/devlog/cortex ... a-console/
It shows off the ability to change an object's velocity. So force throws and such = probably yes.
Holding people up might not.


Thu Aug 28, 2008 5:33 am
Profile WWW
User avatar

Joined: Sun Apr 15, 2007 5:56 am
Posts: 1191
Location: outside the shithole called the University in the Forest
Reply with quote
Post Re: Simple Lua requests thread.
Holding people up is as simple as using a gravity gun from the Pheonix (sic) pack.
It may also gib the actor, but it works. Kinda.


Thu Aug 28, 2008 6:19 am
Profile

Joined: Thu Aug 16, 2007 10:09 am
Posts: 163
Reply with quote
Post Re: Simple Lua requests thread.
TheLastBanana wrote:
Actually, in this case, it would.
Take a look at this post on the dev log: http://www.datarealms.com/devlog/cortex ... a-console/
It shows off the ability to change an object's velocity. So force throws and such = probably yes.
Holding people up might not.


If we managed to get the direction the actor was aiming, we might be able to calculate how far away we should hold up an object and in what position. Then, after we have changing positions as we walk and look around, we can have it move the enemy actor's position to that position: updating frequently to give the impression he's being held up.


Thu Aug 28, 2008 7:32 am
Profile
User avatar

Joined: Wed Nov 21, 2007 7:49 pm
Posts: 189
Reply with quote
Post Lua Idea
So, I was wondering, would it be possible to make a scene where if you pressed a certain button, time would reverse? I think it would be amazingly awesome, but I understand that it may be impossible.

Another cool thing might be toggle-able gravity.

(I didn't put this in simple lua requests because I'm pretty sure they aren't simple.)


Thu Aug 28, 2008 3:33 pm
Profile
User avatar

Joined: Sat Jun 30, 2007 4:39 am
Posts: 521
Reply with quote
Post Re: Lua Idea
Simple requests are mostly "Simple" because of the lack of input the original poster puts in the project. So yes, this would be a simple request.


Thu Aug 28, 2008 4:30 pm
Profile WWW
User avatar

Joined: Wed Nov 21, 2007 7:49 pm
Posts: 189
Reply with quote
Post Re: Lua Idea
Electroclan wrote:
Simple requests are mostly "Simple" because of the lack of input the original poster puts in the project. So yes, this would be a simple request.

Fair enough.


Thu Aug 28, 2008 5:02 pm
Profile

Joined: Sat Feb 03, 2007 7:11 pm
Posts: 1496
Reply with quote
Post Re: Simple Lua requests thread.
I tried doing Fat Sand Rat's Idea about Craft Velocity interference, and I thought it'd look like this
Code:
        if rocket.ClassName == "ACRocket":WithinArea("Stopper", rocket.Pos) then
      rocket.Vel.Y = 0;
      rocket.Vel.X = 0;
        end

        if DShip.ClassName == "ACDropShip":WithinArea("Stopper", DShip.Pos) then
      DShip.Vel.Y = 0;
      DShip.Vel.X = 0;
        end


But it expects a "then" near the ":". Could a more experienced Lua-er
tell me what I did wrong, and if you could answer my other questions
that I posted earlier in the thread so I can start making serious maps,
that'd be just dandy.


Thu Aug 28, 2008 11:47 pm
Profile WWW
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: Simple Lua requests thread.
for actor in MovableMan.Actors do
if actor.ClassName == ACRocket then
actor.Vel = 0
end

if actor.ClassName == ACDropship then
actor.Vel = 0
end
end

Should work. Improperly tabbed, though.


Thu Aug 28, 2008 11:58 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 80 posts ]  Go to page Previous  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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.073s | 13 Queries | GZIP : Off ]