DanielNL

Movable and destructable curtains for squad!

Hi guys. The really cool thing about curtains will be that enemies outside won't see (that easily) if there are players in that house, hiding behind the curtain or watching through a small gap in curtains!

 

I made the 1st 3D model, now I need to figure out how to add my texture(s) and also make it (or the "material") transparent. Help is greatly appreciated! Later I will animate the opening, closing and destruction of the curtains.

 

Here my current progress (careful, very annoying noise for some reason in the recording, blame Nvidia, Epic games or Microsoft, sorry!):

 

 

And here the WIP code for the curtains to function (please give me constructive feedback, what is wrong, what is missing, maybe a function I wrote here is in Squad already?):

 

#include <iostream>
using namespace std;
 //Compiler version g++ 6.3.0
 int main()
 {
     
     
// following is the serverside check "player distance-to-any-curtain" algorithm:
// final file name would be "player_joined.cpp"
    if ("player ID x has joined server" == true);
    {
         add "player ID x" to "ID list" and start
         "IF #1" (see far below)
     }
}

// player_left.cpp
int main()
{
     if ("player ID y has left server" == true);
     {
          remove "player ID y" from "ID list"
     }
}
// distance_to_curtain.cpp
int main()
{
     [#1] if (any player [any ID from "ID list"]
     is within 100m to a curtain);
     {
         add those players to "specific
         players (SPIDs)" and activate #2
     }
     else
     {
           repeat [IF #1] after a 5000 ms break
      }

      [#2] if ("SPIDs" are within 35m of that
      curtain);
      {
          activate #3
      }
      else
      {
            repeat [IF #2] after a 2000ms break
      }

      [#3] if (player within 5m of a curtain);
      {
           activate #4
      }
      else
      {
            repeat [IF #3] after a 500 ms break
      }

      [#4] if (player within 0,5 m of curtain
      AND if that player has pressed [player
      input] "activate" key within the last 250
      ms (is variable "player activated within
      last 250 ms" necessary?);
      {
          [then]
          [#5] if (curtain state == "open");
          {
              start "close curtain animation"
          }
          else
          [#6] if (curtain state == "closed");
          {
             start "open curtain animation"
          }
         else
         [#7] if (curtain state == "open 
         animation running");
         {
             start "close animation" from 
             "point x"
         }
         else
         [#8] if (curtain state == "close 
         animation running");
         {
            start "open curtain
            animation" "from point x"
         }
    }
    else repeat [IF #4] after a 250 ms break
}

// following is the "handgrenade-curtain" visual effect
if ("handgrenade explodes");
{
    if (handgrenade exploded within 10 m
    of any curtain [ID 1, 2, ...] == true);
    {
     start "curtain ripped off window 
     animation" for "curtain ID x" + set "curtain ID x" to 
     "destroyed"
     }
}

 

 

Thanks for helping me out, if you can, or just for some feedback! :)

Share this post


Link to post
Share on other sites

I think I am missing the case in the code where a player gets within 100m but then leaves the radius again. Would cause maaany player names/IDs to appear in the if [#1] part near the end of a match... @Psyrus

Edited by DanielNL

Share this post


Link to post
Share on other sites

@DanielNL

Edit: First off, this should have been posted in your previous thread, there is nothing that really justifies making this its own thread (the mods can merge them if they feel it's appropriate, as I have flagged it)

 

Perhaps you haven't noticed because you had been focused on 3d modeling until now, but you can't now, and never will be able to add straight c++ code to squad through mods. On top of that, you're trying to write very rough pseudocode but throwing in a bunch of C based syntax, which is making it rather unpleasant to read. 

 

If you're serious about making this work in squad, you will need to familiarize yourself with the blueprint system. 

 

If you're using this project as a means to "learn programming", I recommend you stop right now and enrol in this course, as it has helped a few of my friends become novice programmers in just a few months (it's about 100-200 hours of study, depending on how fast you pick up new concepts).

 

https://www.edx.org/course/introduction-computer-science-harvardx-cs50x

 

Edited by Psyrus

Share this post


Link to post
Share on other sites

Yeah @Psyrus I already expected that I would be unable to add straight c++ code to squad, thereby in the end I rely on sb. adding the correct code later. Will get into Blueprints asap. Also nice course there, will also start that one later on! (Project wasn't to learn coding, but thx 4 sharing that course!)

Share this post


Link to post
Share on other sites
29 minutes ago, DanielNL said:

thereby in the end I rely on sb. adding the correct code later.

 

In my personal opinion, this is a mentality/attitude you're going to have to quickly drop if you want to get anywhere with your projects. You've already heard this from me regarding your 3d models but I'll repeat it here to be very clear...

 

It is going to be virtually impossible to get someone to do your work for you, even if you regard yourself as having done "most" of it. There are a few exceptions (which is why I put "virtually" there):

 

1) You look like this, and ask them very "nicely" ( . )( . )

LUCWndqh.jpg

 

2) You pay them

qrjK4.gif

 

3) You find someone talented enough to do your work, but dumb enough to do it for free

5c5aaf3f8ebcbd9bf9304a74d7cdbe4f.jpg

 

40 minutes ago, DanielNL said:

Will get into Blueprints asap.

They're very well documented, and actually much easier than learning programming from scratch once you get used to visual scripting. I still highly recommend that CS50 course if you're interested in learning proper algorithm creation skills etc. 

https://docs.unrealengine.com/latest/INT/Engine/Blueprints/GettingStarted/

 

I hope you can get the skills to implement this and showcase it in a few months on the wrench :) Speaking of which, I hope you pick up your 3d models again, it's such a waste that you finished them 50% (yes, 50% not 80/90%, since you haven't done any UV mapping & texturing yet) and then put them on hold indefinitely

Share this post


Link to post
Share on other sites

There is a 4th exception: If OWI at some point finds this feature worth it (and when one of the OWI programmers finds it easy to add this to the game) they might want to add it into the game (once I corrected all issues). The main problem is though that I can't look at the Squad source code for the multiplayer parts (player_joined, player_left functions for example)... So I hope sometime this summer a Squad DEV can tell me at which parts my pseudo-code doesn't work with Squad (which variables/functions already exist in Squad for example). Maybe I'll program my own "2D-sniper-sim" Android App ;) (Where you play a sniper behind a window, can open/close curtains, change to different windows in the house xD )

Edited by DanielNL

Share this post


Link to post
Share on other sites
1 hour ago, DanielNL said:

There is a 4th exception: If OWI at some point finds this feature worth it (and when one of the OWI programmers finds it easy to add this to the game) they might want to add it into the game (once I corrected all issues).

 

If your goal is to get the squad devs to implement your ideas, writing out pseudocode is literally a waste of your time as their level of game-feature implementation is lightyears ahead of yours. If they decided to implement it, they would do so from scratch in a way that works with their existing systems, which are a complete black-box to you (and thus you can't really hope to offer meaningful pseudocode, because you have no idea how the systems really work in the code). If that is your goal, you are far better off writing really well laid out suggestions, offering concrete reasons why it would improve gameplay and justify dev time to implement over other features that they are already considering. 

 

If your skills were at @FishMan's level, you could maybe start thinking like that, but you're many, many years off being able to contribute code/gameplay suggestions like he is. 

 

1 hour ago, DanielNL said:

The main problem is though that I can't look at the Squad source code for the multiplayer parts (player_joined, player_left functions for example)... So I hope sometime this summer a Squad DEV can tell me at which parts my pseudo-code doesn't work with Squad (which variables/functions already exist in Squad for example).

 

Your understanding of programming is at such an elementary level that you don't even know why what you wrote there is quite silly, and that's ok, everyone starts somewhere... but with 99% certainty I can tell you that the devs will either ignore you or give you answer that goes above your head. For example, there is absolutely no reason why you would need to capture the players joining and leaving the server events for your curtains. Most reasonable programmers with a bit of UE4 knowledge could implement your curtain thing (besides the art/animation portion) in a couple of hours through the blueprint system, and there is definitely zero need to interact with an OWI dev to accomplish it. 

 

What you are trying to do is similar to learning basic algebra at the age of 12/13 and then going, "Ok! Time to try my hand at some astrophysics, I hope Steven Hawking doesn't laugh at me when I ask him for help" ^_^

 

If you're wondering why I typed out this long response, it's because I saw your message on Discord some weeks ago that went something like "Hey devs, [some question here], please don't troll me". And it seems like you haven't quite grasped why the devs (who are generally a very stand up group of people) would not take you seriously or "troll" you. Hopefully my response(s) will lead you closer to answer for that. 

Edited by Psyrus

Share this post


Link to post
Share on other sites
2 hours ago, DanielNL said:

There is a 4th exception: If OWI at some point finds this feature worth it (and when one of the OWI programmers finds it easy to add this to the game) they might want to add it into the game (once I corrected all issues). The main problem is though that I can't look at the Squad source code for the multiplayer parts (player_joined, player_left functions for example)... So I hope sometime this summer a Squad DEV can tell me at which parts my pseudo-code doesn't work with Squad (which variables/functions already exist in Squad for example). Maybe I'll program my own "2D-sniper-sim" Android App ;) (Where you play a sniper behind a window, can open/close curtains, change to different windows in the house xD )

 

Share this post


Link to post
Share on other sites

xD nice one. Btw I'm trying the rigging (finally knowing what that word means), but not working out... the curtain hasn't moved yet... Anyone here knows a thing or two?

Here what I've done so far... (not looking right or?)

 

Rigging_Hard.jpg

 

I was hoping for some function in Blender where with 1 click it would automatically turn into cloth physics...

Edited by DanielNL

Share this post


Link to post
Share on other sites

Cheesus christ! That sound in the video like thousands of bees went strait inside my ears... ouch that was really paintfull...

Thank you Dark Souls @Psyrus for making me go through it :D

 

Quote

careful, very annoying noise for some reason in the recording, blame Nvidia, Epic games or Microsoft, sorry!

 

Uh, yeah! Those evil bastards! It's all their fault! Always!

 

22 hours ago, DanielNL said:

Hi guys. The really cool thing about curtains will be that enemies outside won't see (that easily) if there are players in that house, hiding behind the curtain or watching through a small gap in curtains!

 

Yeah, nice game mechanics in tatcical shooter bro - hide behid curtains. Noted. Thanks. I think OWI should put it straight inside their game.

 

Dude, I'm not a programmer, but why there so many int main() function definitions in your code? Aren't your curtains suppose to be a class? Are you using your knowledge of C++ from high school for this? Seriously dude this code just don't make any sense, it's not even a code at all... it just a bunch of regular sentences between some ifs and braces O_o

Why you even use C++ for curtains? Don't you suppose to use blueprints for things like that inside the engine? Or you really think that every damn thing is allways hardcoded inside the game via c++? O_o

 

22 hours ago, DanielNL said:

if ("player ID x has joined server" == true);

 

Ah yeah so you writing your own game out there right? Thats why you need to know whether or not player is joined the game. Especially when you сheck the state of the constant string.

Sorry, dode but this "code" is just a crap... I think if you seriously want to make *curtains* (pretty stange choise if you ask me) you should start from a definition of their functionality (as far as I understand you not just want to make a static mesh, but also give them some kind of functionality, cloth simulation, animation playing whatever) and then you should google it... Like "cloth simulation UE4" or "how to play animation inside UE4", or "how to do rigging inside whatever software" etc etc

 

And what this video is about?

 

I suddenly came up with an idea... are you trolling us? I could understand if you were 16 years old, but your voice is very adult, it's hard for me to believe that you are so naive o_O

 

6 hours ago, Psyrus said:

If your skills were at @FishMan's level, you could maybe start thinking like that, but you're many, many years off being able to contribute code/gameplay suggestions like he is. 

 

Didn't quite get why I was mentioned here... but.. ok... whatever... :D

Edited by FishMan

Share this post


Link to post
Share on other sites

What if it really is a subtle troll. I mean, 'destructible curtains', it sounds like something out of a Battlefield parody video

Share this post


Link to post
Share on other sites
Just now, Sovietdoge said:

'destructible curtains

 

THE DESTRUCTIBLE CURTAINS

In space

by DanielNL

Share this post


Link to post
Share on other sites

why "in space" ?

 

Quote

Seriously dude this code just don't make any sense, it's not even a code at all... it just a bunch of regular sentences between some ifs and braces O_o

It's called pseudo-code.

Edited by DanielNL

Share this post


Link to post
Share on other sites

Hi, i'm sorry , i'm new in Squad\Squad SDk modding -  as from expirience from Battlefield 2 modding  maybe you should add the collisions on each part of the objects - making the collision from object directly and reasign the materials)

Share this post


Link to post
Share on other sites
Quote

why "in space" ?

Well you know... When you add "In space" everything begin to sounds cooler... in space get it? Ha-ha... Nuh? Ah just never mind...

 

Just now, DanielNL said:

It's called pseudo-code.

Usually it called noncence )

 

22 hours ago, DanielNL said:

#include <iostream> using namespace std;  //Compiler version g++ 6.3.0  int main()  {

I dunno why you need a header inside pseudo-code or use C++ syntax, especially when you wasn't mentioned that this is somekind of pseudo-code in your fist comment:

 

Quote

And here the WIP code for the curtains to function (please give me constructive feedback, what is wrong, what is missing, maybe a function I wrote here is in Squad already?):

But anyway. As I said - you don't need to use any C++ for *curtains*, fist you have to define the functionality that you want to implement and then google it, or ask for a help on the forums...

Edited by FishMan

Share this post


Link to post
Share on other sites

Also if you need any help usually the guy called Google can help...

You haven't got banned there yet right?..

Here some examples for you sir:

BTrAcBP.png6yLhM4e.png yXZiDBH.pngJYefgFy.png FkFb1wG.pngzMCoLIc.png

Edited by FishMan

Share this post


Link to post
Share on other sites

Daniel...

I'm afraid you are going to have to do a lot of reading. This is why a studio has artists, animators, programmers, etc. It is difficult to get very good at ALL aspects. You tend to bounce around a lot. I would pick an area and focus on that. Then move onto another area once you have gotten a bit more practical experience in that area. Figure out which area you like the most and learn that.  And then open the UE4 docs and start reading. 

Share this post


Link to post
Share on other sites
10 minutes ago, Odin said:

It is difficult to get very good at ALL aspects.

Just for the sake of justice it is worth noting that he doesn't need to be very good at ALL aspects to make curtains.

 

And it is worth noting that the more you are interested, the more you know. So if he is going to learn rig and animation, it's only for the best.

Edited by FishMan

Share this post


Link to post
Share on other sites
11 minutes ago, FishMan said:

Just for the sake of justice it is worth noting that he doesn't need to be very good at ALL aspects to make curtains.

 

And it is worth noting that the more you are interested, the more you know. So if he is going to learn rig and animation, it's only for the best.

 

Absolutely @FishMan. I was mainly talking about his propensity to bounce around between projects so quickly without really learning what he should from each area that he tries. But yes, I couldn't agree more. The more you know the better. At the very least learn it to better understand workflow on a larger scale in UE4.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now