Frictional Games Forum (read-only)
Video Tutorials [OMG ELEVEN!!!!] - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Articles (https://www.frictionalgames.com/forum/forum-40.html)
+---- Thread: Video Tutorials [OMG ELEVEN!!!!] (/thread-7608.html)

Pages: 1 2 3 4 5 6 7 8 9


RE: Video Tutorials [OMG ELEVEN!!!!] - Simpanra - 05-04-2011

(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?


RE: Video Tutorials [OMG ELEVEN!!!!] - MrBigzy - 05-04-2011

(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).


RE: Video Tutorials [OMG ELEVEN!!!!] - Kyle - 05-04-2011

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.


RE: Video Tutorials [OMG ELEVEN!!!!] - Simpanra - 05-04-2011

(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 =)


RE: Video Tutorials [OMG ELEVEN!!!!] - Kyle - 05-04-2011

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


RE: Video Tutorials [OMG ELEVEN!!!!] - Exostalker - 05-04-2011

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


RE: Video Tutorials [OMG ELEVEN!!!!] - Simpanra - 05-04-2011

(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 ^_^


RE: Video Tutorials [OMG ELEVEN!!!!] - Acies - 05-05-2011

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


RE: Video Tutorials [OMG ELEVEN!!!!] - Simpanra - 05-05-2011

(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,


RE: Video Tutorials [OMG ELEVEN!!!!] - Kyle - 05-05-2011

I hope you get that lever tutorial in! Tongue