generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Random scripting tips:

Previous Thread :: Next Thread 
Radioaktiivinen is not online. Radioaktiivinen
Joined: 25 Apr 2009
Total Posts: 18629
09 Nov 2011 08:28 AM
Using parts/tables/idkFUNCTIONS??? as keys in tables, way faster than looping thru table to find data related to the thing.
___________________
local tab={}

function SetData(a,b)
tab[a]=b
end

function GetData(a)
return tab[a]
end

SetData(part,"hai")

print(GetData(part))

>hai
___________________

When you has table, and stuff goes in and out (assuming youre using numerical indices), and you wanna insert something, instead of looping thru to find a free slot, put the free slots in another table when removing stuff. Assuming you cant use insert and remove because you use the table indices to access the data.
_____________________________
local tab={}
local free={}

function add(data)
if #free>0 then
tab[free[#free]]=data
free[#free]=nil
else
tab[#tab+1]=data
end
end

function remove(index)
tab[index]=nil
free[#free+1]=index
end

______________________________


chu use delay(timetorunfuncafter,func) to run multiple loops in script instead of messy coroutines
______________________________
local a=0
delay(0,function()
while true do
wait()
a=a+1
end
end)

delay(0,function()
while true do
wait()
print(a)
end
end)

>1
>2
>3
>4
>5
>H4x umg 3rr0r pl0x
_________________________________

Chu use cframe:toObjectSpace and cframe:toWorldSpace

________________________
CFrame:pointToWorld/ObjectSpace(vector3)
--objectspace returns where the point is when looking from cframes pos and rotation, worldspace returns what point is in world after moving it from the objects "view" to world spaic.

toWorld/ObjectSpace(cframe) does the same on cframes but with rotation
________________________


Report Abuse
EverquestI is not online. EverquestI
Joined: 03 Feb 2011
Total Posts: 11109
09 Nov 2011 03:51 PM
except my internet connection is so poor that no matter how many milliseconds you knock off it's still slow for me :(

- HIDE the EGG. Dube.
Report Abuse
Slizerd is not online. Slizerd
Joined: 15 Jun 2011
Total Posts: 113
09 Nov 2011 04:06 PM
:o
Report Abuse
XlegoX is not online. XlegoX
Joined: 16 Jun 2008
Total Posts: 14955
09 Nov 2011 05:06 PM
You can see a really fancy usage of this in my RTS pathfinder demo:
http://minus.com/ddWwkm.love

All of the nodes in the map store their adjacent nodes using this technique. Doing it normally is easily 2x as slow to update the map after a node is split or joined.
Report Abuse
crazypotato4 is not online. crazypotato4
Joined: 22 Feb 2010
Total Posts: 20000
09 Nov 2011 05:09 PM
has xlegox always had the moderator tag under his character

o-o
Report Abuse
Sorcus is not online. Sorcus
Forum Moderator
Joined: 29 Nov 2010
Total Posts: 3775
09 Nov 2011 05:10 PM
He just became a Moderator ;)

~Sorcus
Report Abuse
crazypotato4 is not online. crazypotato4
Joined: 22 Feb 2010
Total Posts: 20000
09 Nov 2011 05:10 PM
yay for xlegox

:D
Report Abuse
Sorcus is not online. Sorcus
Forum Moderator
Joined: 29 Nov 2010
Total Posts: 3775
09 Nov 2011 05:13 PM
I also have the mod tag, yay me!!

~Sorcus
Report Abuse
SCARFACIAL is not online. SCARFACIAL
Joined: 28 Jan 2010
Total Posts: 7970
09 Nov 2011 05:28 PM
Grats mah boi :D

Also, good job Sorcus. Ya special lil guy :3
Now fix the wiki.

"I WILL GIVE YOU BACON." - Deadmau5
~Scarfacial
Report Abuse
NecroBumpist is not online. NecroBumpist
Joined: 12 Sep 2010
Total Posts: 4198
09 Nov 2011 05:31 PM
>xLEGOx reinstated as mod
>Scripters forum quality improves drastically

I HAVE LONG AWAITED THIS DAY!
Report Abuse
JulienDethurens is not online. JulienDethurens
Joined: 11 Jun 2009
Total Posts: 11046
09 Nov 2011 05:44 PM
xLEGOx is going to be a mod again? Yay!

We just need Anaminus back as a mod too and this forum's quality is going to go up a lot! =D
Report Abuse
Slizerd is not online. Slizerd
Joined: 15 Jun 2011
Total Posts: 113
09 Nov 2011 06:15 PM
:o

Can I be a mod too?

*waits for someone to comment on how I'm banned as I ask this*
Report Abuse
Davidii is not online. Davidii
Joined: 17 Jul 2008
Total Posts: 1282
09 Nov 2011 06:21 PM
Dude, you realize you're banned, right?
Report Abuse
aboy5643a is not online. aboy5643a
Joined: 20 Nov 2010
Total Posts: 2785
09 Nov 2011 06:25 PM
Finally they made him a moderator!! :D Is he hired as staff or is he just a volunteer?
Report Abuse
Sorcus is not online. Sorcus
Forum Moderator
Joined: 29 Nov 2010
Total Posts: 3775
09 Nov 2011 06:31 PM
Won't say ;)

~Sorcus
Report Abuse
booing is not online. booing
Joined: 04 May 2009
Total Posts: 6594
09 Nov 2011 07:41 PM
umad^
Report Abuse
xSIXxStorage is not online. xSIXxStorage
Joined: 22 Aug 2010
Total Posts: 1811
09 Nov 2011 07:52 PM
^
Report Abuse
kingkiller1000 is not online. kingkiller1000
Joined: 12 Dec 2008
Total Posts: 26415
09 Nov 2011 08:03 PM
xLEGOx is a moderator again?

Oh, joy!
Report Abuse
stephen5 is not online. stephen5
Joined: 28 Jun 2008
Total Posts: 6676
09 Nov 2011 08:38 PM
XlegoX, isn't using offsite links a no - no?
Report Abuse
fiht345 is not online. fiht345
Joined: 24 Apr 2008
Total Posts: 7216
09 Nov 2011 08:41 PM
i have a moderator tag.



oh wait.

Do I? who knows
Report Abuse
SecureDatabase is not online. SecureDatabase
Joined: 12 Dec 2010
Total Posts: 392
09 Nov 2011 10:02 PM
ROBLOX finally went back to player mods. HURRAH. Unfortunately, it will be denied. How sad.

Maybe I'll start REALLY foruming here.
Report Abuse
ninga95 is not online. ninga95
Joined: 16 Jul 2008
Total Posts: 5026
09 Nov 2011 10:20 PM
Good job xLEGOx!! I'm glad you earned your position as a forum moderator yet again. Good luck and hope you keep this forum under control correctly. Hopefully the spam will be more less since we got xLEGOx back as a moderator. :)

*I should quit roblox right? I don't know!*
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image