Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 8 Vote(s) - 4.63 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Video Tutorials [OMG ELEVEN!!!!]
Simpanra Offline
Senior Member

Posts: 314
Threads: 28
Joined: Mar 2011
Reputation: 0
#61
RE: Video Tutorials [OMG ELEVEN!!!!]

(05-04-2011, 08:09 PM)Kyle Wrote: Hey, when you gonna get that lever combo tutorial? Smile

I understand most of your script =D I am still puzzled by some of it though... =/ Here, i will post it *fumbles around for script*

if(GetLocalVarInt("Lev") == 3) // This checks to see if the local variable integer "Lev" equals 3. <--- why does this have to equal three? =/

SetLocalVarInt("Lev", 4); <--- why are you setting the local varient to four?

for (int i = 1; i > 0 && i < 5; i++) <---- what on earth does this do? xD

for (int x = 1; x > 0 && x < 5; x++) <---- and again?
05-04-2011, 08:32 PM
Find
MrBigzy Offline
Senior Member

Posts: 616
Threads: 18
Joined: Mar 2011
Reputation: 8
#62
RE: Video Tutorials [OMG ELEVEN!!!!]

(05-04-2011, 08:32 PM)Simpanra Wrote: for (int i = 1; i > 0 && i < 5; i++) <---- what on earth does this do? xD

for (int x = 1; x > 0 && x < 5; x++) <---- and again?

First one: it does whatever is in the for-loop for the values of i 1-4.
Second one: same thing but for x.

Basically, you read these for loops like this: for i starting at 1, when i is greater than 0 AND i is smaller than 5, do the loop and iterate i 1 time at the end of the loop and repeat (i++ means i plus 1).
(This post was last modified: 05-04-2011, 08:57 PM by MrBigzy.)
05-04-2011, 08:52 PM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#63
RE: Video Tutorials [OMG ELEVEN!!!!]

I will try the best I can.

The variable equals 1 automatically from the start. The "(GetLocalVarInt("Lev") == 3)" checks to see if the variable equals 3. So if it doesn't, then it does whetever when it doesn't which is represented by not equal to (!=) the number. If the player pulls the first lever in the combo, which would say "(GetLocalVarInt("Lev") == 1)", it would do whatever in the brackets. Which in those brackets, it says that it sets the variable to 2. So when the player pulls the second lever in the combo, it will check to see if the variable equals 2.

"for (int i = 1; i > 0 && i < 5; i++)" If I translate this, it would say. Integer i equals 1. Integer i is greater than 0 and i is less than five. Then add integer i by 1 each time until it reaches it's max number, which is 4 because it has to be from 1 to 4. The other one is just exactly the same, just with a different variable. A local variable is for the entire script and a regular variable (in this case integers i and x) is only applied to the function.

There is a longer way to do this instead of those 2 "for" statements. You just have to implement what ever is between the 2 brackets right after the "for" statement for lever_1, lever_2, lever_3, and lever_4.


"lever_"+i adds the lever and integer i together to where within the limits of integer i (1 through 4) are used to determine the number lever it is. If you notice, the limits of integer i match the amount of levers there are. There are lever_1, lever_2, lever_3, and lever_4.

05-04-2011, 08:56 PM
Find
Simpanra Offline
Senior Member

Posts: 314
Threads: 28
Joined: Mar 2011
Reputation: 0
#64
RE: Video Tutorials [OMG ELEVEN!!!!]

(05-04-2011, 08:56 PM)Kyle Wrote: I will try the best I can.

The variable equals 1 automatically from the start. The "(GetLocalVarInt("Lev") == 3)" checks to see if the variable equals 3. So if it doesn't, then it does whetever when it doesn't which is represented by not equal to (!=) the number. If the player pulls the first lever in the combo, which would say "(GetLocalVarInt("Lev") == 1)", it would do whatever in the brackets. Which in those brackets, it says that it sets the variable to 2. So when the player pulls the second lever in the combo, it will check to see if the variable equals 2.

"for (int i = 1; i > 0 && i < 5; i++)" If I translate this, it would say. Integer i equals 1. Integer i is greater than 0 and i is less than five. Then add integer i by 1 each time until it reaches it's max number, which is 4 because it has to be from 1 to 4. The other one is just exactly the same, just with a different variable. A local variable is for the entire script and a regular variable (in this case integers i and x) is only applied to the function.

There is a longer way to do this instead of those 2 "for" statements. You just have to implement what ever is between the 2 brackets right after the "for" statement for lever_1, lever_2, lever_3, and lever_4.


"lever_"+i adds the lever and integer i together to where within the limits of integer i (1 through 4) are used to determine the number lever it is. If you notice, the limits of integer i match the amount of levers there are. There are lever_1, lever_2, lever_3, and lever_4.

I kind of understand you to begin with =) Its just later on the numbers and letters get so confusing xDDD Is there any slightly easier way to do this? Or maybe just start off with two levers or three? Im sorry i am coming across as a noob but i find some things harder to grasp than others (and in this case quite a lot harder to grasp), Im sorry for my stupidity =)
05-04-2011, 09:04 PM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#65
RE: Video Tutorials [OMG ELEVEN!!!!]

You can simply replace "SetEntityInteractionDisabled("lever_"+i, false);" with:

SetEntityInteractionDisabled("lever_1", false);
SetEntityInteractionDisabled("lever_2", false);
SetEntityInteractionDisabled("lever_3", false);
SetEntityInteractionDisabled("lever_4", false);


And then replace "SetLeverInteractionDisablesStuck("lever_"+x, true);" with:

SetLeverInteractionDisablesStuck("lever_1", true);
SetLeverInteractionDisablesStuck("lever_2", true);
SetLeverInteractionDisablesStuck("lever_3", true);
SetLeverInteractionDisablesStuck("lever_4", true);

That's what each one does. It's just compact to not take up a lot of space. Alright? Good. Big Grin

05-04-2011, 09:13 PM
Find
Exostalker Offline
Member

Posts: 204
Threads: 10
Joined: Aug 2010
Reputation: 3
#66
RE: Video Tutorials [OMG ELEVEN!!!!]

Suggestion:

Billboards. Many people still don't know how to properly set them up, so they would look like a real light from the window. Maybe you could do a tutorial for that, please? Smile

(This post was last modified: 05-04-2011, 09:47 PM by Exostalker.)
05-04-2011, 09:36 PM
Find
Simpanra Offline
Senior Member

Posts: 314
Threads: 28
Joined: Mar 2011
Reputation: 0
#67
RE: Video Tutorials [OMG ELEVEN!!!!]

(05-04-2011, 09:36 PM)Exostalker Wrote: Suggestion:

Billboards. Many people still don't know how to properly set them up, so they would look like a real light from the window. I would suggest that you would do a tutorial for that Smile

Good suggestion exo ^_^ i will get right on with that, i am just gonna look at some other peoples storys so i can compare good methods for billboards =)

And as for the levers, i will have another look and see if i can get it to make sense ^_^
05-04-2011, 09:42 PM
Find
Acies Offline
Posting Freak

Posts: 1,643
Threads: 60
Joined: Feb 2011
Reputation: 73
#68
RE: Video Tutorials [OMG ELEVEN!!!!]

I have described sticky-areas in this thread ---> http://www.frictionalgames.com/forum/thread-7823.html. Feel free to add that. I hope that it is correct though Angel

[Image: mZiYnxe.png]


05-05-2011, 10:12 PM
Find
Simpanra Offline
Senior Member

Posts: 314
Threads: 28
Joined: Mar 2011
Reputation: 0
#69
RE: Video Tutorials [OMG ELEVEN!!!!]

(05-05-2011, 10:12 PM)Acies Wrote: I have described sticky-areas in this thread ---> http://www.frictionalgames.com/forum/thread-7823.html. Feel free to add that. I hope that it is correct though Angel

Very interesting =) Thank you ^_^

You may notice my time logged in and the number of new videos will decrease over the next few weeks, this is because my exams are one week away and after them i am going on holiday with my girlfriend, I won't be able to spend much time on here during the next few weeks but i hope the tutorials i have made will keep you going until my return =)

Yours Sincerely,
Edd,
05-05-2011, 11:03 PM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#70
RE: Video Tutorials [OMG ELEVEN!!!!]

I hope you get that lever tutorial in! Tongue

05-05-2011, 11:10 PM
Find




Users browsing this thread: 1 Guest(s)