Search Unity

[Released] Full Game Kit - Hammer 2

Discussion in 'Assets and Asset Store' started by PieterAlbers, Sep 8, 2015.

  1. superdiederik

    superdiederik

    Joined:
    Apr 25, 2012
    Posts:
    27
    Hi zenGarden,

    Not sure if the xbox 360 controller has full unity support for the webplayer. We'll look into this.
    You may send some a mail to support at xformgames.com about this.
    We would need to know the exact type of controller, OS version, browserversion and webplayer version.

    Again, this might be beyond our control. Is it working for you in a standalone player?

    Diederik / Xform
     
  2. Goofy420

    Goofy420

    Joined:
    Apr 27, 2013
    Posts:
    248
    Great looking kit. Although I've only used it for less than an hour, I can't see where the localization is coming from. I replaced the localization, yet it remains the same. Even removing all localization's from the Startup script has no effect either way. The original localization still loads. Is it cached in PlayerPrefs? If I delete the original localization US English, then I see a change; Errors that localization file hasn't been loaded and everything is blank understandably since no localization is loaded.
     
    Last edited: Nov 12, 2015
  3. Goofy420

    Goofy420

    Joined:
    Apr 27, 2013
    Posts:
    248
    Okay, I found it. In order to use a named localization file other than Xform or AssetStore Languages.cs needs to be edited since it's a static class.

    Is it possible to make Init a protected class instead of static and call the default localization like string selectedLanguage = GameObject.Find("StartUp").GetComponent<StartUpCode>().localizationTextAssets[0].name; and do away with the switching method altogether? It would be much more user friendly.

    Edit: I changed Languages.cs to
    Code (CSharp):
    1.  
    2. public static void Init()
    3.   {
    4.   Debug.Log("[Languages] Init called.");
    5.   Debug.Log("[Languages] Branding is: " + Data.branding);
    6.  
    7.   string selectedLanguage = GameObject.Find("StartUp").GetComponent<StartUpCode>().localizationTextAssets[0].name;// "English (US)"; // The default language.
    8.   if (selectedLanguage == null)
    9.   {
    10.   Debug.LogWarning("[Languages] Unknown branding! Using language: English (US).");
    11.   selectedLanguage = "English (US)";
    12.  
    13.   }
    14.   XLocalization.language = selectedLanguage;
    15.   Debug.Log("[Languages] Language set to: " + XLocalization.language);
    16.   }
    17.  
    and it operates properly. I think that would be better that way any filename can be used for the default localization file.
     
    Last edited: Nov 12, 2015
  4. mroyusa

    mroyusa

    Joined:
    Jan 16, 2015
    Posts:
    55
    This is awesome, just bought it, cant seem to find where to change the hierarchy sorting alphabetical thing you talk about at the start of the documentation.
     
  5. Goofy420

    Goofy420

    Joined:
    Apr 27, 2013
    Posts:
    248
    It's disabled by default, but in Edit>>Preferences>>Enable Alphanumeric Sorting
     
    Raf_230 and mroyusa like this.
  6. Goofy420

    Goofy420

    Joined:
    Apr 27, 2013
    Posts:
    248
    I got it running on an older Samnsung Galaxy S3 at 87 drawcalls and 47k tris which is very good. The rule of thumb for anything older than five years is less than 120 drawcalls and less than 100k tris, anything modern; less than 240 drawcalls and less than 300k tris except for ipad which is 400 drawcalls and 1 million tris. Now all I need are all of these https://www.assetstore.unity3d.com/en/#!/publisher/14146/ and I'm ready to get started.

    I noticed a lot of complaints about it, so I figured out a formula.

    1. In Project Settings, DISABLE Static Batching. That's only good for objects close together, and this asset is a huge open world, but enable Dynamic Batching and use Forward Rendering obviously.

    2. In Edit>>Project Settings>>Quality DISABLE shadows, set Pixel Light Count to 1, Disable Soft Particles, Realtime Reflections and set Particle Raycast Buds to 48.

    3. Select all the Scene objects mesh renderers (roads, buildings, ground, misc, etc) and open Occlusion Culling, check Occluder Static and bake.

    This gives me 87 drawcalls and 47k tris maximum during a fight scene with no loss of quality.

    Replace all Mesh Colliders on the road with Box Colliders and that will drop tri count down another 8-10% but at this point it's not necessary.

    If you need to run it on an old phone, then bake all the Traffic and Units textures into a shared material using a third party tool or 3dsmax. That will drop it another 37 drawcalls. Anything could run it with 50 drawcalls. If you must have shadows then set distance to 20 and zero cascades and bake the lighting.

    Underdraw the fill rate to get even better performance and witness 57fps on your phone. 1280x720 instead of 1920x1080 could triple your framerate. i.e Screen.SetResolution(1280, 720, true); It won't look smaller, it'll just decrease the fill rate freeing up power for your cpu/gpu.

    4. Smoke a big fatty and thank the devs for being so generous with this kit. A lot of work went into it I can tell.

    Thanks devs, puff puff pass.
     
    Last edited: Nov 12, 2015
    Raf_230, superdiederik and mroyusa like this.
  7. superdiederik

    superdiederik

    Joined:
    Apr 25, 2012
    Posts:
    27
    Hi Goofy420,

    Thanks for your feedback and idea. Your proposal makes sense and would be simpler in most cases. For games we did in the past, for multiple sites/brandings, connecting the branding to a particular language made sense.
    If I would change it now, I would just create a new Language variable in Globals.txt + Data.cs so I could set it easier. I would even add it to the SaveList ;). It's still pretty annoying that the language files need to be referenced in the StartUp scene (to make it available in time ;).

    Thanks for your thoughts, we might change it in an update (not likely), or a future project (very likely).

    Diederik / Xform
     
  8. Goofy420

    Goofy420

    Joined:
    Apr 27, 2013
    Posts:
    248
    I have a problem when adding enemies. All animation events work except the rigidbody attaching when hit by a projectile greater than 1 strength and the hit and death animations are never called. I'm sure there's something in the scripts that require exact naming of bones, but I can't find it.
     
  9. Goofy420

    Goofy420

    Joined:
    Apr 27, 2013
    Posts:
    248
    nvm, I found it.
    GameObject bip = transform.GetChild(1).transform.gameObject;
    The SMR needs to be higher than the bones in the hierarchy. So
    Enemy_Prefab
    Mesh
    Bip001
    or it won't add the rigidbody and apply force so the dead enemy just stands there for 1.5 seconds until destroyed.
    Any plans on documentation down the road? If not, I might put something together when I have time.
     
    Last edited: Nov 15, 2015
  10. Goofy420

    Goofy420

    Joined:
    Apr 27, 2013
    Posts:
    248
    You can do this in the Destroy method of Weapon.cs to keep the player from popping into the air when dropping a weapon if anyone has that problem when adding custom weapons that are very large:
    Code (CSharp):
    1.  
    2.  BoxCollider col1 = weaponModel.GetComponent<BoxCollider>();
    3.  Collider[] col2 = GameObject.FindObjectsOfType<CharacterController>();
    4.  foreach (Collider cols in col2) Physics.IgnoreCollision(col1, cols);
    5.  
     
    Raf_230 likes this.
  11. pritam

    pritam

    Joined:
    Jun 28, 2014
    Posts:
    5
    Hi , I want to know if google play is still allowing more versions of the game to be put on playstore. I plan to do lot of reskining if the initial release gets few thousand downloads.
    And what about the copyright of current graphics and sound. Can we use them without altering?
     
  12. VuLuong

    VuLuong

    Joined:
    Nov 17, 2015
    Posts:
    3
    Hi,

    Thanks for the great project.

    I have 1 issue with the Web player is it keep redirecting to Unity store page. Is there a way to stop this, where is it in the code?

    Thanks,
     
  13. mroyusa

    mroyusa

    Joined:
    Jan 16, 2015
    Posts:
    55
    I have tweaked the game level a lot with new buildings, vehicles, 30 new missions. Problem is changing hammer into my own character is a nightmare, I will paypal anyone with a good tutorial to change the hammer character into my own character. 40$ for a working tutorial that will change the hammer character to the one specified in my game. I know how to change avatars and textures but the skeleton thing has me ripping my hair out, i tried changing the texture/material/avatar on the hammer prefab but he looks like a deformed alien when i try to apply my character to it, must be a bone issue or something, i don't know, but this is holding me back at the moment, i guess i will keep tweaking the game scene and wait for an awesome tutorial for changing hammer character.

    The character i will be using has 39 Animations with mechanim setup
    Idle, Walk, Run, Wave, Sitting, Wave, CheckWatch, WipeMouth, RunningJump, StandingJump, Falling, Death01, Death02, LeaningAgainstWall, Smoking, SexyDance, CrossArms, HandsOnHips, IdleCrossArms, IdleHandsOnHips, CrouchDown, CrouchIdle, CrouchUp, GrenadeThrow, Salute, HandgunShoot, HandgunReload, AutoSingleShot, AutoFullAutoShoot, AutoReload, SubMachineGun Single shot, SubMachineGunFullAutoShoot, SubMachineGunReload, ShotgunShoot, ShotgunReload, MiniGun shoot, MiniGun Idle, RifleShootReload and RPGShoot.

    So with the animations above and the machanim support on my asset, could someone please make a text,video or picture tutorial I will pay 40$ for it, i am desperate.

    One last thing, whats a good piece of freeware or software to make sprites?

    I think the hardest thing in building games is animation and character stuff.
     
  14. Goofy420

    Goofy420

    Joined:
    Apr 27, 2013
    Posts:
    248
    Change Weapon.cs to:
    Code (CSharp):
    1.  // get hand holding gun (sorry for the exceptions)
    2.         string stringHand = characterData.prefab + " R Hand";
    3.         if (characterData.prefab == "EnemyJuggernaut" || characterData.prefab == "EnemyBigBoss") stringHand = characterData.prefab + " L Hand";
    4.         else if (characterData.prefab == "Hammer" || characterData.prefab == "EnemySuit") stringHand = "Bip001 R Hand";
    where "Bip001" is the bone name of your character and enemy.

    Change Hammer.cs to:
    Code (CSharp):
    1.  if (characterData.prefab == "Hammer") spine = GenericFunctionsScript.FindChild(gameObject, "Bip001 Spine1");
    2.         else spine = GenericFunctionsScript.FindChild(gameObject, type + " Spine1");
    where "Bip001" is the bone name of your character

    Change Enemy.cs to:
    Code (CSharp):
    1.  spine = GenericFunctionsScript.FindChild(gameObject, type + " Spine1");
    2.         if (characterData.prefab == "EnemySuit") spine = GenericFunctionsScript.FindChild(gameObject, "Bip001 Spine1");
    where "Bip001" is the bone name of your enemy

    Add the HammerFootsteps to the Bip root of your player and enemies, and add the WeaponDummy to the enemies "Bip001 R Hand" where "Bip001 R Hand" is the right hand of your enemies.

    Keep your player prefab named Hammer_Prefab and enemies EnemySuit_Prefab etc.
    Do the same for adding new characters, say EnemyPolitician_Prefab

    I just used Photoshop to make the sprites. Put the characters, etc in a scene with a white background and get the camera angle right then print screen and trim it in PS. Then use Unity Sprite Packer on them when it's done.
     
    Last edited: Nov 17, 2015
    udede and Raf_230 like this.
  15. mroyusa

    mroyusa

    Joined:
    Jan 16, 2015
    Posts:
    55
    This is what i got from my asset i want to use from the dev

    //Gun Animation usage
    To animate the guns you will need to set mechanim parameters in the character Animator and enable the correct gun mesh under the right hand jnt

    Weapon mesh location -
    /SimpleMilitary_SpecialForces04_White
    /SimpleMilitary_Characters
    /Root_jnt
    /Hips_jnt
    /Body_jnt
    /Spine_jnt
    /UpperArm_Right_jnt
    /LowerArm_Right_jnt
    /Hand_Right_jnt
    /SimpleMilitary_Weapons
    Weapon_AssultRifle01
    Weapon_AssultRifle02
    Weapon_FlashBang
    Weapon_Grenade
    Weapon_Minigun
    Weapon_Pistol
    Weapon_Rifle
    Weapon_RPG
    Weapon_Shotgun
    Weapon_SmokeBomb
    Weapon_SniperRifle
    Weapon_SubMachineGun

    //Mechanim parameters

    Shoot_b - Activates shoot

    FullAuto_b - Enables full auto if avaliable (AssultRiffle01,02 and subMachineGun)

    Reload_b - Reloads the current gun

    Jump_b - will make the character jump

    Death_b - will kill the character

    DeathType_int - Will select the type of death animation
    1 = Back death
    2 = Front death

    Static_b - Will turn root motion on and off

    Grounded_b - will play a falling animation when not grounded


    Animation_int - selects an idle animation to play
    0 = normal idle
    1 = Crossed Arms
    2 = HandsOnHips
    3 = Check Watch
    4 = Sexy Dance
    5 = Smoking
    6 = Salute
    7 = Wipe Mount
    8 = Leaning against wall
    9 = Sitting on Ground

    WeaponType_int - Sets the type of weapon animation to play
    0 = No weapon
    1 = Pistol
    2 = AssultRifle01
    3 = AssultRifle02
    4 = Shotgun
    5 = SniperRifle
    6 = Rifle
    7 = SubMachineGun
    8 = RPG
    9 = MiniGun
    10 = Grenades

    Head_Horizontal_f and Head_Vertical_f - Control the head direction

    Each weapon animation will require a new Body_Horizontal_f and Body_Vertical_f value for Idle, Walk and Run

    No weapon Idle = 0 , 0
    No weapon Walk = 0 , 0
    No weapon Run = 0 , 0

    Pistol Idle = 0 , 0
    Pistol Walk = 0 , 0
    Pistol Run = 0 , 0.2

    Grenades Idle = 0 , 0
    (set speed to 0 when throwing a grenade)

    All other weapons Idle = 0 , 0.6
    All other weapons Walk = 0 , 0.6
    All other weapons Run = 0.3 , 0.6
     
    Raf_230 likes this.
  16. Goofy420

    Goofy420

    Joined:
    Apr 27, 2013
    Posts:
    248
    Those are all parameters that are set within the animator controller. Just duplicate the HammerController animator controller which has all the params set and add the new animations, double click the animation state and on the right side of the screen that opens up you can change the animation clip. Since most of this kit uses hard coded strings, changing names will probably break it, so use existing names like AK47 (idle) and AK47Fire (fire).
    On the left in the animator controller window, click WeaponLayer and then parameters. There are ints, bools, and floats controlled by the kit by default. When you have the AK47 and click fire, it sets the AK47Fire bool to true, that in turn enables the AK47Fire state, which has the HammerAK47Fire.anim animation attached. It doesn't matter what the animation file is named, but the state AK47Fire is being called from somewhere in the kit. I still can't find the weaponData sharedData Ammo myself. It seems to be populated from a parallel dimension as I don't see how to set the ammo in any of the code, which is okay when programming in qubits.
    The hard coded strings are whats causing most troubles so hopefully there will be an update where these hard coded strings are put into a central variable script easily accessible. Don't feel bad. I have degrees in the field and still scratch my head on the layout of the code.

    Also, make sure the body animations are on layer 0 and weapon animations are on layer 1
    Hard coded layers in weapon.cs animator.Play(0, 1, 0f); states that it will look on layer 1 for the weapon animations. Arrays start at 0, so 1 is actually the second layer.
     
    Last edited: Nov 18, 2015
    Raf_230 and hopeful like this.
  17. Goofy420

    Goofy420

    Joined:
    Apr 27, 2013
    Posts:
    248
    Open Globals.txt and change ClickLinks to false
     
    hopeful and VuLuong like this.
  18. superdiederik

    superdiederik

    Joined:
    Apr 25, 2012
    Posts:
    27
    Hi!

    We might add some more pointers/tutorials to the documentation. Please check: http://xform.nl/projects/AssetStore/Hammer2/Hammer2Documentation.pdf for future updates.

    Thanks for your enthusiasm!
     
    Raf_230 likes this.
  19. superdiederik

    superdiederik

    Joined:
    Apr 25, 2012
    Posts:
    27
    Hi pritam,

    We cannot say what google will or will not allow, you will have to check with them. I'm thinking that the less you change from the original version of the game, the smaller the chance that google will approve.
    As stated in the documentation, you have full commercial rights to everything inside the package.
    It also states that you cannot use the screenshots, videos and promotional texts that you come across online.

    A small sidenote though: we did not create this package so that people can spam the appstores with uninspired copies. We aim to inspire and help people make their own games.

    Good luck!

    Diederik / Xform
     
    Goofy420 likes this.
  20. superdiederik

    superdiederik

    Joined:
    Apr 25, 2012
    Posts:
    27
    Hi VuLong!

    This may have to do with the sitelock functionality. In Gobals.txt, the Branding variable is tied to Sitelock settings defined in the SharedData.txt.
    Alternatively, you could indeed set ClickLinks to false, but then other branding buttons will not work either.

    Good luck!

    Diederik / Xform
     
  21. VuLuong

    VuLuong

    Joined:
    Nov 17, 2015
    Posts:
    3
    Hi Diederik! Thanks for the quick reply. I have figured this out as you said and yes, thanks for the very organized code the problem was easily traced and fixed.

    Another issue I'm facing when building the Android build and running on real devices (Asus_T00F on Android 4.3, Samsung Note 3 Android 4.2) is the following:

    - I have already set the build target to Android in globals.txt as you suggested
    - My Android SDK minimum API level settings in Player Settings is 4.1 (Jelly Bean)

    Problem: The game keeps hanging after the 1st encounter (already stepped over the Ready line)

    Do you have any hints on the issue I face? May be the amount of newly spawned enemies or the wrong minimum API of SDK chosen?

    Thanks for your help!

    Best regards,
     
  22. mroyusa

    mroyusa

    Joined:
    Jan 16, 2015
    Posts:
    55
    @Goofy420 Do you use Teamviewer? I tried what you said but was getting full of errors. Willing to send you money on friday when i get paid.

    I followed the directions in the documentation to add new enemy, 75% working the new enemies spawn, texture is right, they just run towards me then sit there when they get close, then they look away lol, dumb ass terrorists.
     
  23. Goofy420

    Goofy420

    Joined:
    Apr 27, 2013
    Posts:
    248
    Money has no meaning to me, but thanks anyways.
    That sounds like they aren't receiving the unlimitedAmmo method of the weapon class or have no weapon. Do they shoot once? What are the error flags? Did you add the WeaponDummy and EnemySuitWeapon to his Bip R Hand bone and EnemySuitFootsteps to the Bip root, The enemies use a static weapon, not instantiated at runtime, so just drag the EnemySuit_Prefab into your scene, open up the bones to the EnemySuit R Hand and use that WeaponDummy GameObject, it's the Beretta 9mm. I just used the same enemy names EnemySuit EnemySwat, etc since it was easier, then just changed the bone names in Weapon.cs and Enemy.cs
    Enemy.cs
    Code (CSharp):
    1.  if (characterData.prefab == "EnemySuit") spine = GenericFunctionsScript.FindChild(gameObject, "Bip001 Spine1");
    Weapon.cs
    Code (CSharp):
    1.  if (characterData.prefab == "EnemySuit" || characterData.prefab == "Hammer") stringHand = "Bip001 R Hand";
    or whatever your Spine1 and R Hand bones are named.
     
    Last edited: Nov 18, 2015
    Raf_230 and hopeful like this.
  24. mroyusa

    mroyusa

    Joined:
    Jan 16, 2015
    Posts:
    55
    @Goofy420 On your response above #63 you wrote
    "

    change weapon.cs to
    1. // get hand holding gun (sorry for the exceptions)
    2. string stringHand = characterData.prefab + " R Hand";
    3. if (characterData.prefab == "EnemyJuggernaut" || characterData.prefab == "EnemyBigBoss") stringHand = characterData.prefab + " L Hand";
    4. else if (characterData.prefab == "Hammer" || characterData.prefab == "EnemySuit") stringHand = "Bip001 R Hand";

    1. Here is my original code
    // get hand holding gun (sorry for the exceptions)
    string stringHand = characterData.prefab + " R Hand";
    if (characterData.prefab == "EnemyJuggernaut" || characterData.prefab == "EnemyBigBoss") stringHand = characterData.prefab + " L Hand";
    GameObject tHand = GenericFunctionsScript.FindChild(parent, stringHand);

    So I should change it to this?

    // get hand holding gun (sorry for the exceptions)
    string stringHand = characterData.prefab + " R Hand";
    if (characterData.prefab == "EnemyJuggernaut" || characterData.prefab == "EnemyBigBoss") stringHand = characterData.prefab + " L Hand";
    else if (characterData.prefab == "Hammer" || characterData.prefab == "EnemySuit") stringHand = "Hand_Right_jnt R Hand";
    GameObject tHand = GenericFunctionsScript.FindChild(parent, stringHand);

    Do i change the whole "Bip001 R Hand" or just the "Bip001" and leave the R Hand after my "Hand_Right_jnt".

    Basicly what i am asking is should it be ,

    stringHand = "Hand_Right_jnt";
    or
    stringHand = "Hand_Right_jnt R Hand";
     
    Raf_230 likes this.
  25. mroyusa

    mroyusa

    Joined:
    Jan 16, 2015
    Posts:
    55
    These are the bones of the characters i am using

    /SimpleMilitary
    /SimpleMilitary_Characters
    /Root_jnt
    /Hips_jnt
    /Body_jnt
    /Spine_jnt
    /UpperArm_Right_jnt
    /LowerArm_Right_jnt
    /Hand_Right_jnt
     
  26. Goofy420

    Goofy420

    Joined:
    Apr 27, 2013
    Posts:
    248
    Change it to stringHand = "Hand_Right_jnt";
    and Enemy.cs to spine = GenericFunctionsScript.FindChild(gameObject, "Spine_jnt");
    Do the same with Hammer.cs if your player is the same model.

    I have Simple Zombies with the same rig. I'll check it out.
     
    Last edited: Nov 18, 2015
    mroyusa likes this.
  27. mroyusa

    mroyusa

    Joined:
    Jan 16, 2015
    Posts:
    55
    upload_2015-11-18_16-23-26.png


    When i try to change hammer on the left to look like my new character on the right this is what i get. All I did was change avatar and mesh/texture. What am i missing or what should i do to make it match the character on the right, Do I have to start from scratch? change bone settings somewhere? I am starting to hate character editing and tweaking, like i said before characters are a bitch. There has to be an easy way to make bones match or to make my hammer not look like a deformed alien.
     
    Raf_230 likes this.
  28. Goofy420

    Goofy420

    Joined:
    Apr 27, 2013
    Posts:
    248
    LOL... That's a better zombie than mine. I tested it here and it works
    Don't try changing the mesh of an existing prefab, that always causes trouble. Just rename the terrorist prefab and drag the WeaponDummy and EnemyFootsteps into it. Drag EnemyFootsteps as a child of Root_Int and WeaponDummy as a child of Hand_Right_Int
    Use the EnemySuitController and just replace the animations in the states with the new ones. AK47 AK47Fire are states, click them and you can replace the animations with yours.

    Edit: He has an attached weapon does he? Then in WeaponDummy/ EnemySuitWeapon just disable the mesh renderer or remove it and align the fireDummy with the characters attached weapon barrel.
     
    Last edited: Nov 18, 2015
  29. mroyusa

    mroyusa

    Joined:
    Jan 16, 2015
    Posts:
    55
    upload_2015-11-18_19-4-39.png


    Damn I am so close all you see is his legs and it looks like he is laying down lol gun is in the air at the right position though.
     
    Raf_230 likes this.
  30. mroyusa

    mroyusa

    Joined:
    Jan 16, 2015
    Posts:
    55
    Add the HammerFootsteps to the Bip root of your player and enemies, how do i do that?
     
  31. mroyusa

    mroyusa

    Joined:
    Jan 16, 2015
    Posts:
    55
    When i change the code in hammer.cs i get this error

    NullReferenceException: Object reference not set to an instance of an object
    Hammer.LateUpdate () (at Assets/Project Assets/Scripts/Game/Characters/User/Hammer.cs:338)
     
  32. mroyusa

    mroyusa

    Joined:
    Jan 16, 2015
    Posts:
    55
    no errors in enemy.cs so far so good
     
  33. mroyusa

    mroyusa

    Joined:
    Jan 16, 2015
    Posts:
    55
    Gonna give up for a little while on the enemy and hammer character, i will concentrate on changing everything else for now. I have a question about buildings, some crumble and some just turn dark, where is that setting per building to crumble or to not crumble. also i read somewhere that a mesh collider is bad on performance should i change all my buildings to box collider?
     
    Raf_230 likes this.
  34. Goofy420

    Goofy420

    Joined:
    Apr 27, 2013
    Posts:
    248
    Look in console and see where that error originates. There should be two or three lines, one at 338, and the others higher up like 223 and 128. What is line 338 in your script?
    I'm not using destructibles so I never looked into that, but in SharedData.txt under destructibles the buildings are referenced
    BuildingMidSpecialA5 [#health: 10000.0, #score: 10000, #impact: RicochetConcrete, #explosion: DefaultLarge, #lifetime: -1.0]

    Just add the name of your prefab as another one using the same formula and edit as necessary
     
  35. Goofy420

    Goofy420

    Joined:
    Apr 27, 2013
    Posts:
    248
    No, that's wrong
    Building [#health: 100.0, #score: 1000, #impact: RicochetConcrete, #explosion: DefaultLarge, #lifetime: -1.0]
    So any prefab that starts with Building will be destructible, and anything specific like the one I posted up there will be a special building, harder to destroy, easier to destroy, then Misc stuff like Antenna need to be added as well.
    Antenna [#health:100.0, #score: 10, #impact: RicochetMetal, #explosion: DefaultSmall, #lifetime: 2.0]
     
  36. Goofy420

    Goofy420

    Joined:
    Apr 27, 2013
    Posts:
    248
    I think #lifetime -1.0 will exist until it falls and 2.0 will stay on the screen for 2 seconds, but that's just an educated guess.
     
  37. Goofy420

    Goofy420

    Joined:
    Apr 27, 2013
    Posts:
    248
    MissionManager.cs
    Code (CSharp):
    1. DestructibleManager.AddDestructiblesFromChildren(GameObject.Find("Street"), "Dynamic", "Street"); // Go through all objects parented to Street. Get type from SharedData. If object has "Street" in name exclude, else revert to Default data.
    2.             DestructibleManager.AddDestructiblesFromChildren(GameObject.Find("Buildings"), "Building", "None", "DestructibleBuilding"); // Go through all objects parented to Buildings. All objects have Building data, unless specifically defined in SharedData.
    3.             DestructibleManager.AddDestructiblesFromChildren(GameObject.Find("Misc"), "Dynamic", "None", "Destructible", true); // We do this last!! because we're telling the destrucibles they can be reparent! So if we did this first we could run into issues as the system wants to initialize an existing destructible
    You'll need to be sure you keep these prefabs (Street, Buildings, and Misc) and make your custom objects children or you'll be pulling your hair out trying to understand why it's breaking, so for SimpleMilitary put all the buildings as children of Buildings and SimpleSteets as children of Street, and the other stuff as children of Misc.
     
    Last edited: Nov 19, 2015
    Raf_230 likes this.
  38. Goofy420

    Goofy420

    Joined:
    Apr 27, 2013
    Posts:
    248
    Okay, I just tested it. The custom Prefabs can be named anything for the default Building destructible setting, just add them as children of Buildings, and if you don't want destructible streets, just have an empty Prefab named Streets, and the same for Misc. And if you don't want destructible anything except pickups, then leave Buildings and Street prefabs empty and put the pickups in Misc. Either in your scene root or in the Mission prefab.
     
    hopeful likes this.
  39. TSSTUDIOS

    TSSTUDIOS

    Joined:
    Jun 10, 2013
    Posts:
    15
    is there a way to use editor input on android? im not interested in virtual analogs
     
  40. Goofy420

    Goofy420

    Joined:
    Apr 27, 2013
    Posts:
    248
    CrateWeapon [#prefab: CrateWeapon, #sound: DestructionMetal1, #range: 0.0, #shake: 5.0]
    This should cause no damage when shooting the crate, yes? It actually causes more damage than a vehicle explosion and much further away. How can this be fixed?

    Edit: In Shareddata you can lower the start end methods of "AreaDamage" "Small" but this lowers damage globally for default area damage, or you can edit Destructible.cs

    from:
    Code (CSharp):
    1. AreaDamageManager.AddAreaDamage("Small", gameObject.transform.position);
    to:
    Code (CSharp):
    1.  if (destructible != "CrateWeapon" && destructible != "CrateExplosive" && destructible != "CrateGadget")
    2. AreaDamageManager.AddAreaDamage("Small", gameObject.transform.position);
    This will make loot crates not cause area damage.
     
    Last edited: Nov 20, 2015
    hopeful likes this.
  41. mroyusa

    mroyusa

    Joined:
    Jan 16, 2015
    Posts:
    55
    I have added a helicopter to my scene, i just want it to rotate the rotor and take off straight up, i added the helicopter ai controller but not sure how to make it spin the rotor and take off.

    upload_2015-11-20_14-49-3.png
     
  42. Goofy420

    Goofy420

    Joined:
    Apr 27, 2013
    Posts:
    248
    [Tutorial] Adding a custom hero character
     

    Attached Files:

    udede, NeoUnity, Raf_230 and 2 others like this.
  43. mroyusa

    mroyusa

    Joined:
    Jan 16, 2015
    Posts:
    55
    Awesome tutorial, but i still get this when i run the game,

    NullReferenceException: Object reference not set to an instance of an object
    Hammer.LateUpdate () (at Assets/Project Assets/Scripts/Game/Characters/User/Hammer.cs:335)


    is it because i have not change the animations yet?
     
    Raf_230 likes this.
  44. Goofy420

    Goofy420

    Joined:
    Apr 27, 2013
    Posts:
    248
    My scripts get formatted when I open them. What does line 335 in your script reference?
    If it's spine.transform.Rotate(0, 0, cameraScript.mouseSettings.y); then you didn't add the string for the spine correctly.
    Code (CSharp):
    1. //--------------------------------------------------------------------------------
    2.         // other character related vars
    3.         //--------------------------------------------------------------------------------
    4. spine = GenericFunctionsScript.FindChild(gameObject, "Spine_int");
    5. spineSourceRotation = spine.transform.rotation;
     
    Last edited: Nov 20, 2015
  45. mroyusa

    mroyusa

    Joined:
    Jan 16, 2015
    Posts:
    55
    // rotate spine
    spine.transform.Rotate(0, 0, cameraScript.mouseSettings.y);
    }
     
  46. mroyusa

    mroyusa

    Joined:
    Jan 16, 2015
    Posts:
    55
    line 105 to 108

    spine = GenericFunctionsScript.FindChild(gameObject, type + " Spine1");
    if (characterData.prefab == "General") spine =
    GenericFunctionsScript.FindChild(gameObject, "Spine_jnt");
    spineSourceRotation = spine.transform.rotation;
     
  47. mroyusa

    mroyusa

    Joined:
    Jan 16, 2015
    Posts:
    55
    upload_2015-11-20_16-57-42.png
     
    Raf_230 likes this.
  48. mroyusa

    mroyusa

    Joined:
    Jan 16, 2015
    Posts:
    55
    @Goofy420 If I need to buy you the "simple military" from synty to test with one of those prefabs let me know its on special right now i think. I know you said it's not about the money but for me it's worth it.
     
    Raf_230 likes this.
  49. Goofy420

    Goofy420

    Joined:
    Apr 27, 2013
    Posts:
    248
    I have the Simple World and Simple Zombies. Only the Simple Zombies behave correctly. The rest of the characters hips are rotated 30 degrees which makes it look up and down when looking left and right and vice versa so I don't use them.
     
    Raf_230 likes this.
  50. Goofy420

    Goofy420

    Joined:
    Apr 27, 2013
    Posts:
    248
    Did you update Shareddata.txt and replace Hammer_Prefab with General_Prefab? If not, it's still trying to spawn the Hammer_Prefab. Ther error you're receiving means it can't find spine
     
    Raf_230 likes this.