Search Unity

[Released] Full Game Kit - Hammer 2

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

  1. Goofy420

    Goofy420

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

    Attached Files:

    NeoUnity and Raf_230 like this.
  2. mroyusa

    mroyusa

    Joined:
    Jan 16, 2015
    Posts:
    55
    I followed your tutorial perfectly, i will try with a simple zombie character.
     
  3. Goofy420

    Goofy420

    Joined:
    Apr 27, 2013
    Posts:
    248
    The errors aren't model related. Which model are you using. I'll make the rig for you.
     
  4. mroyusa

    mroyusa

    Joined:
    Jan 16, 2015
    Posts:
    55
    simple_military_general_white is really what i want for the main character.
     
  5. mroyusa

    mroyusa

    Joined:
    Jan 16, 2015
    Posts:
    55
    @superdiederik I have installed the chartboost sdk, added campaigns to account but how do i turn the advertising feature on like the hammer demo on google play like the reward video or pause menu return ad or any other that might be in the game?

    I added the chartboost prefab to the starup scene, ads are still not working.

    Also when finishing a level between continue and quit button there is a submit button, what does that button do?
     
    Raf_230 likes this.
  6. Goofy420

    Goofy420

    Joined:
    Apr 27, 2013
    Posts:
    248
    The problem was incorrect naming of the rig.
    "Hand_Right_int" and "Spine_int" are actually "Hand_Right_jnt" and "Spine_jnt" with a "J", not "I".
    Still, the hips are rotated 30 degrees which is why I don't use these models, so his rotations will be poorly executed. Instead of using "Spine_jnt", the closest i could get was "Body_jnt" for the spine, but his Eulers are still off 30 degrees on X rotations.
    If you have Max, you can open the model and reset the transform in the Pivot modifier. Select the hip, click the Pivot tab, and down towards the bottom, select transform under reset transform/scale. Then on the toolbar right click the rotation icon, and set it to 90, 0, 0 for proper Unity exporting.
     
    Last edited: Nov 21, 2015
  7. mroyusa

    mroyusa

    Joined:
    Jan 16, 2015
    Posts:
    55
    When i did it i had jnt, so maybe the 30degree thing is what was messing up, i guess i will look for new characters and just use the other assets from synty and characters that just use the dialogue. Got to find a good bip character to match look of the game, do you have any experience getting the reward video to work?
     
  8. Goofy420

    Goofy420

    Joined:
    Apr 27, 2013
    Posts:
    248
    There's still something causing the Spine to not be found. If it's not improper rig names, then Shareddata.txt is missing something. When you run it in Editor, does the General_Prefab get instantiated into the scene? make sure you have halt on error checked in your console, and when it halts, look at General_Prefab at the very bottom of the Character.cs that is attached to the instantiated character and see if the Spine variable is blank. I'm pretty sure that's the problem.
    Make sure you keep him in the Resources/Characters/Hammer folder and you have the correct SharedData.txt applied in StartupScript in the Startup scene. He instantiates here without errors, so i dunno. I haven't messed with the reward videos yet; just finished the general Store and sprites, and now starting on the environment.
     
  9. mroyusa

    mroyusa

    Joined:
    Jan 16, 2015
    Posts:
    55
    I am trying to use the dialogue system but it needs a main camera tag on the main camera, where is it located so i can tag it?
     
  10. superdiederik

    superdiederik

    Joined:
    Apr 25, 2012
    Posts:
    27
    Hi! Not sure what you mean. From the top of my head, the regular input devices should also work when you're on the Android platform in the editor.

    Diederik
     
  11. superdiederik

    superdiederik

    Joined:
    Apr 25, 2012
    Posts:
    27
    Hi! Best to contact Pieter using support at xformgames with this question, since he did all our chartboost implementation!

    Diederik
     
    Raf_230 likes this.
  12. superdiederik

    superdiederik

    Joined:
    Apr 25, 2012
    Posts:
    27
    Hi!

    The camera is instantiated dynamically in the CameraManager. It uses a prefab located in the resources, so I'm guessing it will not be hard to add a tag there. Or maybe you can do it through scripting in the CameraManager. The reason why it's a prefab is because some posteffects we used were pretty hard to add and setup dynamically ;).

    Good luck and thanks everyone for all your effort and input!! It's much appreciated!

    Diederik / Xform
     
  13. unitywlp

    unitywlp

    Joined:
    Jan 3, 2014
    Posts:
    144
  14. unitywlp

    unitywlp

    Joined:
    Jan 3, 2014
    Posts:
    144
    also pls make update with ads to asset store
     
  15. mroyusa

    mroyusa

    Joined:
    Jan 16, 2015
    Posts:
    55
    I am moving along pretty good, i got a dialogue manager installed an working. Still cant change main character and enemies without messing everything up, but i got a lot of other stuff to do anyways. @goofy thank you very much for your tutorial I am sure it will help other people with their characters, too bad it will not work with my simple military characters.

    I will be posting more questions i am sure.
     
  16. Goofy420

    Goofy420

    Joined:
    Apr 27, 2013
    Posts:
    248
    I've finished this project and moved along to the next. I was making an editor extension to automatically change characters, but ran out of time, sorry; maybe after I finish this one.
     
  17. mroyusa

    mroyusa

    Joined:
    Jan 16, 2015
    Posts:
    55
    wow you move fast, i am changing game 85% of the look, added 60 characters for dialogues and side missions, i still have a ways to go. Right now trying to make the chartboost videos to work and reward videos.
     
  18. Goofy420

    Goofy420

    Joined:
    Apr 27, 2013
    Posts:
    248
    Chartboost is only one line of code added to Advertising.cs Chartboost.showRewardVideo(MAINMENU, true); in the showrewardVideo method or something similar then call Advertising.showrewardVideo(); on whatever class or method like when the user opens the shop or scoreboard . Since Chartboost is offline every time I go to the dashboard, I ended up using Unity Ads. It has reward videos too and it on it's way to being built into Unity itself. There's a forum on it with a lot of support and has already paid out millions of dollars since it's release. Crossy Road made over a million in a month using Unity Video Ads.

    Edit: I tried to get you the link to the chartboost api, but the sites down again...
     
  19. mroyusa

    mroyusa

    Joined:
    Jan 16, 2015
    Posts:
    55
    Do i have to change the advertisingsample.cs to advertising.cs?
     
  20. unitywlp

    unitywlp

    Joined:
    Jan 3, 2014
    Posts:
    144
    i am using unity ads seems it was simple i hate chartboost site it was so badly designed website i never seen such a design.
     
  21. CupitorImpossibilium

    CupitorImpossibilium

    Joined:
    Jul 23, 2012
    Posts:
    287
    me too!

    where did you put the sample code for unity ads
     
  22. unitywlp

    unitywlp

    Joined:
    Jan 3, 2014
    Posts:
    144
    in game data .cs you can add cash
     
  23. CupitorImpossibilium

    CupitorImpossibilium

    Joined:
    Jul 23, 2012
    Posts:
    287
    Thanks!

    I did put the sample code in gamedata.cs but don't see any ads in the game :( will check things later today when I have more time
     
  24. unitywlp

    unitywlp

    Joined:
    Jan 3, 2014
    Posts:
    144
    no it was not that easy you have to write custom method and call it
     
  25. UZUK

    UZUK

    Joined:
    Dec 5, 2015
    Posts:
    1
    Hi,
    I am trying to change the "smallprint" on the preloader section. But when i delete or change it, every restarting game it's coming back again.

    Could you help me about that?
     
  26. CupitorImpossibilium

    CupitorImpossibilium

    Joined:
    Jul 23, 2012
    Posts:
    287
    Did you change the text in the editor or in the .txt files? I had the same thing, I did change the text in the .txt files and now the smallprint stays the same.
     
  27. Gamengo

    Gamengo

    Joined:
    Dec 13, 2015
    Posts:
    1
    Can you help me
    Where can I put Ad admob ID?
     
  28. superdiederik

    superdiederik

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

    Most (or maybe all) texts in the game are retrieved from localization txt files located here: Game\Assets\Project Assets\Resources\Localization

    This is either done by attaching an XLocalize component to a text label or by using XLocalization.Get(key) in code. So if this is done, changing the text field itself has no effect (the text is only there as a placeholder to see how it looks). So for you, it might just be simpler to disable the XLocalize component and change the text in the text field.

    If not, you can edit language files directly, or create your own.

    IMPORTANT NOTE: if you create your own file, you need to add it to the StartUp scene (add it to the script there). Otherwise it will not be accessible in the loading screen. A bit unhandy I know.

    Oh yeah, you also need to set a new language as the current one in Languages.cs (located here: Game\Assets\Project Assets\Scripts\Game)

    Hope this points you in the right direction!

    Cheers!

    Diederik / Xform
     
  29. LoveTheVape

    LoveTheVape

    Joined:
    Nov 22, 2014
    Posts:
    86
    Love this asset, couldn't be happier. Thank you so much for releasing this! I have one request though, can anyone please help me get smooth camera follow working so I can make the camera smoothly follow Hammer Character and vehicles with a public delay. I'm also looking for a smooth follow script as I'm still learning about C#.

    I've included a pic of the DefaultCameraHQ prefab that I modified. I dragged the original DefaultCameraHQ into the hierarchy, made the OVR Cam prefab (Oculus Rift) a child of the DeafaultCameraHQ and ticked the Camera inside of DeafaultCameraHQ turning it off. I'm wondering if I can just place a SmoothFollow script directly inside of the CenterEyeAnchor telling it to follow Hammer & all vehicles?

    Also, I would like for Hammer & weaponized vehicles to be able to rotate on the Y axis without the camera following. I've been able to achieve this, but the bullet trajectory stays constant, so if Hammer is facing/pointing gun up in the air, instead of bullets shooting up, they shoot forward.

    Any help is much appreciated, help me help the community :)
     

    Attached Files:

    Last edited: Dec 15, 2015
  30. superdiederik

    superdiederik

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

    Great to hear that you like the asset!

    As for your questions:What you want is pretty tricky. Maybe at first it's easier to create a new camera (or object) to follow around the current camera around with the smoothness you want, just to test your code and to practice. You can acces the current camera transform through the CameraManager I

    Modifying the prefab of course is possible, only please take into account that the CameraScript attached to the prefab may run into trouble then you disable the Camera component! For an idea on how to set this up please mail to the support addres.

    All the firing in this game is relative to the camera, indeed. To change this would be a pretty major overhaul. If you're talking about some sort of VR implementation, allowing the player to aim by using his HMD, or to look freely and aim with his controller, please contact support.

    To be honest: If you're still learning about C# I suspect you are in over your head here. Creating advanced control and camera scripts (even without VR) is pretty hard. How about you create a test project / scene with some mockup art first to make it work the way you want exactly, and then see how you could implement it within the Hammer project.

    Hope this helps. A bit.

    Diederik / Xform
     
  31. LoveTheVape

    LoveTheVape

    Joined:
    Nov 22, 2014
    Posts:
    86
    I appreciate your response and I knew prior to purchasing that there would be a fair amount of coding if I wanted to tweak this asset. I don't expect any assistance with anything that isn't broken, but appreciate it if it's given. I was able to find assistance from a fellow VR developer, so Hammer is now firing independent of the camera in any given direction. I can share if anyone is interested. Thanks again for offering assistance and please don't stop releasing excellent assets :)
     
  32. etmgames

    etmgames

    Joined:
    Apr 12, 2014
    Posts:
    11
    What about Unity 5.3.1f ? i got error

    Exception: This is not possible to be called for standalone input. Please check your platform and code where this is called
    UnityStandardAssets.CrossPlatformInput.PlatformSpecific.StandaloneInput.SetButtonUp (System.String name) (at Assets/Standard Assets/CrossPlatformInput/Scripts/PlatformSpecific/StandaloneInput.cs:41)
    UnityStandardAssets.CrossPlatformInput.CrossPlatformInputManager.SetButtonUp (System.String name) (at Assets/Standard Assets/CrossPlatformInput/Scripts/CrossPlatformInputManager.cs:139)
    InterfaceScript.LateUpdate () (at Assets/Project Assets/Scripts/Game/InterfaceScript.cs:534)


    how to fix it ?


     
  33. superdiederik

    superdiederik

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

    When did you get the error? When you imported the package? When you are running the game?
    On which platform were you running the game? Standalone?

    I'm running 5.3.1p1 here and I'm not seeing errors, although I do have some warnings.

    I think this piece of code was related to input getting 'stuck' on some devices. You can try commenting it out first.

    To be honest: there have been a lot of weird stuff going on with the last couple of Unity releases, and we might need to consider doing an updated package in the near future.

    Let me know or otherwise contact support!

    Diederik / Xform
     
  34. PieterAlbers

    PieterAlbers

    Joined:
    Dec 2, 2014
    Posts:
    118
    Hi, I just replied to your conversation, but it is a good idea to mention this here as well.
    The error you are getting is because that piece of code can only be run/processed on mobile devices.
    In a Standalone build you cannot call SetButtonUp().

    If you are building a standalone player you could comment the code, but better would be to put it inside an if statement. E.g. (I've used this one before)
    if (SystemInfo.deviceType == DeviceType.Handheld)
    {
    //Code here
    }

    Or do something more specific like;
    if (Application.platform == RuntimePlatform.Android)
    {
    //Code here
    }
     
  35. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    4,926
    If there's some work underway on a Hammer 2 update, my request is to change it so it can be taken out of the "Complete Projects" category and moved to "Scripting."

    Any Complete Project will automatically overwrite any existing project settings, which is a pain, especially if you're trying to merge assets from two or more Complete Projects.

    To move Hammer 2 out of Complete Projects, you'd have to make a script that sets up whatever layers, tags, and inputs are to be used. I think this is a much better design, because it helps the user take control of those settings, so they can more easily re-arrange them for compatibility with other plugins.
     
  36. superdiederik

    superdiederik

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

    Thanks for your reply. Your ideas make sense, and it may be something we could consider. I was not aware that the project settings were overwritten this way (except for the InputManager of course).

    Your suggestions would definitely make everything more flexible and modular. For a project this big however, this is a lot of additional work. One of the main reasons that a package with so much functionality is so incredibly cheap, is that it's not that modular and drag n' drop ;).

    Thanks for your thoughts, we'll definitely keep it in mind!

    Diederik / Xform
     
  37. rafleal

    rafleal

    Joined:
    Jan 11, 2016
    Posts:
    7
    Hi, I'm trying to add more missions but I'm having a problem.
    I added the required information on SharedData and also the new mission name and description to the "Localization" files.
    Then I added one more page to the mission selection panel, but when I go to this new page (In-game) I get this error:

    Code (CSharp):
    1. KeyNotFoundException: The given key was not present in the dictionary.
    2. System.Collections.Generic.Dictionary`2[System.String,DicEntry].get_Item (System.String key) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:150)
    3. MissionSelectPanel+<MissionSelectPanelSequence>c__Iterator8.MoveNext () (at Assets/Project Assets/Scripts/Game/2D/MissionSelectPanel.cs:134)
    Can someone help?
     
  38. SecretStudio

    SecretStudio

    Joined:
    Feb 5, 2014
    Posts:
    50
    There are a lot of informative threads here that have been of great help to a newbie, having recently purchased the Full Game Kit - Hammer 2. Many thanks to @Goofy420 for the excellent pdf tutorials and comments - I wouldn't have got this far without them - cheers.

    I've been experimenting with replacing some of the low poly assets using high resolution assets so far and would now really like to replace the Hammer character.

    I have a similar problem as mentioned in #108 with the spine not being found...

    I have added my replacement character following the instructions in the handy pdf 'CharacterTutorial' and while my replacement character spawns in the 'Scene/Hierarchy window he isn't visible in the Game window.

    In the inspector the spine variable is blank on the instantiated character, but even when I add that in and unpause the game my replacement character still isn't visible in the game window.

    Here's several screen shots to help illustrate my problem. You'll notice I renamed some of the rig names to correspond to the original Hammer rig names too (though this didn't seem to make any difference either way), and also include screen shots of the edited script/txt files - Hammer.cs and SharedData.txt

    Full Game Kit - Hammer 2 - is a great learning tool for me - all thanks to Pieter and the Xform team.

    Hammer-1.jpg Hammer-2.jpg Hammer-3.jpg Hammer-4.jpg Hammer-5.jpg
     
  39. Goofy420

    Goofy420

    Joined:
    Apr 27, 2013
    Posts:
    248
    I don't have the project anymore so I can't reference it, but try changing line 106 from VeteranHero to Hammer. In sharedData line 281 the reference to VeteranHero through the json is hammer, but I could be wrong since I don't know a thing about json. I don't have a lot of time right now, but I'll get back here eventually when this is done.
     
    SecretStudio likes this.
  40. SecretStudio

    SecretStudio

    Joined:
    Feb 5, 2014
    Posts:
    50
    Thanks for your reply. I made those changes, I am still getting the same errors in the console and the same behaviour though.

    Great video, good luck with your game.
     
  41. rafleal

    rafleal

    Joined:
    Jan 11, 2016
    Posts:
    7
    I added a new drivable vehicle (Tank), but when the player enters it the camera teleports to the original Tank that's in the mission too. Do I have to create another camera setting or I'm doing some other thing wrong?
     
  42. PieterAlbers

    PieterAlbers

    Joined:
    Dec 2, 2014
    Posts:
    118
    It probably means you have an incorrect target for the camera.

    It might be best to add a new camerasetting with the correct targetName. Currently it might be looking for 'TankTurret' and that might not be available in your new tank. Update your vehicle to reference the new camera setting.
     
    rafleal likes this.
  43. PieterAlbers

    PieterAlbers

    Joined:
    Dec 2, 2014
    Posts:
    118
    Did you already fix this?
    If not you need to check if your 'currentPage' is properly setup.
    Then debug.log() your missionNumber.ToString() Making sure it will count up properly from 31 to 40.
    Make sure you have no typos in your SharedData under Missions_
     
    rafleal likes this.
  44. rafleal

    rafleal

    Joined:
    Jan 11, 2016
    Posts:
    7
    Thank you for your help.
    I fixed the camera problem but not the "new mission page" one.
    For some reason, an additional mission is been automatically created. There is no mission 32 on SharedData, the localization files or the game scene.
    print.png
     
  45. PieterAlbers

    PieterAlbers

    Joined:
    Dec 2, 2014
    Posts:
    118
    Ok, I know what is going on.
    THe MissionSelectPanel expects 10 missions per page. Regardless if they are defined in SharedData.
    Go to MissionSelectPanel line 108. Here we start to build/show the missions per page.
    Right under the calculation of the missionNumber add:
    Code (CSharp):
    1.  
    2. // fallback when missiondata is not available
    3. if (!Data.Shared["Missions"].d.ContainsKey("Mission"+ missionNumber.ToString())) continue;
    your code should look like this:
    Code (CSharp):
    1.  
    2. for (int i = 0; i < missionCount; i++) {
    3.     missionNumber = (i + 1) + ((currentPage*10) - 10); // Calculate which exact mission depending on the page and location.
    4.     // fallback when missiondata is not available
    5.    if (!Data.Shared["Missions"].d.ContainsKey("Mission"+ missionNumber.ToString())) continue;
    Leave the rest of the code as is :)

    Then it should work!
     
    LoveTheVape and rafleal like this.
  46. rafleal

    rafleal

    Joined:
    Jan 11, 2016
    Posts:
    7
    Yes, it worked!
    Again, thank you very much.
     
    LoveTheVape likes this.
  47. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    870
    HI i got Helicopter_Prefab from in game parking

    NullReferenceException: Object reference not set to an instance of an object
    Vehicle.FixedUpdate () (at Assets/Project Assets/Scripts/Game/Vehicles/Vehicle.cs:59)

    got this when run
    and that's

    NullReferenceException: Object reference not set to an instance of an object
    SpawnData..ctor ()


    can you help please
     
  48. PieterAlbers

    PieterAlbers

    Joined:
    Dec 2, 2014
    Posts:
    118
    Hi!

    I might be able to help, but I have no idea in what context that error is showing up.
    Can you explain a bit more what it is you are trying to do?

    Cheers,
    Pieter
     
  49. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    870
    Yes sorry you right's it's ok for the moment
    will back later for info about how damage is apply
    thank's
     
  50. paala

    paala

    Joined:
    Mar 24, 2014
    Posts:
    14
    How the auto aim functions? I played the hammer 2 on android and it doesn't have autoaim.I haven't seen anything on how to turn it on. Any help?