kevuwk Posted February 5, 2007 Posted February 5, 2007 NOTICE: THIS TUTORIAL MAY BE OUTDATED! PLEASE READ: https://forum.multitheftauto.com/viewtopic.php?f=91&t=22270 This is our respond thread for our fourth weekly scripting tutorial. You can respond to the tutorial here if you have any questions, etc. Here's the link to the first tutorial: Scripting Tutorial IV - Hay
MTA Team jhxp Posted February 5, 2007 MTA Team Posted February 5, 2007 Technical problems sorted. Enjoy.
iam2noob4u Posted February 5, 2007 Posted February 5, 2007 Thats very cool... the script looks a bit more complicated compared to the others, so I'll read it through tommorow... The movie is great, it shows a lot more then the Christmas movie did. 50 Levels: (a/b) x% Is added by the script and shows how far you [and others] are right?
[TDH]Boss Posted February 5, 2007 Posted February 5, 2007 You forgot to include .lua file, some headers and links in the tutorial itself. Check it out and compare with previous ones.
Michilus_nimbus Posted February 5, 2007 Posted February 5, 2007 Pure freakin genious. Lovely how such a simple source file can produce a stunning gamemode like that.
Phat Looser Posted February 5, 2007 Posted February 5, 2007 Thats very cool... the script looks a bit more complicated compared to the others, so I'll read it through tommorow...The movie is great, it shows a lot more then the Christmas movie did. 50 Levels: (a/b) x% Is added by the script and shows how far you [and others] are right? Looks like it, yes.
erorr404 Posted February 6, 2007 Posted February 6, 2007 Thats very cool... the script looks a bit more complicated compared to the others, so I'll read it through tommorow...The movie is great, it shows a lot more then the Christmas movie did. 50 Levels: (a/b) x% Is added by the script and shows how far you [and others] are right? It shows your name and health.
[TDH]Boss Posted February 6, 2007 Posted February 6, 2007 1) When a player joins, would the current hay bails be cynced for him? 2) If any rock falls and destroys every hay bail below, would all the players still be able to climb to the top? 3) I have also noticed, that someone's nick was cut as it was too long. IS there any way to avoid it and if yes, why wasn't it made in the video? 4) Is there any way to manage text outputs, like moving them to any point on the screen, changing styles, fonts, sizes etc? If yes, could you please give a sample of the needed function?
lil Toady Posted February 6, 2007 Posted February 6, 2007 1) When a player joins, would the current hay bails be cynced for him?2) If any rock falls and destroys every hay bail below, would all the players still be able to climb to the top? 3) I have also noticed, that someone's nick was cut as it was too long. IS there any way to avoid it and if yes, why wasn't it made in the video? 4) Is there any way to manage text outputs, like moving them to any point on the screen, changing styles, fonts, sizes etc? If yes, could you please give a sample of the needed function? 1) Yes it will be synced for everyone 2) I'm not sure about this 3/4) Those text displays were made by scripting and you can change their position, size, color etc. It was probably not changed in the video cause of lazy scripter [lua]textCreateTextItem ( string text, float x, float y, priority, R, G, B, Alpha, Scale ) --This will display "hello" in the center of player's screen textDisplay = textCreateDisplay () textItem = textCreateTextItem ( "hello", 0.5, 0.5, 1, 0, 0, 255, 255, 3 ) textDisplayAddText ( textDisplay, textItem ) textDisplayAddObserver ( textDisplay, myPlayer ) --Display it for myPlayer only[/lua]
Brophy Posted February 6, 2007 Posted February 6, 2007 Thats very cool... the script looks a bit more complicated compared to the others, so I'll read it through tommorow...The movie is great, it shows a lot more then the Christmas movie did. 50 Levels: (a/b) x% Is added by the script and shows how far you [and others] are right? It shows your name and health. erm, doesnt it show name and how far up you are / furthest you have gone
So'lide Posted February 6, 2007 Posted February 6, 2007 Name, player's current level, player's highest level and hp in %.
[TDH]Boss Posted February 6, 2007 Posted February 6, 2007 textCreateTextItem ( string text, float x, float y, priority, R, G, B, Alpha, Scale ) As far as I understand, "priority" gives the ability to show one text above the other. But where is the parameter for changing font?
BTH Posted February 6, 2007 Posted February 6, 2007 Whats the point of this? [lua]function copyTable ( src, des ) for k,v in pairs(src) do if (type(v) == "table") then des[k] = {} copyTable(src[k],des[k]) else des[k] = v end end end[/lua]
Aeron Posted February 6, 2007 Posted February 6, 2007 (edited) 1) When a player joins, would the current hay bails be cynced for him?2) If any rock falls and destroys every hay bail below, would all the players still be able to climb to the top? 3) I have also noticed, that someone's nick was cut as it was too long. IS there any way to avoid it and if yes, why wasn't it made in the video? 4) Is there any way to manage text outputs, like moving them to any point on the screen, changing styles, fonts, sizes etc? If yes, could you please give a sample of the needed function? 1. Yes 2. If a bail is 'destroyed' it 'respawns' the next time that bail moves. (Quite nasty ) 3. Don't pick long names 4. Script is editble. textCreateTextItem ( string text, float x, float y, priority, R, G, B, Alpha, Scale ) As far as I understand, "priority" gives the ability to show one text above the other. But where is the parameter for changing font? Font changing isn't possible. Priority stands for how quick the text in the display must be updated on a change. Whats the point of this? [lua]function copyTable ( src, des ) for k,v in pairs(src) do if (type(v) == "table") then des[k] = {} copyTable(src[k],des[k]) else des[k] = v end end end[/lua] The script makes a copy of the current matrix, fills in the player positions then checks bail movement, at the next check we don't want the players position of the previous check in the matrix, thats why the copy and that functions copies the matrix. Edited February 6, 2007 by Guest
[TDH]Boss Posted February 6, 2007 Posted February 6, 2007 Font changing isn't possible. Priority stands for how quick the text in the display must be updated on a change. Does that mean that there is only one font in the whole MTA:DM?
Aeron Posted February 6, 2007 Posted February 6, 2007 Font changing isn't possible. Priority stands for how quick the text in the display must be updated on a change. Does that mean that there is only one font in the whole MTA:DM? Yes.
BTH Posted February 6, 2007 Posted February 6, 2007 Doesn't Lua have built-in support for copying tables?
Raoul Posted February 9, 2007 Posted February 9, 2007 Lol, something really different, whats the song on the movie?
Guest Posted February 9, 2007 Posted February 9, 2007 Very cool tutorial! Also, not to rain on anybody's parade, but they're actually hay bales.
Aeron Posted March 6, 2008 Posted March 6, 2008 Necromancing this thread for it's amazing, wonderfull & brilliant creator of this game mode: me.
Recommended Posts