Jump to content
  • Advertisement

Harry Loretz

Member
  • Content Count

    14
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Harry Loretz

  • Rank
    Member

Personal Information

  • Interests
    Art
    Design
    DevOps
    Programming
    QA

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Yes Yes! here we go! I finished the code, just letting you guys know. this is what works. I had to make 3 FTImerHandles to make it work though. PlayerInputComponent->BindAction("GoInvisible", IE_Pressed, this, &AOmniCharacter::GoInvisible); void AOmniCharacter::GoInvisible() { if (!(GetWorldTimerManager().IsTimerActive(InvisibilityHandle2)) && !(GetWorldTimerManager().IsTimerActive(InvisibilityHandle)) && !(GetWorldTimerManager().IsTimerActive(InvisibilityHandle3))) { GetWorldTimerManager().SetTimer(InvisibilityHandle, this, &AOmniCharacter::StopInvisibilty, InvisibilityStop, false); GetInvisibleMesh()->ToggleVisibility(); GetMesh()->ToggleVisibility(); } else if (GetWorldTimerManager().IsTimerActive(InvisibilityHandle)) { GetWorldTimerManager().ClearTimer(InvisibilityHandle); GetWorldTimerManager().ClearTimer(InvisibilityHandle3); GetWorldTimerManager().SetTimer(InvisibilityHandle2, this, &AOmniCharacter::ResetVisibility, InvisibilityCooldown, false); GetInvisibleMesh()->ToggleVisibility(); GetMesh()->ToggleVisibility(); } } void AOmniCharacter::StopInvisibilty() { if (!(GetWorldTimerManager().IsTimerActive(InvisibilityHandle2))) { GetWorldTimerManager().SetTimer(InvisibilityHandle3, this, &AOmniCharacter::ResetVisibility, InvisibilityCooldown, false); GetInvisibleMesh()->ToggleVisibility(); GetMesh()->ToggleVisibility(); } } void AOmniCharacter::ResetVisibility() { } Much appreciation everyone
  2. Hey so i Figured out how to make this code work the way i want it to, but i have 1 minor issue left. The issue i have now is that I want the PlayerInput to be "pressed" for both of these, but if i do that they conflict with the code shown below. I will show you guys what i have so far. So close to having this finished i really appreciate all the help. To simplify i want the controls to work like (press "1" to go invisible, press "1" to Become Visible while invisible) PlayerInputComponent->BindAction("GoInvisible", IE_Pressed, this, &AOmniCharacter::GoInvisible); PlayerInputComponent->BindAction("GoInvisible", IE_DoubleClick, this, &AOmniCharacter::GoVisibleWhileInvisible); void AOmniCharacter::GoInvisible() { if (!(GetWorldTimerManager().IsTimerActive(InvisibilityHandle2)) && (!(GetWorldTimerManager().IsTimerActive(InvisibilityHandle)))) { GetInvisibleMesh()->ToggleVisibility(); GetMesh()->ToggleVisibility(); GetWorldTimerManager().SetTimer(InvisibilityHandle, this, &AOmniCharacter::StopInvisibilty, InvisibilityStop, false); } } void AOmniCharacter::GoVisibleWhileInvisible() { if (GetWorldTimerManager().IsTimerActive(InvisibilityHandle)) { GetWorldTimerManager().ClearTimer(InvisibilityHandle); GetInvisibleMesh()->ToggleVisibility(); GetMesh()->ToggleVisibility(); GetWorldTimerManager().SetTimer(InvisibilityHandle2, this, &AOmniCharacter::ResetVisibility, InvisibilityCooldown, false); } } void AOmniCharacter::StopInvisibilty() { { GetInvisibleMesh()->ToggleVisibility(); GetMesh()->ToggleVisibility(); GetWorldTimerManager().SetTimer(InvisibilityHandle, this, &AOmniCharacter::ResetVisibility, InvisibilityCooldown, false); } } void AOmniCharacter::ResetVisibility() { }
  3. I appreciate that a tonne Andi, I will give it a go thankyou for your time.
  4. I tried this method i believe i wrote it correctly, where it says "If(!GetWorldTimerManager().IsTimerActive(InvisibilityHandle, this, &AOmniCharacter::TryStopInvisibility, Invisible, true))" within the brackets it says that it needs to be a boolean statement.
  5. Yes i agree with you, Yeah i was wrong earlier i thought they ran side by side before. But they are sequential as you said before. I think we are on same page, i am going to try Andi's method, this could be what i am looking for. Hey Andi, i will try your method, what you wrote seems to simplify things. Thanks for your reply to i appreciate all the feedback and help. PlayerInputComponent->BindAction("GoInvisible", IE_Pressed, this, &AOmniCharacter::GoInvisible); PlayerInputComponent->BindAction("GoInvisible", IE_Pressed, this, &AOmniCharacter::GoVisibleWhileInvisible); void AOmniCharacter::GoVisibleWhileInvisible() { if (VisibilityNegate == false) { GetWorldTimerManager().ClearAllTimersForObject(this); GetInvisibleMesh()->ToggleVisibility(); GetMesh()->ToggleVisibility(); GetWorldTimerManager().SetTimer(InvisibilityHandle2, this, &AOmniCharacter::ResetInvisibilitySpell, InvisibilityCooldown); } } i tried this along with my original code on the first post, but it doesn't work. I thought this made sense but it totally ignores the timer and confuses the input and makes timers and input out of wack. I also added a new Ftimerhandle here. This is just to show you guys what my current understanding of C++ is like, so bare with me
  6. Here is a link to that video, it should be obvious which video it is. I am going to do some more code towards this today hopefully find a solution. I will neaten up the code to so i better understand it myself. I am really unsure how to do this, like if i wanted to become visible from invisible anytime i choose then would that be a "if" statement, or should the code be separate? https://www.facebook.com/NextLevelEntertainmentX
  7. I think it is one second i will check, I don't have great editing software but i will make a short video and upload it to my dev page on facebook and put the link here. it should work sequentially but it doesn't seem to. I will do that today, i just woke up
  8. Harry Loretz

    Feedback please : FPS Project

    Your right, about the bullet drop, if you only plan to make a close quarters game. I am a very big gears of war fan, Cover systems are fun when they save your life. I always appreciate having dash or dodge movement in shooter games. I get your point about cover systems turning things into a static shooter. Depends what your working towards, i am working on a magic RTS-3PS Game so i like things being far away from realism mostly. So many times in pubg i wish i could have dove to cover, even if i don't stick to it like in GOW.
  9. Thankyou for your reply Albert, I will make a video soon and upload a link here it will be a better explanation. I thought about having 1 timer, but i can't because i need 1 time set for the character to become visible from invisible, and i need another time set for a cooldown, so the character/player can't become invisible straight away again. I wrote in a reply to Zak that i am new to coding and used Code i got from a character dash movement tutorial. You are right i should clean up the structure, i was thinking about that a few minutes ago. I Understand most of this code, having a bit of trouble with the parameters, which i believe are the things inside of the ()brackets. Please note, i am new to C++ but am doing it fulltime. I appreciate your reply Albert
  10. It's hard to explain, thanks for being patient with me. So i can't actually say for sure that my timers are the best setup, but the InvisibilityStop is the timer which determines how long you stayed invisible for but the cooldown timer seems to run at the same time as the invisibilitystop timer, they use the same FTimerHandle. I'm very new to all this. So yeah i think the cooldown runs at the same time, or very close to that . I copied the timer code i got from a "Dash" tutuorial i followed. It may not be the best way for timers. i have in the constructor InvisibilityStop = 5.f; InvisibilityCooldown = 6.f; I really appreciate this man
  11. also you may have noticed i have 2 meshes, Invisiblemesh has a completely transparent material attached so you appear invisible with a shadow too.
  12. Thank you for your reply Zak,, Yes you are right VisibilityNegate is a boolean, true or false, I was experimenting with different types of code so VisibilityNegate worked for me, yes it is a visibility flag. When i said i don't wish to tie in this spell to a mana system, i am just saying that i don't want the invisibility to have anything to do with mana drain. I just said it in case. It's not important really. All i want is to appear "visible" whenever i appear "invisible", any time i choose during "Invisibility being active". But the consequence of going visible will be that you will have to wait until you can go invisible again. Simply put. I also want that consequence i mentioned earlier to work in a way where "if i choose to go visible while invisible, i will have to wait for a timer which is equal to the difference of the cooldown timer i have. so lets say i "goInvisible" the cooldown timer goes for 5seconds, at 2 seconds i go visible, so now i have to wait 3 seconds. or if i choose to go visible at 4seconds into the cooldown timer, i will have to wait 1 second before i can go invisible again. Much appreciation Zak, also i have a (stopInvisibility) timer too so that has to be cleared when going visible, but i think i know how to do that.
  13. Hey there everyone, I am quite new to C++ and have implemented some code for an invisibility spell/command. What currently happens is I press "1" then the character goes invisible, it activates a timer (InvisibilityStop) timer plays out, then the character reappears on it's own as intended, while another timer(InvisibilityCooldown) is playing so i can't immediately go invisible again. I just want to be able to go Visible whenever i am Invisible but i want there to be a corresponding timer so i can't go invisible right away, i also would like this timer to be the remaining time of the "InvisibilityCooldown". Here is the code. void AOmniCharacter::GoInvisible() { if (VisibilityNegate) { GetInvisibleMesh()->ToggleVisibility(); ACharacter::GetMesh()->ToggleVisibility(); VisibilityNegate = false; GetWorldTimerManager().SetTimer(InvisibilityHandle, this, &AOmniCharacter::StopInvisibilty, InvisibilityStop, true); } } void AOmniCharacter::StopInvisibilty() { GetInvisibleMesh()->ToggleVisibility(); ACharacter::GetMesh()->ToggleVisibility(); GetWorldTimerManager().SetTimer(InvisibilityHandle, this, &AOmniCharacter::ResetInvisibilitySpell, InvisibilityCooldown, false); } void AOmniCharacter::ResetInvisibilitySpell() { VisibilityNegate = true; Please help, i can't figure this out, I also do not wish to tie this spell into a mana system. Thankyou.
  14. Harry Loretz

    Feedback please : FPS Project

    It looks comfortable, the feedback i would give you for your FPS game is, the recoil could be a little more convincing, incorporate bullet drop, and wind effecting bullets for max realism,(if you want). I also must mention i am a fan of Heavy feeling guns in games, like when i shoot a gun in a game i think of Black, Doom 2016, BulletStorm, things like that because of the sounds of the weapons mainly. They are very chuncky, bassy sounds for the gun fire, along with the sounds for loading the weapons. Also i think in most games where guns feel heavy they are thicker than usual in look. I personally do not care if a gun is powerful in comparison to how it feels to me in a game. To me Pubg gun sounds aren't that heavy and need more bass for this heavy affect. Also may i recommend a quick cover system for your FPS game like in gears of war but done differently. Cover systems are enjoyable and give a sense of realism, as if you were in a real gun fight, i'm sure you would dive to the nearest cover so you can think about your next move. Keep up the good work, it looks good what you have.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!