Jump to content

Scripting Tutorial 4 - Hay


kevuwk

Recommended Posts

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.

Link to comment
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.

Link to comment

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?

Link to comment
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 :P

[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]

Link to comment
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

Link to comment
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 by Guest
Link to comment
  • 1 year later...
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...