Unity Ninja Unity 3D Forum
To have exclusive access to all downloads, recourses and links within this forum, a free registered account is required. Just a heads up Wink

You are not connected. Please login or register

Unity Ninja Unity 3D Forum » FREE Project Downloads & Recources » Scripts » Crafting System by Bryce Cain 25

Crafting System by Bryce Cain 25

View previous topic View next topic Go down  Message [Page 1 of 1]

1 Crafting System by Bryce Cain 25 on Fri Dec 05, 2014 8:14 pm

BryceCain25


SUPER MODERATOR
SUPER MODERATOR
Hey everyone!
a member by the name of FRAGSn111pezz needed some help on a crafting system...to I made one!
the script is commented on, so you should not run into any problems...
but if you do have questions please ask
the script came out with a parsing error but there appeared to be none when compiling the script in unity...
but if the same problems happen with you aswell..please pm me or write on this post...thank you...



PS: I know this code is very discrete in a way with the whole enabling and disabling of gameobjects but this will do
Code:
 #pragma strict
var craftedweaponone : GameObject;
var craftedweapontwo : GameObject;
var craftedweaponthree : GameObject;
//how ever much you wan't, whatever
var suppliesgather : int;
var ammounttogather : int;
function Start () {
craftedweaponone.enabled = false;
craftedweaontwo.enabled = false;
craftedweaponthree.enabled = false;
 //this just makes sure that you are not seeing all the weapons at once, more at one at a time

}

function Update () {
if(suppliesgather == ammounttogather) {
   var craftedweaponone.enabled = true;
   //you will see the weapon appear after enough supplies with the tag "supplies" are gathered
}
}



function OnTriggerEnter () {
   //for preperation add a collider with a trigger...make sure this is not
   //the player's collider, it will fall throught the terrain
   if(GameObject.tag == "supplies") {
      suppliescollect();
      //this just means that we are finding a gameobject with the tag "supplies" attached and making sure we increase the integer..
   }
}

function suppliescollect () {
suppliesgather++;
//this is adding on to the base 0 for the ammount of supplies gathered..

}

View user profile

2 Re: Crafting System by Bryce Cain 25 on Sun Dec 07, 2014 8:36 am

mottoman


Member [Lv. 3]
Member [Lv. 3]
i get this error

Assets/Crafting system.js(18,24): BCE0043: Unexpected token: ..

View user profile

3 Re: Crafting System by Bryce Cain 25 on Mon Dec 08, 2014 11:20 pm

BryceCain25


SUPER MODERATOR
SUPER MODERATOR
mottoman wrote: i get this error      

Assets/Crafting system.js(18,24): BCE0043: Unexpected token: ..
I'm going to look into this...in the mean time just sit back

View user profile

View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum