Skip to main content

150. Unity3d Tutorial - Setup From Scratch And Cleanup - Part 3

See video

We are going to continue with our little rpg style game created with the Unity 3 Game Engine.

In appreciation to the people that have purchased the scripts, I have decided to start a project from scratch to save them the nine or so hours of watching the tutorials to catch up. I am also going to be adding some little things to several scripts that I have been wanting to do for some time now.

So sit back, get a coffee, and get ready for a ride.

This was recorded off of the live stream at burgzergarcade.com

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Offline
Joined: Jun 3 2011

oh man, why did you use string for animation definition when you have AnimationClip?
public AnimationClip IdleAnimation;
public float IdleAnimationLayer=0;
public float IdleAnimationSpeed=1;
public WrapMode IdleAnimationWrapMode = WrapMode.Loop;
public AudioClip IdleSound;

-----> later on when you want to play animation :

if (IdleAnimation !=null)
{
animation[IdleAnimation.name].layer = IdleAnimationLayer;
animation[IdleAnimation.name].speed = IdleAnimationSpeed;
animation[IdleAnimation.name].wrapMode = IdleAnimationWrapMode;
animation.CrossFade(IdleAnimation.name, IdleAnimationFade);
}
if (IdleSound != null)
audio.PlayOneShot(IdleSound);
this way you give developers all flexibility possible, and instead of writing animation names you simply drag and drop them so why not?

Petey's picture
Offline
Joined: Feb 3 2010

This has been talked about in the live chat a few times. I am doing this off the top of my head on the fly. SInce I had the Animation component already attached, I just referenced the animation by calling it by name. You can also use the animation clip if you want.

It will be updated when we revisit it.

Offline
Joined: Jun 3 2011

Hi petey,
just like yourself I was thinking on the fly to, the better solution would be to create public void that receives all the animation information and do the job there this way you can cut bunch of coding lines in game and have single line for all the stuff in each main animation method.
and I have 1 question and 1 request, first the question
WHY I CAN:T USE THE LIVE SECTION, IT's NOT STREAMING ONLINE, and when i try the main server that you use, it shows 2-3 videos of you testing the streaming and that's all !

and now the request, can you integrate a shopping system with gui and etc to the game? as much as i can tell, it needs a new Item class for money with three types (Gold, Silver, and Bronze), and a key in playerPrefs for the amount of money the player will have. but doing the main shop for buying, selling, and generating Items is out of my mind (well, not the generation part, after all you have an Item generator in scripts.)

and one more question, as much as I payed attention, you don't use Charisma in calculating vitals or skills at all, so what is it's use? is it there to be checked for unlocking some game aspects or make doing things possible for character or did you forgot that to add it to system?

thanks

Petey's picture
Offline
Joined: Feb 3 2010

Charisma is a stat that I plan to use later for some of my skills. You do not need to have all of the same stats that I do. That is why we made them enumerations.

I will be adding an NPC to sell and buy basic things from later on.

The chat should always be up, but the video stream may be down as I am doing something that I do not want to stream.