Offline documents and videos and notification on new documents,tutorials and videos

Door Tutorial

Door Tutorial

Postby CreativeOcclusion » 28 Dec 2015, 23:28

This is my first tutorial ever...This is a tutorial on how to setup a door in SkyLine...I am not a very good tutorial maker...I just wanted to try making one to help out where I can...I never realized that I sound so much like a hillbilly...enjoy, and feedback is ok...There are a few things I can see ...like when I am talking when the door is opening and closing...Don't worry though, I was just rambling...
How to setup a door....
Last edited by CreativeOcclusion on 30 Dec 2015, 21:05, edited 1 time in total.
Thanks, CreativeOcclusion
User avatar
CreativeOcclusion
Skyline Warrior
 
Posts: 366
Joined: 22 Jun 2015, 19:34
Location: Texas

Re: Door Tutorial

Postby SolarPortal » 30 Dec 2015, 16:10

Thanks CreativeOcclusion, but the video is private, so it is unviewable. Try setting it to public :)
Skyline Game Engine - Lead Dev.
Please provide as much info as possible when asking for help.


Specs: OS: Win 10 64bit, CPU: Intel i7 4770 3.4ghz x 4 core(8 threads), GPU: Nvidia GTX 1060 6GB, Ram: 16gig DDR3, Windows on 250gb Samsung Evo 860

Twitter: @SolarPortal
Instagram: @SolarPortal
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: Door Tutorial

Postby CreativeOcclusion » 30 Dec 2015, 19:22

Sorry about that...It should be set to public...I thought I had the settings setup to make it public automatic...Thanks...
Thanks, CreativeOcclusion
User avatar
CreativeOcclusion
Skyline Warrior
 
Posts: 366
Joined: 22 Jun 2015, 19:34
Location: Texas

Re: Door Tutorial

Postby CreativeOcclusion » 31 Dec 2015, 08:55

Let me know if it is viewable now...
Thanks, CreativeOcclusion
User avatar
CreativeOcclusion
Skyline Warrior
 
Posts: 366
Joined: 22 Jun 2015, 19:34
Location: Texas

Re: Door Tutorial

Postby SolarPortal » 31 Dec 2015, 15:01

Yes, it is viewable and its pretty good. :) Its very comprehensive and great to see scripting in a tutorial :D
Great Work! :D

What you said at the end gave us a great smile and really appreciate it.
Skyline Game Engine - Lead Dev.
Please provide as much info as possible when asking for help.


Specs: OS: Win 10 64bit, CPU: Intel i7 4770 3.4ghz x 4 core(8 threads), GPU: Nvidia GTX 1060 6GB, Ram: 16gig DDR3, Windows on 250gb Samsung Evo 860

Twitter: @SolarPortal
Instagram: @SolarPortal
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: Door Tutorial

Postby StarFire » 31 Dec 2015, 16:49

Great to see your first tutorial well made and concise with a good pace especially for your first, hopefully first of many ;)

As SP said we did have a big smile from what you said towards the end of the video, nice to hear thank you :D
Dream the Journey, Live the Experience!
User avatar
StarFire
Skyline Founder
Skyline Founder
 
Posts: 1678
Joined: 03 Jan 2012, 18:50
Location: UK
Skill: Great creative
Skill: Programmer
Skill: 3D Modeller
Skill: 2D Artist
Skill: Level Designer

Re: Door Tutorial

Postby CreativeOcclusion » 31 Dec 2015, 19:08

Thanks for the kind words...I hope you both have a "Happy New Year", along with the entire SkyLine community...

Always feel free to give definite feedback if there is anything I can change for the better...Thanks
Thanks, CreativeOcclusion
User avatar
CreativeOcclusion
Skyline Warrior
 
Posts: 366
Joined: 22 Jun 2015, 19:34
Location: Texas

Re: Door Tutorial

Postby SolarPortal » 01 Jan 2016, 14:07

Happy new year to you too! :D
Skyline Game Engine - Lead Dev.
Please provide as much info as possible when asking for help.


Specs: OS: Win 10 64bit, CPU: Intel i7 4770 3.4ghz x 4 core(8 threads), GPU: Nvidia GTX 1060 6GB, Ram: 16gig DDR3, Windows on 250gb Samsung Evo 860

Twitter: @SolarPortal
Instagram: @SolarPortal
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: Door Tutorial

Postby Ryder » 24 Feb 2016, 07:57

Hi Mr. Occlusion,

Enjoyed your first tutorial!

SO... I tried to follow it best I could, and in the end, I didn't have a working door...

It's probably me :)



First, I see in the script where the sound file is indicated... and i found a sound file I liked too... but what was not covered was how to properly get the sound file INTO the asset manager (I think I managed this...)... but beyond that, how to get the sound into the scene...

I just put the wav file in a new sub directory in "sounds".
The error message is that the sound file does not exist.

It also had an interesting error: "Sound file bling.ogg does not exist". I never even tried to reference such a file, so that leaves me confused. Perhaps bling is some kind of default sound?


But I had other problems... The trigger never worked.

I know the physics is at least partially right (the gun "hits" the door). The "Door open trigger demo" message showed up in the console, so I know the script is running....

Here are some error messages in the console:
"LUA ERROR: entity.callFn(..) failed. missing arg2 Target ID is invalid"

LUA ERROR: Tag name [ HUD ] not found or it is invalid, have you used the correct tag name? Does the tagged object exist?
LUA ERROR: entity.callFn(..) failed. missing arg2 Target ID is invalid

I'm not able to understand this. I am suspecting that it is actually an error related to the use of the FPS kit. (who else would have a HUD? right?)

some other errors:
"failed to load the Particle universe resource:mp2_explosion_26.pu
failed to load the Particle universe resource:mp_bullettrail_05_large_b.pu"

I suspect this has to do with the weapon in the kit? I don't know what else might be using particles.

Anyway, I guess the REAL issue is now to debug SkyLine projects.

Thanks to you, and anyone else willing to help this noob :)

Ryder
"A scale model is never done. You just stop working on it."
User avatar
Ryder
Skyline Apprentice
 
Posts: 35
Joined: 21 Feb 2016, 20:35
Skill: 3D Modeller
Skill: Scripter
Skill: Animator
Skill: Great creative

Re: Door Tutorial

Postby CreativeOcclusion » 24 Feb 2016, 09:59

I get all of these errors in the working version also...I believe that these are within the engine itself and I do not have access to the c++ code to try to fix them...I'm sure that the development team will work on this when they are caught up with the more important things they are working on now...

There could be many numbers of reasons why the trigger will not work...most of the time it is something simple...like...misspelled variables...the Door Tag not named properly...When you select the trigger..in Properties to the right under PTV Trigger Events...PTV On Enter and PTV On Leave need to be checked...I will post the code here so you can compare it with what you have..As for the sounds..I place mine in...C:\Aurasoft UK\Asset Library\Sounds\MySounds...I created the MySounds folder to keep my sounds seperate, but you could put the anywhere in the sounds folder...Here is the code from the tutorial...Let me know if you are still having problems...We will figure it out...

Code: Select all
--My Door Trigger Script------------------------

obj = 0 -- | Define a variable for our object ID
moveDoor = false;
direction = 1.2;
y=0;

function onInit(objID)
   sky.lprint("\nLUA: Door Open Trigger Demo: ACTIVATED");
   doorID = entity.getEntityIDFromTag("Door_7");
   bodyID = physics.getBodyID(doorID);
   
   --Sound for door opening and closing...---
   sound.setLooped( 0 );
    sound.setVolume( .5 );
    sound.setSoundFile( "electronicdoor.wav" );
    sound.setIsStreamed( 0 );
    sound_ID = sound.create2DSound();
end

function onUpdate(timeDelta)
   if(moveDoor)then
      x,y,z = entity.getPosition( doorID );
      y=y+(direction)*timeDelta;
      if(y>4)then moveDoor = false;y=4;end
      if(y<1.4)then moveDoor = false;y=1.4;end      
      entity.setPosition( doorID, x, y, z );
      physics.setPosition(bodyID, entity.getWorldPosition(doorID));
   end
end


function onTrigger_Enter(hitID)
   objectHit = entity.getEntityName(hitID);
   sky.lprint("LUA: Trigger Event: ENTER!  Object Hit= "..objectHit);
   direction = 0.9;
   sound.play2DSound( sound_ID );
   moveDoor = true;
end

function onTrigger_Leave(hitID)
   objectHit = entity.getEntityName(hitID);
   sky.lprint("LUA: Trigger Event: Exit!  Object Hit= "..objectHit);
   direction = -0.9;
   sound.play2DSound( sound_ID );
   moveDoor = true;
end
Thanks, CreativeOcclusion
User avatar
CreativeOcclusion
Skyline Warrior
 
Posts: 366
Joined: 22 Jun 2015, 19:34
Location: Texas

Re: Door Tutorial

Postby SolarPortal » 24 Feb 2016, 12:19

Some of those errors do look like the FPS weapon. These don't break the game though but to remove the HUD ones, then add the hud from the RMB+ context menu in the scene under Dynamic Objects.

Then most of the errors will go.
The particle errors are due to particle universe and sometimes cause a problem.
It also had an interesting error: "Sound file bling.ogg does not exist". I never even tried to reference such a file, so that leaves me confused. Perhaps bling is some kind of default sound?

This is the default sound the engine falls back to if it cannot find the sound in resources.

To add to resources, go to asset manager > navigate to the folder > in the explorer list Right click and go to Resource Management > Add folder to resources. Sometimes clicking on the actual folder will offer to add the resources for you.

Note: Any assets you use in the game must be added to the resources already. If they are not, then this can cause errors when playing sounds for example.
Skyline Game Engine - Lead Dev.
Please provide as much info as possible when asking for help.


Specs: OS: Win 10 64bit, CPU: Intel i7 4770 3.4ghz x 4 core(8 threads), GPU: Nvidia GTX 1060 6GB, Ram: 16gig DDR3, Windows on 250gb Samsung Evo 860

Twitter: @SolarPortal
Instagram: @SolarPortal
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: Door Tutorial

Postby CreativeOcclusion » 24 Feb 2016, 17:47

To add to resources, go to asset manager > navigate to the folder > in the explorer list Right click and go to Resource Management > Add folder to resources. Sometimes clicking on the actual folder will offer to add the resources for you.


Thanks for adding this SP...I forget to add the basic things in sometimes...I do wonder about the trigger not working, It should work....Maybe with the resources and the code above, everything will work....
Thanks, CreativeOcclusion
User avatar
CreativeOcclusion
Skyline Warrior
 
Posts: 366
Joined: 22 Jun 2015, 19:34
Location: Texas

Re: Door Tutorial

Postby SolarPortal » 24 Feb 2016, 18:29

I believe this should work to as you are using it in your level. I think it will be solvable now :)
If not, then i can also help take a look.
Skyline Game Engine - Lead Dev.
Please provide as much info as possible when asking for help.


Specs: OS: Win 10 64bit, CPU: Intel i7 4770 3.4ghz x 4 core(8 threads), GPU: Nvidia GTX 1060 6GB, Ram: 16gig DDR3, Windows on 250gb Samsung Evo 860

Twitter: @SolarPortal
Instagram: @SolarPortal
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: Door Tutorial

Postby Ryder » 25 Feb 2016, 05:50

Thanks everyone...

So I think I can narrow the scope of the issues down a bit:

#1 - Even though my .wav file is in the asset manager, I still get an error message saying that it's not found. But is just being in the asset manager enough? It's not enough for textures... why would it be enough for sounds?

#2 - Trigger function not performing the move. We know the function has been initialized, and that the physics has kicked in (because I can shoot the door).

Here is the code:
Code: Select all
-- My Door Trigger Script------

obj = 0 -- | Define a variable for our object ID
moveDoor = false;
direction = 1.2;
y=0;

function onInit(objID)
   sky.lprint("\nLUA: Door Open Trigger Demo: ACTIVATED");
   doorID = entity.getEntityIDFromTag("Door_1");
   bodyID = physics.getBodyID(doorID);
   
   --Sound for door opening and closing... ---
   sound.setLooped( 0 );
   sound.setVolume( .5);
   sound.setSoundFile( "LargeBlowerMotor.wav");
   sound.setIsStreamed( 0 );
   sound_ID = sound.create2DSound();
end

function onUpdate(timeDelta)  -- Update is run once every game cycle
   if (moveDoor) then
      x,y,z = entity.getPosition( doorID );
      y=y+ (direction) *timeDelta;
      if(y>4) then moveDoor = false;y=4;end
      if(y<1.4) then moveDoor = false;y=1.4;end
      entity.setPosition( doorID, x, y, z );
      physics.setPosition(bodyID, entity.getWorldPosition(doorID));
   end
end

function onTrigger_Enter(hitID)
   objectHit = entity.getEntitiyName(hitID);
   sky.lprint("LUA: Trigger Event: ENTER!  Object Hit = "..objectHit);
   direction = 0.9;
   sound.play2DSound( sound_ID );
   moveDoor = true;
end

function onTrigger_Leave(hitID)
   objectHit = entity.getEntitiyName(hitID);
   sky.lprint("LUA: Trigger Event: Exit!  Object Hit = "..objectHit);
   direction = -0.9;
   sound.play2DSound( sound_ID );
   moveDoor = true;
end



Notice that I call my door, "Door_1" (the tag matches), and I specify my sound file. (are file names case sensitive?)

Image

Thank you for your kind help.

Ryder
"A scale model is never done. You just stop working on it."
User avatar
Ryder
Skyline Apprentice
 
Posts: 35
Joined: 21 Feb 2016, 20:35
Skill: 3D Modeller
Skill: Scripter
Skill: Animator
Skill: Great creative

Re: Door Tutorial

Postby Ryder » 25 Feb 2016, 08:40

Update... FOUND IT!

OK, it is in on trigger enter and leave...

I typoed getEntityName.


So this leads to another issue/notion about the IDE... one that I am perhaps sadly used to (read: dependent on) in .net, which is when unrecognized objects/functions are detected... and also, case is enforced for functions (making it easy by typing all lower case... then watch it pop to the recognized case when the line is entered.

I guess I just didn't get how handy all of those behaviors in the .net IDE really are!

Ex: I type getentityname(hitID);
and on carriage return, the IDE re-cases it thus: getEntityName(hitID);

Seeing those caps pop up tells you it's legit!

That would be a WONDERFUL feature, and I'll bet would save many, many hours of debugging for users. (and requests for help on forums :)

But thank you Mr. Occlusion, for the code drop... once that worked, it was just a matter of replacing it with my functions until it broke again :)

Ryder
"A scale model is never done. You just stop working on it."
User avatar
Ryder
Skyline Apprentice
 
Posts: 35
Joined: 21 Feb 2016, 20:35
Skill: 3D Modeller
Skill: Scripter
Skill: Animator
Skill: Great creative

Re: Door Tutorial

Postby CreativeOcclusion » 25 Feb 2016, 09:03

But thank you Mr. Occlusion, for the code drop... once that worked, it was just a matter of replacing it with my functions until it broke again

Well at least you had it working for a minute or two...I agree that the IDE needs some tender loving care...I'm sure that the devs know this...It will all get fixed, but there is so much to do and not enough time in the day to fix it all at once...Just hang in there...They mark down every issue that we bring up and will get it fixed...

I typoed getEntityName.

I have done this so many times...It is good that you are able to see these type of mistakes...This is a sign of a good programmer...I break my game sometimes twice a day...I am getting better at fixing it every time...Practice makes perfect...So they say... :roll:
Have a great day and feel free to come to the forums for help...I will add you to my friends list if that is acceptable to you...
Thanks, CreativeOcclusion
User avatar
CreativeOcclusion
Skyline Warrior
 
Posts: 366
Joined: 22 Jun 2015, 19:34
Location: Texas

Re: Door Tutorial

Postby Ryder » 25 Feb 2016, 09:30

Friends list, check...

Does this come with any particular benefits? :)

And thanks again!

-Ryder-
"A scale model is never done. You just stop working on it."
User avatar
Ryder
Skyline Apprentice
 
Posts: 35
Joined: 21 Feb 2016, 20:35
Skill: 3D Modeller
Skill: Scripter
Skill: Animator
Skill: Great creative

Re: Door Tutorial

Postby CreativeOcclusion » 25 Feb 2016, 09:42

Does this come with any particular benefits? :)

Nope...Just friends... :D
Thanks, CreativeOcclusion
User avatar
CreativeOcclusion
Skyline Warrior
 
Posts: 366
Joined: 22 Jun 2015, 19:34
Location: Texas

Re: Door Tutorial

Postby Ryder » 25 Feb 2016, 09:51

Oh crap, I just realized that it sounded like was asking about friends with benefits... >_< doh!

(slaps forehead)

It's late... turning in.

Thanks, Tex!

R
"A scale model is never done. You just stop working on it."
User avatar
Ryder
Skyline Apprentice
 
Posts: 35
Joined: 21 Feb 2016, 20:35
Skill: 3D Modeller
Skill: Scripter
Skill: Animator
Skill: Great creative

Re: Door Tutorial

Postby CreativeOcclusion » 25 Feb 2016, 10:03

Oh crap, I just realized that it sounded like was asking about friends with benefits... >_< doh!

LoL....That's freakin' funny :lol: ...I will stick with..."None of that for me..."...Still funny though.... :lol:
Thanks, CreativeOcclusion
User avatar
CreativeOcclusion
Skyline Warrior
 
Posts: 366
Joined: 22 Jun 2015, 19:34
Location: Texas

Re: Door Tutorial

Postby SolarPortal » 25 Feb 2016, 14:45

HAHA lol :D Very funny morning read this was lmao :D

Anyway, good job for getting it working :)
Skyline Game Engine - Lead Dev.
Please provide as much info as possible when asking for help.


Specs: OS: Win 10 64bit, CPU: Intel i7 4770 3.4ghz x 4 core(8 threads), GPU: Nvidia GTX 1060 6GB, Ram: 16gig DDR3, Windows on 250gb Samsung Evo 860

Twitter: @SolarPortal
Instagram: @SolarPortal
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: Door Tutorial

Postby StarFire » 25 Feb 2016, 15:36

lmao :lol:
We said we were a friendly community but... !!! :shock:

Awesome, just got to love the humour :D
Dream the Journey, Live the Experience!
User avatar
StarFire
Skyline Founder
Skyline Founder
 
Posts: 1678
Joined: 03 Jan 2012, 18:50
Location: UK
Skill: Great creative
Skill: Programmer
Skill: 3D Modeller
Skill: 2D Artist
Skill: Level Designer

Re: Door Tutorial

Postby CreativeOcclusion » 02 Mar 2016, 20:34

Ryder wrote:Thanks everyone...

So I think I can narrow the scope of the issues down a bit:

#1 - Even though my .wav file is in the asset manager, I still get an error message saying that it's not found. But is just being in the asset manager enough? It's not enough for textures... why would it be enough for sounds?

#2 - Trigger function not performing the move. We know the function has been initialized, and that the physics has kicked in (because I can shoot the door).

Here is the code:
Code: Select all
-- My Door Trigger Script------

obj = 0 -- | Define a variable for our object ID
moveDoor = false;
direction = 1.2;
y=0;

function onInit(objID)
   sky.lprint("\nLUA: Door Open Trigger Demo: ACTIVATED");
   doorID = entity.getEntityIDFromTag("Door_1");
   bodyID = physics.getBodyID(doorID);
   
   --Sound for door opening and closing... ---
   sound.setLooped( 0 );
   sound.setVolume( .5);
   sound.setSoundFile( "LargeBlowerMotor.wav");
   sound.setIsStreamed( 0 );
   sound_ID = sound.create2DSound();
end

function onUpdate(timeDelta)  -- Update is run once every game cycle
   if (moveDoor) then
      x,y,z = entity.getPosition( doorID );
      y=y+ (direction) *timeDelta;
      if(y>4) then moveDoor = false;y=4;end
      if(y<1.4) then moveDoor = false;y=1.4;end
      entity.setPosition( doorID, x, y, z );
      physics.setPosition(bodyID, entity.getWorldPosition(doorID));
   end
end

function onTrigger_Enter(hitID)
   objectHit = entity.getEntitiyName(hitID);
   sky.lprint("LUA: Trigger Event: ENTER!  Object Hit = "..objectHit);
   direction = 0.9;
   sound.play2DSound( sound_ID );
   moveDoor = true;
end

function onTrigger_Leave(hitID)
   objectHit = entity.getEntitiyName(hitID);
   sky.lprint("LUA: Trigger Event: Exit!  Object Hit = "..objectHit);
   direction = -0.9;
   sound.play2DSound( sound_ID );
   moveDoor = true;
end



Notice that I call my door, "Door_1" (the tag matches), and I specify my sound file. (are file names case sensitive?)

Image

Thank you for your kind help.

Ryder


I just now noticed that in your pic, at the bottom...You added a "Micro Graph" instead of a "Micro Script"...I believe this is the cause of your difficulties...Sorry I did not see this sooner... :)
Thanks, CreativeOcclusion
User avatar
CreativeOcclusion
Skyline Warrior
 
Posts: 366
Joined: 22 Jun 2015, 19:34
Location: Texas

Re: Door Tutorial

Postby Ryder » 04 Mar 2016, 08:03

Hey, Tex... thanks so much for noticing that...

However, I believe that a microscript and micrograph should be able to share nicely... shouldn't they?

But as the actual problem was the typo on getEntityName (getEntitityName)... all is good!
"A scale model is never done. You just stop working on it."
User avatar
Ryder
Skyline Apprentice
 
Posts: 35
Joined: 21 Feb 2016, 20:35
Skill: 3D Modeller
Skill: Scripter
Skill: Animator
Skill: Great creative

Re: Door Tutorial

Postby CreativeOcclusion » 04 Mar 2016, 19:15

However, I believe that a microscript and micrograph should be able to share nicely... shouldn't they?

I was led to believe that the micrograph is to use the visual scripting nodes...I may be wrong...
Thanks, CreativeOcclusion
User avatar
CreativeOcclusion
Skyline Warrior
 
Posts: 366
Joined: 22 Jun 2015, 19:34
Location: Texas

Next

Return to Documents, Tutorials and Videos

Who is online

Users browsing this forum: No registered users and 2 guests