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



Reply to topic  [ 98 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7  Next
 zalo's Little Lua Mods Now with Infininade! 
Author Message

Joined: Sat Feb 03, 2007 7:11 pm
Posts: 1496
Reply with quote
Post Re: Time Capsule
First off, ramonimbao, your avatar is the best ever.

Secondly, I'll probably do what Brainwashed
said and combine all these silly things into a
Minor Lua Mods thread (because, I genuinely
want to help people. Even if no one else notices
that I did, I'm still happy. :) )

Also, I don't want to deprive Bubs from a nice, organized Library of cheap lua tricks. :grin:
(maybe in the wiki there could be an example mod for each function?)


Sat May 16, 2009 8:52 pm
Profile WWW
User avatar

Joined: Fri Oct 10, 2008 12:39 pm
Posts: 111
Location: Finland, where else?
Reply with quote
Post Re: Time Capsule
This must have the ''Lets do the time warp agaaiinn!!..'' as a some sort of firing sound etc.


Sat May 16, 2009 8:54 pm
Profile
User avatar

Joined: Sun Jun 24, 2007 5:45 pm
Posts: 36
Location: UK
Reply with quote
Post Re: Time Capsule
ramonimbao wrote:
Didn't Data say that? Doesn't that mean there's whatever you are looking for in CC Lua?
please don't flame me


Unfortunately, you gotta take such things with a pinch of salt. Although it might imply LUA can make your grandma's toast, all systems have limitations and sooner or later modders run into them. But that's where ingenuity begins =)

Back to the subject of time travel, this made me think of an alternate idea for a time machine; a pod that takes an actor, then disappears in a shiny special effect. It reappears on the same spot in the future, say five minutes later. Store a few variables and remove/respawn the actors... why its so easy I may even do it. Finally, an opportunity to put a Delorean in Cortex Command :D

Oh yeah, custom sound never hurts too...
Marloss wrote:
This must have the ''Lets do the time warp agaaiinn!!..'' as a some sort of firing sound etc.

Wait, I take that back =P


Sat May 16, 2009 9:15 pm
Profile
User avatar

Joined: Fri Oct 17, 2008 9:46 pm
Posts: 5212
Location: The Grills Locker.
Reply with quote
Post Re: Time Capsule
Very good mod, Zalo. Lua can surely do some impressive things.

But I was wondering: would there not be a way of creating a selective time changing effect? More specifically, to create an actor that could slow down everything in a scene but itself. I didn't think it would be possible, as the TimeScale appears to be applied to all objects in a scene, but as Numgun created the Slow Time Grenade, maybe the method he used could be applied map-wide...
Hmm... *smoke starts coming out of my head*


Sat May 16, 2009 9:25 pm
Profile WWW
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: Time Capsule
I think numgun's effect just slows everything down by cutting particle velocity.

That'd be entirely possible, though it'd probably lag a good bit checking through everything.


Sat May 16, 2009 9:29 pm
Profile

Joined: Thu Aug 16, 2007 10:09 am
Posts: 163
Reply with quote
Post Re: Time Capsule
Must make a Dear Sister weapon now...


Sat May 16, 2009 9:30 pm
Profile
User avatar

Joined: Fri Oct 17, 2008 9:46 pm
Posts: 5212
Location: The Grills Locker.
Reply with quote
Post Re: Time Capsule
Grif wrote:
I think numgun's effect just slows everything down by cutting particle velocity.


But what if it did the exact opposite?
What if the actor used Zalo's TimeScale script to slow down everything in the scene by, for example, 5x, and Numgun's particle velocity script accelerated the said actor by 5x? The whole scene would get slower, but the actor would continue moving at normal speed, and much less lag would be generated. ( I guess)


Sat May 16, 2009 9:36 pm
Profile WWW

Joined: Thu Aug 16, 2007 10:09 am
Posts: 163
Reply with quote
Post Re: Time Capsule
Now that, good sirs, is definitely worth trying out.


Sat May 16, 2009 9:55 pm
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: Time Capsule
Areku wrote:
But what if it did the exact opposite?
What if the actor used Zalo's TimeScale script to slow down everything in the scene by, for example, 5x, and Numgun's particle velocity script accelerated the said actor by 5x? The whole scene would get slower, but the actor would continue moving at normal speed, and much less lag would be generated. ( I guess)


Well, uh, you could also just y'know add an if check so that if it's your actor it wouldn't be slowed down.


Sat May 16, 2009 10:19 pm
Profile
User avatar

Joined: Mon Jun 30, 2008 9:13 pm
Posts: 499
Location: Finland
Reply with quote
Post Re: Time Capsule
Iterating through everything and doing two simple calculations per thing shouldn't lag at all. Unless there's millions of stuff on the map.


Sat May 16, 2009 10:26 pm
Profile
User avatar

Joined: Fri May 16, 2008 11:12 pm
Posts: 471
Reply with quote
Post Re: Time Capsule
zalo wrote:
First off, ramonimbao, your avatar is the best ever.


OMG. Agreed!

Also, yeah, I think this will benifit to the community. Explanations are good, but they're only theory. This is practical stuff that you can mess around with and modify easily.

Good job!


Sat May 16, 2009 11:17 pm
Profile
User avatar

Joined: Fri Oct 17, 2008 9:46 pm
Posts: 5212
Location: The Grills Locker.
Reply with quote
Post Re: Time Capsule
piipu wrote:
Iterating through everything and doing two simple calculations per thing shouldn't lag at all. Unless there's millions of stuff on the map.


But then, what would be the calculations? The first one would be simply to check if the actor's name is TimeRobot, or something like that, and if it is not, change its velocity to, say, (ActorNewVel = (ActorCurrentVel/5)), or something like that. The problem is, if that math is applied, the actors' velocity would be divided by 5 every sim update, generating really low velocities over time. And I cannot even conceive the code for accessing an object's movement speed (Started learning lua today :P ) and changing it to a new value.
All in all, I'm very confused... :oops:


Sun May 17, 2009 1:36 am
Profile WWW
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: Time Capsule
Areku wrote:
But then, what would be the calculations? The first one would be simply to check if the actor's name is TimeRobot, or something like that, and if it is not, change its velocity to, say, (ActorNewVel = (ActorCurrentVel/5)), or something like that. The problem is, if that math is applied, the actors' velocity would be divided by 5 every sim update, generating really low velocities over time. And I cannot even conceive the code for accessing an object's movement speed (Started learning lua today :P ) and changing it to a new value.
All in all, I'm very confused... :oops:


Well you only have to cut velocity once. You'd make two tables: the previous speed for reference/to go back to, then a new speed setup. Everything is forcibly kept to the new value, and if anything new enters its speed is cut similarly.

Also, it's just actor.Vel. Stored as a vector. actor.Vel = actor.Vel / 5 should work just fine.


Sun May 17, 2009 2:08 am
Profile
User avatar

Joined: Fri Oct 17, 2008 9:46 pm
Posts: 5212
Location: The Grills Locker.
Reply with quote
Post Re: Time Capsule
Thanks! Gonna try implementing it now.


Sun May 17, 2009 2:15 am
Profile WWW
User avatar

Joined: Fri Oct 17, 2008 9:46 pm
Posts: 5212
Location: The Grills Locker.
Reply with quote
Post Re: Time Capsule
(Sorry for the double post)

It doesn't work, for some reason. I'm posting the code here:

Code:
function Create(self)
-- Ignore the following variable:
   self.TimeReductor = 0.2
end

function Update(self)
   for actor in MovableMan.Actors do
   if not actor:IsPlayerControlled then
      vector. actor.Vel = actor.Vel / 5;
      
      
      
           
       end
end


The console says there's a problem on line 8. It says " expected function argument near then". Apparently, it wants some kind of argument after the "then" but I have no idea why, as there is an argument in the following line. Any ideas?


Sun May 17, 2009 2:52 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 98 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7  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.161s | 14 Queries | GZIP : Off ]