ijsf Posted January 22, 2007 Share Posted January 22, 2007 NOTICE: THIS TUTORIAL MAY BE OUTDATED! PLEASE READ: https://forum.multitheftauto.com/viewtopic.php?f=91&t=22270 Following last week's scripting tutorials on user created portals, we've just published a new tutorial covering MTA Snow. The tutorial shows you how to create special entities, how to make them look and fall like snow.. with some imagination of course. Head over to the Tutorials section to see! Link to comment
Sprinter Posted January 22, 2007 Share Posted January 22, 2007 Don't know if it's just me but I can't see all of the script text. Screenie: I'm using FF btw. Link to comment
driver2 Posted January 22, 2007 Share Posted January 22, 2007 You should probably use a newline for comments, like it was last time. I'm sure it will be fixed soon. Nice tutorial by the way. Not quite what I expected, but it shows once again the power of Lua and MTA. .edit. The link to the complete script results in a 404. Link to comment
Obelix Posted January 22, 2007 Share Posted January 22, 2007 Don't know if it's just me but I can't see all of the script text.... I use opera and when I get sucha problem I go to Tools/Preferences/Web Pages/Fit to width.... i dont know which browser u use, but try something like that Link to comment
Talco Posted January 22, 2007 Share Posted January 22, 2007 Good tutorial, but... the link for the complete script dont work (not found) http://www.mtasa.com/downloads/script2.lua Link to comment
kevuwk Posted January 22, 2007 Share Posted January 22, 2007 You should probably use a newline for comments, like it was last time. I'm sure it will be fixed soon.Nice tutorial by the way. Not quite what I expected, but it shows once again the power of Lua and MTA. i think this tutorial was to show the object manipulation which you will have also seen with the hay bails in the xmas vid Link to comment
iam2noob4u Posted January 22, 2007 Share Posted January 22, 2007 (edited) Talco is right, downloading the scripts give me a "404 - Not Found" error. Also, for viewing the comments: you cannot see them, but they are copied when you select the whole page . Lol will this work?: [lua]addCommandHandler ( "teleport", "tele_TeleCommand" ) function tele_TeleCommand ( player, commandname, x, y, z ) outputChatBox ( getClientName ( player ) .. " was teleported." ) --Thx eAi for telling me about the space setElementPosition ( player, x, y, z ) end[/lua] Probably not but at least I tried to make something. Also about the outputChatBox function, can i make the text I put in the chatbox purple or red (or wutever color)? Edited January 22, 2007 by Guest Link to comment
eAi Posted January 22, 2007 Share Posted January 22, 2007 Yes, that looks like it'll work, except you'll want a space before 'was', i.e. " was teleported". As for colors, yes, you can use them, just by adding the RGB value as arguments. The full definition for outputChatBox is: [lua]bool outputChatBox ( string text, [ element visibleTo=getRootElement(), int r=255, int g=255, int b=255 ] )[/lua] Link to comment
Guest Posted January 22, 2007 Share Posted January 22, 2007 How much bandwidth does this thing use as repeatedly setting a load of entities positions for loads of players can't be great. Also, wouldn't: if not px or not py or not pz then snowing = false return stop the snow if the player was on one of the axis? I.e. stood right in the middle of the world where X and Y would be 0.0, thus evaluating to false? Link to comment
iam2noob4u Posted January 22, 2007 Share Posted January 22, 2007 (edited) unless lua knows/sees the diffrence between 0 and 0.0000000 i think you're right. besides, if my teleport 'script' (rather to be called a very small code) will work with the first release, you could try it, and teleport to any position with either x, y, or z as 0 also the correct usage of outputChatBox would be: [lua]outputChatBox ( getClientName ( player ) .. " was teleported." , 255 , 43 , 43)[/lua] right? btw sorry for asking so much time that could be spend on development Edited January 22, 2007 by Guest Link to comment
lil Toady Posted January 22, 2007 Share Posted January 22, 2007 color is not required, if it's not set, mta uses default color here: bool outputChatBox ( string text, [ element visibleTo=getRootElement(), int r=255, int g=255, int b=255 ] ) all the stuff in [] brackets is not required Link to comment
iam2noob4u Posted January 22, 2007 Share Posted January 22, 2007 i meant: "if i use colors, this is the right way to use it" i should have been clearer. Link to comment
Brophy Posted January 22, 2007 Share Posted January 22, 2007 [lua]-- outputChatBox ( "What you wanna say", visibleto, r, g, b ) -- Example root = getRootElement () outputChatBox ( "Sniff me!", root, 255, 80, 60 ) [/lua] Link to comment
bloodeye Posted January 22, 2007 Share Posted January 22, 2007 Sorry i know its not a 'script' question, but what music was that? Link to comment
erorr404 Posted January 22, 2007 Share Posted January 22, 2007 How much bandwidth does this thing use as repeatedly setting a load of entities positions for loads of players can't be great. Also, wouldn't:if not px or not py or not pz then snowing = false return stop the snow if the player was on one of the axis? I.e. stood right in the middle of the world where X and Y would be 0.0, thus evaluating to false? No, it would only be false if one of the values were either false or nil. Link to comment
MTA Team jhxp Posted January 22, 2007 MTA Team Share Posted January 22, 2007 Sorry i know its not a 'script' question, but what music was that? The Prodigy - Babys Got A Temper (instrumental) Link to comment
eAi Posted January 22, 2007 Share Posted January 22, 2007 Lua does not see 0 as being equal to false, so 'if not a' is not the same as 'if a ~= 0' Link to comment
JacoB Posted January 23, 2007 Share Posted January 23, 2007 For an engine so capable of powerful and wondrous things, it's quite a downer to see these superfluous uses of it. Nobody will jump on the LUA bandwagon if your first impressions are these little lights you call "snowflakes". You could argue that you are merely showcasing the engine's capabilities in some fashion, but it strangely resembles the inevitable failure of a politician with bad speaking skills; claiming to be promising and almighty, yet unwilling or uncapable of expressing it in a way that has a community convinced. Link to comment
Ransom Posted January 23, 2007 Share Posted January 23, 2007 You are defining superfluous by a GTA standard. In MTA, its all about innovation. Snow could be used logically in maps. The amazing stuff will be revealed later. Right now we are keeping it simple. After all not all of us are mta hackin super computer buffs. Link to comment
norby89 Posted January 23, 2007 Share Posted January 23, 2007 it's all up to the creators imagination, I'm 100% positive that after DM is released the community will come up with loads of creative ideas, which had also happened in Race.. some of the maps I've played are simply extraordinary and all of them were made in the Race Map Editor which compared the to new scripting system is very limited.. Lua has to offer a lot and I don't think I'm exagerating when I say that "everything will be possible", you've only seen a small portion of the tip of the iceberg.. can't wait! Link to comment
MTA Team Blokker_1999 Posted January 23, 2007 MTA Team Share Posted January 23, 2007 For an engine so capable of powerful and wondrous things, it's quite a downer to see these superfluous uses of it. Nobody will jump on the LUA bandwagon if your first impressions are these little lights you call "snowflakes". You could argue that you are merely showcasing the engine's capabilities in some fashion, but it strangely resembles the inevitable failure of a politician with bad speaking skills; claiming to be promising and almighty, yet unwilling or uncapable of expressing it in a way that has a community convinced.Basicly it's up to your own imagination. You see snow, other people see what is behind it: object manipulation. And with that you can do nice stuff that we have showed in the past. The QA team's christmas movie contained a game mode with moving haystacks. And this rocket does really fly. Link to comment
Brophy Posted January 23, 2007 Share Posted January 23, 2007 Just like the journey me and talidan went on with santa's cow sled Link to comment
Ace_Gambit Posted January 23, 2007 Share Posted January 23, 2007 Man I'm going to use this script to drop big rocks and exploding barrels on the players head . Link to comment
Bladexen Posted January 24, 2007 Share Posted January 24, 2007 Very random... But verry verry cool! I guess the numbers after /snow means the height how fast size how many ect. Awsome. Link to comment
Brophy Posted January 24, 2007 Share Posted January 24, 2007 You would know if u read the tutorial Link to comment
Recommended Posts