#blueprint
402296 messages ยท Page 571 of 403
anyone had that it reported errors like "Accessed None trying to read property FooBar" while it does in fact seem to reference the correct object as the call on one of its methods works fine?!
@plucky aurora sounds like a question for #graphics
@trim matrix generally speaking people use a custom enumerator (enum) to distinguish between several mutually exclusive states rather than a series of boolean variables
so you should look into that
You also have to de-spaghettify your node graph layout before you show it to the channel
cuz reading spaghetti is hard
Hello everyone
I wanted to ask a question about events and I cant find an answer in the docs
So, can I continue the event outside the event?
I mean can I have something like that
and inside of Request Server To Do Action I want to somehow to end on a branch and if its true then continue to event Lights Not Working
actually
I will need this event many times
and its something like that
and It would be great if it wasn't necessary to always copy paste all that
Typically, your Event RequestServerToDoAction, would be a function and return a boolean. And you could branch on that boolean before doing the RPC.
oh yeah that should work better thanks
Because I want from a client to run an event on server
replication rule?
If you mean that I should make the function multicast or running on server or running on client
I want something like unicast
Yeah, not sure what you're looking to accomplish with these functions, was just offering an easy way to make the one easily branchable. For networking stuff it's likely there's a better way. What exactly is your use case with all of this? What does this do?
So I have button and I when is pressed I want to change a boolean on all actors of class
probably not so I would like to make something of a lobby system
I watched the ue4 tutorial about multiplayer
until video 19 I think
and then I hit a dead end probably cuz it was outdated
Which machine do you want to change the boolean on? All machines? Just server? Just the client that pressed the button?
And the machine with the button can be any machine, not just the server machine?
yea
wouldnt it work If I casted to the server?
Hold up a sec, I'll explain.
oh you mean that I should check player controller if it is server
@lyric flint Follow up question, what is the boolean? and in what actor is it? What's it for?
Okay. So the bool is in a lamp?
yea exactly
Okay. This is terrible usecase, but we'll still use GetAllActorsOfClass for testing.
so this could be done a different way?
You make a ServerRPC in some actor that any client can own. Probably the controller, maybe their controlled pawn. Lets assume you put this RPC in the Controller. The button will get this local client's controller with GetPlayerController(0) and call this serverRPC. This will get you onto the server's version of the button clicker's controller. Now that we're on the server, you GetAllActorsOfClass of the class of the lamp. And then for each loop over those to set the boolean.
Anyone here has CLEAR understanding of using "REMOVE INDEX" Array, please? I am getting mixed answers here and there for this node alone only.
i want to remove the Hunter Array Index from PlayerController Array Index.
so where the green line actually goes to? I received mixed answers for this
some says the "Add" node, some says the Loop node, i even heard some told me it has to be directly to the PlayerController.
how can I create the server rpc
I cant find the function or something
@lyric flint Start with the Widget, it should look something like this.
In the controller, you'd have this.
@unique flicker I have no clue, without the minus the amount won't be the exact amount, so i let it be with minus 1
@maiden wadi we couldnt just set the sabotagelampallthelamps executable on server?
i suspect the last index on the macro itself requires minus
i even previously saw this method from someone's video tutorial
you can try it, without a minus you won't get the same amount
anyone with clear understanding* on remove index array usage?
@lyric flint You probably could. Just breaking it apart for understanding. But after that print, would be where you would get all the lamps, and set their replicated boolean.
i also don't understand why the engine gives me EXTRA one more amount if i don't give a minus
it's the results
I dont understand the string part
oh wait I think I do
why do we need to print string?
I have seen this elsewhere but didnt understand also why
You don't. It's there for understanding. It's just a test tool.
If you click that button with that setup, it would always print from the server machine It'd say like Server: Hello. If you put a print above on the SabotageLampAllTheLamps event, it would print something more like Client1: Hello
Hello everyone!
I am trying to take a screenshot of the game at runtime, than use it as a thumbnail for a widget.
cmd: HighResShot 1 "100" "100" "100" "100"
Tried it in the Execute command BP too.
I know the first int after HighResShot is the resolution multiplier and the rest is as follows
HighResShot filename=PATH (XxY OR Multiplier) CaptureX CaptureY CaptureW CaptureH
So I tried dividing subtracting random values you name it but all I got out from it is this:
which is an empty jpeg, or it looks like one... :(
It comes up as a green square in the file browser
@unique flicker so basically, the Hunter Array Index that is being "Add-ed", is removed from the PlayerController Array, correct?
just to clarify properly.
@unique flicker then what is the correct way to removed all the "Add-ed" players that goes into Hunter Array?
there's no video talks about Array, this is on my own study
player controller = 0_base right?
Thanks for your understanding. I just switched from unity and things are quite weird
i am learning to REMOVE INDEX after Adding them into new ARRAY Index
which was mentioned at start
i want to remove the Hunter Array Index from PlayerController Array Index.
so where the green line actually goes to? I received mixed answers for this
yeah i got that correct from start
@lyric flint PlayerControllers only exist on the server and the owning client. Therefore whether you're on a client or a ListenServerClient, the PlayerController at index 0 will always be the local client's controller. Since that GetPlayerController(0) is from a widget, that means it's ran from that client.
someone who's pro at C++ told me i got it wrong
ah the minus-ing, i would like to find back the old tutorial video
and then how its going to run on the server?
how do you minus one from floats?
let me re-run several "Play" button to see if i get the accurate amount
yeah, i tried few times of play now, without MINUS one, i won't get the accurate amount
it gives extra one
let me try +1 and see
@lyric flint The widget button's onclicked gets the local controller, casts it to the correct class, and calls the event "SabotageLampAllTheLamps" That in turn calls "ServerKillLampsDead" which is set to RunOnServer from the replication selection if you click on the Event. Hence why that print would always print from the server.
@unique flicker i tried +1, it gives me ANOTHER EXTRA 1, so basically +2
without + or -, i get extra 1
with -1, i get correct amount
with +1, i get +2
it's insane stuff, i don't even have any clue why the engine behaves this way
oh and how can I find the player controller file. I have to create a custom right?
@lyric flint If you want to create those custom events, yes. Clients can only interact with the server through ClientOwned Actors. By default, this is the PlayerController and the Pawn it possesses.
@drowsy thistle Because you didn't split the struct.
Oh I actually understand this thanks very much ๐ . One last question ๐ whats the diffrence of pawn and actor
Ohhhh thank you very much for everything you are the best ๐
@timber cloak What exactly are you trying to do with that loop?
It looks like you're trying to translate an array of playercontrollers into a list of their controlled pawns? If that's correct?
@maiden wadi sorry didn't know you would response. Yes, correct. The update is here:
does any one have experience with nDisplay here?
hey guys
i can't find destructible component in variables
how i can get this shit ?
How can I create a static mesh component at runtime? ๐ค
Hiho i dont know why my widget cant take variables from my ThridPersonCharacter. 2 other Widgets can take that variables but this one can -.-
It looks like the other widgets but no "get Health", "get Vita", "get Stamina" Variable can be found.
Try dragging of the Character Ref pin or unchecking context sensitive in the top right ๐
Might just be that you're not seeing the proper option
@timber cloak Why not just iterate over the PlayerControllers array, check if the controller pointer is valid, if it is, get it's pawn, cast it to the right pawn. If if that's valid, add it to the array of pawns and at the same time, remove that index from the ControllerArray?
Something like this.
@maiden wadi but then how do you get the Amount of "Pawn" that you wanted to cast to?
put a Integer Variable linked to Branch node before that part?
I don't understand what you're asking?
your way is indeed better, less bloated and cleaner
well, like in my screen shot, there's "Number of Hunter" Variable Integer
so, if i put number of hunter is 3, it will get 3 from PlayerController Array
this was my screenshot
Right. The only issue with that is that you have to keep that number, and your PlayerControllers array accurate at the same time. What does the PlayerControllers array represent? How is that being populated initially?
That was populated directly from "OnPostLogin" New Player node, straight forward
so with an Integer Variable like 'Number of Hunter", you definitely have to go my way, correct?
yours is directly convert whole PlayerController Array into another new Array
without any Integer Variable to select an amount
i would like to try your way with Integer Variable linked to Branch node prior your BP nodes
wait, can't lol
Is it safe to do remove index on an array while it's being iterated over?
i forgot branch is simply boolean lol
I think I need more information on the end result for the logic. Number of Hunters is for what? Is that a total number of players?
my bad
@tired saddle ReverseLoop.
Total of Players that will be selected as "Hunter" role.
so example, 5 players connected. "Number of Hunter" is 2, then the node will pick 2 players out of 5 players as Hunter.
correct right my way?
Yours is entirely convert the whole PlayerController Array as another new Array.
Okay. So PlayerControllers is added to OnPostLogin, and then you pick a number of players to be hunters, and you want to add their pawn to the PawnArray and remove them from the PlayerControllers array?
Do you want it randomized from the PlayerControllers array? Or is it always deterministic?
already randomized. Randomed using after the "Add" PlayerController Array. i didn't mention due to not trying to be out of topic.
again, please correct me if i am wrong somewhere
Okay. What you have there should be perfectly fine. Only change I'd make is to add the IsValid check for the controller before calling GetControlledPawn.
Perfectly okay to pass around possibly invalid pointers, but always check they're valid before calling functions on them or trying to get variable data from them. Unless your shuffle function does that, then I probably wouldn't worry.
i have no IsValid on my node. I suppose your IsValid will solve the random issue, which is, EVERY 1 out of 20 tests, there's usually extra 1 Hunter being spawned into the game.
Yeah, not sure. That should only be affected by the integer NumberOfHunters, however that's set. The -1 on it for the loop is perfectly normal.
Theoretically I wouldn't think the controller check would solve that. Cause it wouldn't change the amount of times this is being called.
i see. The minus -1 was not my question. But that guy was confused as to why I used -1 minus node
Therefore he asked you after I told him, that is the correct way to get the correct amount
Yeah. Even if it was incorrect, that'd leave you with one less hunter, not one more.
I see. Thank you for correcting me.
How is the number itself being calculated?
at the moment i leave it to ClassDefault Setting. I am doing this to learn the engine.
So it's always the same number, but sometimes you have one MORE hunter? O.o
Yup correct sometimes with 1 more hunter. I ran the test very very frequently. About 1 week, since i made changes to code and trying something like calculating number of index inside Array
so if my guess is correct, it happens like ONCE every 20+ test.
That's odd. As long as that integer doesn't change for any reason, it has nothing to do with this. If anything, this code would cause less to spawn.
i am going to try with IsValid now
actually, is there any difference between IsValid and IsValidIndex?
@timber cloak Yes. IsValid is directly on the pointer. IsValidIndex is on the Array. For example, an Array can have a ValidIndex that is an Invalid pointer.
@timber cloak Best way to thoroughly explain that is consider this. You spawn ten actors and you add their actor pointers to an array. Then you destroy those actors. The array doesn't inherently automatically resize. Instead, you have ten array index points that all point to invalid objects. So if you used IsValidIndex 0-9 it would return true, IsValidIndex at index 10 would return false, since the array is 10 objects in size, and index starts at 0. Despite the 0-9 returning true on IsValidIndex though, that doesn't mean those Actor pointers point to valid objects. Specially since you destroyed them. So if you try to use these IsValidIndex pointers, they would throw errors. Which is why you have to check that the pointer itself is valid with the IsValid node.
okay, i ran the test over and over. It rarely gives 1 extra hunter. Like probably 1 out of 30-50 times of tests.
@maiden wadi appreciate that thorough explanation, very helpful. Thanks a lot really.
I have been wondering if you have multiple roles to be added into multiple arrays, instead of a single role like that "Hunter" role. What would one suggest to do this? Repeat it, even it means to be bloated and spaghettis ?
I know this is an old response but I tried making them procedurally with no results. They are all different buttons for each collectible in my game
@timber cloak Usually just make a single generalized function that can be called multiple times with differing inputs. There's multiple ways to accomplish it depending on desired code flow.
Say how do I make this leaf transparent around the edges of the leaf texture? In Unity we would use alpha clipping but I'm not sure how it's done in Unreal
@wispy pumice Not sure what AlphaClipping is, never used Unity, but I think you'd normally use a masking texture for that. #graphics channel is often a better place for material questions.
Oh thanks and I'll keep that in mind next time sorry just realized I'm in the blueprint section
@wispy pumice All good. Does that green leaf's Alpha have the right mask you need?
no
it only came with two but I could just grab another
I was just testing a program for making tree's and it wasn't designed for Unreal
set the blend mode to masked
@wispy pumice See the Blend Mode in the bottom left of your screenshot? It's currently on Opaque. Change that to Masked or Translucent depending on if you want a simple mask of a semi transparent texture.
if it has an alpha channel on it
but if youre making foliage
its more complicated then that
Well I tried that and it just made it transparent
Do masked, and plug a constant value of 1 into the OpacityMask
Alright, thanks
That'll at least keep it from being transparent I think. But you'll need an alpha mask, black and white texture to put there if you want per pixel visibility for the material.
Alright, I think I'll try and use ShaderMap 4 to generate me one and see how that looks
@shadow saddle Isn't that kind of a question for yourself? Are you trying to ship it, or are you just debugging a cooked version of your game?
how do i make a scalar parameter only affect the one obj
have a simple cooking setup
but its cooking all the chicken legs
wanna keep it contained to one actor but being able to have as many as i want
does that make sense?
Perfect sense. You just have to set the scalar parameter on that instance of the chicken leg.
how do i do that?
Dunno. Depends on your setup. What are we even talking about? What is the Scalar parameter for? A MaterialInstance?
Yea it blends between 2 textures
obv this doesnt work cause its setting the value on ALL of them lol
It's probable that you've somehow started all of these at the same time? It looks like it's already setting the instance's own value.
I see. Thank you.
I wrote the entire thing in Paint to get a clearer picture
the bracket beside the name, is the amount of the occupation/job's role.
so for non-role type of jobs, it is straight forward.
@maiden wadi what?
Whereas, the "role" types of jobs, it is you become* either that or this.
Specifically for the ones where it can be multiple types. Picking Doctors/Surgeons out for example. Is it always three of one or the other, or can you have say 2 doctors 1 surgeon?
You can't, only 3 doctors or 3 surgeons. Either 1. I don't mind randoming again but I am afraid it will be more complicated but good for learning purposes.
I am just trying to "level up" my learning skills.
going too far might be too complicated
It's pretty much the same either way.
really? to me, it is simply a guessing game to code it
i would like to see the general/proper way of coding this.
If we translate this into Unreal stuff. I assume that each one of these might be a player?
16 players for example.
correct. Total 16 players, all of them will be given roles/jobs randomly.
I added Enable Music and Enable SFX properties to the PlayerSettings struct. Now they show up everywhere as non-connected pins.
Is there anyway to prevent this behavior? I want them to start hidden, not expanded
If they got the "roles" type of job, they will get either (this or that)
i should colour it out to avoid confusion.
Ideally, they would start as unchecked instead of checked by default
Initial design concern would be how are the 16 roles selected to also match up with the fact that there are 16 players? If that's not a factor, the rest is easy.
is there always 16 players? thatd make it easier
do the normal way, "OnPostLogin" -> "Add" array node, "Promote Variable" into "PlayerController" Array.
unless this is not the correct way
Not necessarily need to be 16 players. Can be any.
I'd probably just get a list of PlayerState pawns at the time of choosing.
It is purposely made to learn something new easier rather than guessing.
List of Struct/Enum?
Wouldn't it be better to be straight forward from GameMode?
well that makes it a lot harder cause how are you gonna divide the roles when theres lets say 12 players?
For example. Instead of relying on the addition/subtraction from the array of people joining, Get it at runtime.
that's why i fixed it as 16 players, and given to 16 players.
hm
straight forward to recognise it immediately, yeah
If you always know the 16 roles. You can just hardcode them. Otherwise you'd probably want to create a struct, that can be placed in an array, and assign roles along with weights for a randomization function to pick from.
the amount of 16 players is fixed. But the roles are GIVEN RANDOMLY to different people each time "Play" button is clicked.
My initial thought is to create an array of roles based on the selection weights/limits to how many of each role there can be and then just iterate over the playerpawn's and assign them a role.
so basically, a struct of Arrays containing Arrays?
Nah. Just a sec.
at first, i thought of copy-pasting the like how you showed me the "Hunter" role code earlier. And be bloated with BP nodes after lol
then i thought of enum with switch and selections
but then there's no integer to run enum switch/selection though. I could be mistaken
What are the roles exactly? Different pawn classes?
nope, similar. It is simply to give another random array
You give random job to 16 differents players, if they get role type, you given them random role again
basically randoming 2nd time.
What's in the array?
"Either 3 home tutors or 3 lecturers"
"Either 3 doctors or 3 surgeons"
"Either 2 electrical engineers or 2 material engineers"
random between 2 different jobs
1st random = give the job randomly to 16 different people
2nd random (if they get "role" type of job) = random again either (this or that job)
I'm having trouble following that particular part. Back to the doctors part. Are there subclasses of Doctors? Or are you just rerandomizing between Doctors and Surgeons?
if you want to do another pattern of random on 2nd time randoming, like your question about "2 doctors and 1 surgeon". I would like to see this but i am afraid it gonna get complicated
There are no subclasses of Doctors. If you give 3 Medic Role to the 3 People. These 3 selected people, will become as either 3 Doctors or 3 Surgeons.
let me know if my explanation is bad. I will keep on re-explain until it is clear
What is the 2nd randomization for?
the 2nd randomization is choosing between 3 Doctors or 3 Surgeons.
if you get the "role" type of jobs.
if there's no "role" type of jobs like "Salesman" then just be "salesman", that's all.
Salesman, is basically like what we talked about earlier, the "Hunter" Array.
straight forward.
What keeps confusing me is the end result. Do you want there to only be 3 doctors OR 3 surgeons when the game starts, or 3 medical people randomized between doctor and surgeon, so that there can be 1 doctor and 2 surgeons in game?
Hi guyes I have a quick question, thank you in advance. My problem is, that when I try to get the game mode on my client blueprint, it says the game mode is null. I'm not using any dedicated server, just set the Unreal play setting to be (max player 2, play as client). Wondering if there is a way to launch the game mode into the simulated server so that the client can get it?
@dusky dome GameMode does not exist on clients. It only exists on the server machine.
this is the game mode class default
Do you want there to only be 3 doctors OR 3 surgeons when the game start
Yes. 3 doctors or 3 surgeons only. Whichever. Doctor/Surgeon.
so that there can be 1 doctor and 2 surgeons in game?
This part was what you asked earlier, which i then replied, that I am very afraid it will get complicated as learning purposes only.
right so for example, if i want to test my game locally without setting a dedicated server now, (possibly in the real game it will be an lan multiplayer), how could I do the setup?
The latter part, is definitely looks very advanced as you might need to* random for 3rd time (i think?)
@dusky dome The difference between Dedicated or Listenserver doesn't matter. If you try to get your GameMode on a client actor it will be null.
use "Listen Server"
oh i get it
Click the arrow at "Play" button and select Listen Server
so listen server means that the editor will server as both a server and a client, and if the player number is more than 1, the 2nd window will play as client, right?
Correct.
thanks!
LOL
thanks!
@timber cloak Okay. What gets changed based on the role? For example, you were making an array of Pawns? What were you doing to those if they were selected for being a Hunter?
Nothing changed based on the role. It is simply a name to recognise that it will be randomed 2nd time. Unlike Hunter, hunter is randomed once by being randomly chosen from the PlayerController Array.
So, hunter is the same as Salesman, Chef, and Dentist. All being randomize once.
Non-"role" name.
Those names with "roles" included, will be randomed again between the 2 choices stated. Like Medic Role, they will become as either Doctor or Surgeon.
But why? For example, what happens to a player or their pawn when they become a Doctor?
they will be given ability to perform as a Doctor occupation.
So, salesman, Dentist, Hunter, Chef will straight forward be given ability to perform their occupation respectively.
complicated as a learning skill, right?
So is it a setting in their Pawn?
i am thinking of struct of arrays containing arrays.
yes
ability is given on ThirdPersonCharacter class Blueprint.
if they get dentist, they just gain ability to do dentistry job like cleaning/fixing teeth
what would be your way of doing this? Using Enum/Struct?
definitely not data table, right?
datatables are for static final information that you want to load in
i see
I think majorly it comes down to how different the subroles are. Also how many of them there are. Because if the Subroles are the actual classes, and you just want to categorize them, I'd just put all of the subroles in a huge enum table and make an array out of the larger roles with the larger roles being an entry in the array with a sub array of the subroles.
or you could have an EducationManager taking inputs of your roles and assign them new ones based on what they're doing
or did you already cover that
a bit like a tech tree really
Not yet. Sorry, what is an EducationManager thing actually?
I mean you'd want one class to act as a manager for all your peons
so basically any time the peons have spent enough time as a role or fulfilled whatever conditions you have
they would query the manager
the manager would then assign them new roles based on the data parsed
Basically larger role repeats the blueprint from earlier. https://i.imgur.com/00SHoCFh.jpg
listening
the manager would really just be a glorified lookup function that takes the data, measures it up against what is currently available in the tech tree, and reports back its findings
replace tech tree with role tree in your case
but the principle is the same
enums would probably be a bit bulky for this but they could work
and tbh I don't see great alternatives for them
but maybe the likes of @twilit heath would know
tech tree, that means using data tables, correct?
I mean you could I guess represent it with data tables
since it's static
but you could probably find better ways of doing it too
perhaps a dictionary tree or some such cpp structure
I will try your way too. Thanks for the detailed inputs.
I'm trying to think of if it's possible to do in BP
same been thinking for a week since.
the tech tree
I reckon that you can't do it with structs
because you cannot link structs
of the same type
but
if you can link classes
you could link a series of BP objects as your nodes for your tech tree
those objects would need two variables
an array of next nodes to point to
and the conditions for reaching this node
that'll build a tree for you
or just do manually minus and plus until your BP is spaghetti
sorry just a quick question
okay basically the subclasses can be run Boolean switch
I know that playercontroller exist both on server and client, but yet in the Event BeginPlay, when I was trying to get the game mode, it gives me null
whereas the large/main class just repeat it and remove array index each time complete giving roles
is it normal?
my blueprint is derived from playercontroller class, so it should also be on both server and client, right?
no luck, 1 second delay
have you assigned a game mode in your project settings?
oh that could be the case! Let me try
no luck, default game mode (both server and local) are set to be the fpsgamemode
try asking in #multiplayer then
thanks!
dont have access to UE4 right now cant test it
What's the most efficient way to make a dialogue system that reads from a file?
Like line-by-line
is it possible to create a dropdown list in a blueprints Detail section which you populate dynamicaly when pressing a button(event trigger)
@ornate cairn what do you mean "most efficient"?
like I'm recreating a dialogue-heavy game in VR using UE4 and I have all of the dialogue already, is there a way to port that dialogue to the engine efficiently without having to go through a bunch of crap?
Also, how do I set up vr headset tilt as axis mappings for turn and lookup in engine input?
string tables
for your dialogue
or just data tables in general
depending on your needs
so I can't just import the file?
what is "the file"
I'm recreating DDLC in VR
it's a visual novel
so it's like tens of thousands of lines of dialogue
:/
but I have all of the dialogue already, so I'd prefer not to have to make it all all over again if possible and just read from a file
but I guess I can
:p
what file
the entire game
you still didn't answer the question
oh it's written in a simple dialogue format. I'd be putting it all line-by-line in a text file.
there are no trees
this is purely for import to the game
if you want to make tree structures etc.
you'll have to do that yourself
ok and do you know the answer to the vr question by chance?
I think it's just rotation rate and tilt, right?
in the motion menu>
it's really not specific on it in the docs
I don't do VR
Hey I'm trying to make my character controller to lunch off slopes here, but because the Third person controller is not Physics based i have to manually writes this.
I don't want the controller to be physics based.
How would I solve this issue?
Im thinking I need to get the Forward velocity based on the slope, and then launch it in that direction when the slope declines from the previeous tick right?
even that im not sure of how to do
ive been stuck on this for days now
a timer
but yes
your assumption is correct
if you're lucky then gravity is not necessarily physics based
the thing is im not sure how to go about it
how to blueprint it its a tiny bit over my head
woah that's super neat!
all vr is automatically set up in the editor already!@
if you play in vr it automatically sets up tilt controls
@void quest bro that games looks adorable!
basically repeated from earlier but with a selection
@timber cloak lol you still on the professions thing? ๐
looks sooo messy, does it work tho?
it wasn't made just now. All was trying to get an inputs from more people
ah
you could simplify a lot of htat down to a bunch of select nodes
not that I recommend it
I think there are better ways
coding is like a different way of thinking tbh
well yeah everything is ''just thinking''
i am still thinking
geez, 2am now and still haven't get my dinner. All was focusing on this alone
brb
cant think straight on an empty stomach bro
eat, drink , take a walk etc
refresh your mind
Programming at it's core is nothing more than the logical processing of numbers.
right, but youre almost like thinking backwards, you know the end result
you just need to get there
you'd be surprised. I reckon 80% of jobs require no thinking
lol fair enough
That's not programming, that's problem solving. Which I'd argue is applicable to many things. For example, you know what you want to paint, but you still have to do the brush strokes in order to get the correct look.
isnt coding just problem solving? lol
well, everything is problem solving
any employee working any job in the world is solving a problem
and tbh probably multiple problems at once
their own and other people's
without the gas station clerk the store would be unattended etc.
Not really. Designers can be told that certain functions do certain things and to use them that way. If you make the inputs names and don't give them any control over the inputs much, they can place nodes or call functions just like a programmer. But then ask the same person to understand how that function actually runs internally based on those parameters? They might not have even a vague idea.
yea but like, i just started unreal maybe 2 weeks ago, and im making a simple cooking system with my limited knowledge
i know what i want
but doing it requires a lot of problem solving
coding is like learning a language
i have an array of materials but cant assign material instances to it, if i change it to material instances i cant use "normal" materials, whats a solution to that?
there's grammar and there's vocabulary
i need different states, raw/cooked/burned. How do i get these states?
i made a cooking timer that ticks up to 3. 1 is raw 2 cooked etc etc
its a lot of small problems
or ideas
it really tickles your brain lol
i guess if you know more code it gets slightly easier but still
it's like any language
once you're fluent you can say complex phrases and discuss the finer topics of life
but in the beginning you're stuck with "hi how are you"
or in the case of programming, "hello world"
which I'm sure is an ominous portent of the future
yea like you know a few words and you can just make rough sentences
me want food
me hungry
pretty much
lol
Pretty much what Cranz said. And getting to the point that you're using complex phrases pretty much revolves around the requirement that you realize that everything in coding is just the logical processing of numbers. You can pretty them up with Enums or Strings, or Name style tags, but it's all just numbers.
Realizing that will make it all a lot easier to understand.
i mean the core computer is just binary right?
yes
but binary is more than just a number
it's also a logical switch
which is essentially what a transistor is
and a boolean variable
etc.
it's not just numbers but the perspective of "how can a number be represented"
enums are numbers, but to us they're strings
a boolean is a 0 or a 1
but it's still a number
Try having the array of type MaterialInterface, it should support both.
it's how everyone starts
then you realize there's a switch
and state machines are great
@loud coral thank you very much!
then you get a look into data structures, class hierarchy and polymorphism
etc.
little by little the world opens up
and if I wanted to be a bit poetic
it's the same world you start by saying "hello" to in your first piece of code
i have no idea what you just said
My first code was just MovieClips in Macromedia Flash ๐
Enemies are buttons that when you hover over they tell HealthBar to go to next frame. Health bar's last frame told the game to GotoAndStop DeathScreen.
haha nice
if you continue doing programming learning those things will become essential for you
they are like advanced grammar
so your code stops being code and starts becoming more of a system, and then later, an architecture
im still trying to figure out how to properly cast to without going insane after 2 weeks lol
'
casting is polymorphism
so if you understand polymorphism
you will understand casting
you turn shit into sheep?
Casting is incredibly simple. Do you understand class inheritance?
@trim matrix it's taxonomy of classes
Taxonomy (general) is the practice and science of classification of things or concepts, including the principles that underlie such classification. Originally used only about biological classification, taxonomy has developed to be synonym for classification (see Classification (general theory)).
Specific taxonomies include:
kinda understand how casting is supposed to work , just can never get it to work properly
mostly the object pin confuses me
If you understand the character inheritance chain. Character>Pawn>Actor, then you understand that an object that is a character can be cast to Character, Pawn, or Actor. Where as an object that is a Pawn, cannot be cast to Character, but it can be cast to Pawn or Actor.
think about how we share an evolutionary ancestor with monkeys somewhere down the line
but we are not monkeys
we share some traits though
Unreal passes around a lot of pointers as Actors, because it's one of the lowest classes, and therefore nearly everything can be cast to it. This allows you to pass Characters, Pawns, GameModes, PlayerStates, Apples, Oranges, Guns, etc all around as Actors if they derive from the Actor class. And then cast them back to their real class where you need them to be.
ahh ๐
@trim matrix Do you know how to use the Line Trace By Channel node?
the above is also an example of polymorphism. polymorphism translates into "many forms"
which is how you can have an object be one thing at one time and something else at another
purely by casting it back and forth
or, up and down, really
Imagine if you had to have a different line trace by channel node for every single actor type. LineTraceByChannelForActor, LineTraceByChannelForCharacter, LineTraceByChannelForPawn. That's going to add up fast when you have more than a few classes. Alternatively, Make one node that outputs everything as a hit actor, and allow casting to the type they want.
How can I set up collision on a static mesh component so that my character couldn't phase through it but the SM component would generate a sort of overlap event where I could get my character through casting?
create a collision box or sphere that does that
does the custom collision setting not do that?
any suggestions how to work of a list of cpu intense tasks without taking up too much cpu time?
basically i want that other events can happen in between each job (otherwise my editor crashes and the final game probably, too)
that's very vague
yea indeed, so rendering to rendertarget freezes actually my whole desktop
i have about 20 renderjobs to do, so im making a array now which i want to work of, but ideally there should be some delay between each job
are you meeting the minimum requirements for using UE4?
probably, are they carved in stone?
but im pretty sure that i meet them
it's just that it takes a while to bake a 4k texture from a material with 20 layers...
YO NED FIE MO GIGBITES
yea i need more vram indeed, 6gb ain't much when working with 4k textures ๐ญ
the baking is the optimization
๐
so i can go from 20 layer material to a simple with just 2-3 textures
yea or till it crashes (but not sure if the crashs may have been out of VRAM issues)
meh, starting a job in the onTick event seems to work around the freezing
still i hate to use onTick just for that... might delegate it to an actor or smth
sidenote, its about 1.2GB that are generated and compressed for 20 jobs :>
i guess that would freeze any machine for a while moment ๐
yeah you shouldn't really be doing that in BP
where else?
i do now
yeah that's silly
why not use a package thats made for rendering and baking textures?
like you know
blender
idk
because reasons, its not silly
if i could use prebaked ones i would use them obviously
i feel like youre way overcomplicating what youre trying to do
could someone give me some insight on how GAS could be implemented for a realtime strategy game?
or thats not useful and i should structure things myself
(im planning on replication)
For the sake of completeness, there's a meta specifier that achieves this: USTRUCT(BlueprintType, meta=(HiddenByDefault))
Holy hell trying to work with different elements that are on different levels is such a PITA
Currently I'm trying to hide the text on the HUD showing the vehicle's speed but destroying the actor doesn't make the text in the blueprint disappear
@narrow wyvern You need to aim directly the Widget reference or the text and call a Set visibility. You could also remove the widget from blueprint, but I wouldn't recommend this if it need to be toggle often
on developing tolls for learning and presentation.. issue on data table > control over spawned bp class with 3d widget component. each is different.. i spawn 10 copies of a bp class as is in data table.. failing to get 3d widget text to be controlled by data table and defined there, any1 willing to aid the servant of the race of men, screenshit dm only..
@elfin inlet If you go through the documentation you'll get everything you need to know regarding the GAS system. If you have an issue applying or understand something, then I'm sure some people will be able to help
Hm, I'm trying that right now @pearl rose Doesn't seem to be working :(
i've dug thru some GAS documentation, but i'm not sure how would it work with RTS gameplay
@brittle fiber It's hard to help you for that specific trouble without seeing the code. My guess is that you are not casting correctly to the 3d widget
The vehicle (and player) originally start out in this open world, and are then teleported to the garage area where the car is destroyed, but the HUD is remaining and I need to find a way to remove the HUD as well
My guess is that your In car Gear/Speed is not well set. Are you getting any error?
(Or exist multiple time, so when you set the visibility, you still have one bhind)
The only strange thing is that you are not aiming for a Widget reference. You are setting the visibility of a scene component, which is not the same as a UMG
@elfin inlet The same way it's working in any project? You need your question be more specific, what are you looking for exactly?
unit combat, unit production, resource gathering etc.
@pearl rose can i dm you?
i'd like to try GAS because it handles network well and does a good job of handling odd cases
clasified
@pearl rose Not getting any errors. I'm using the vehicle advanced template that comes with Unreal for this.
but i think how it works with the tag stuff, doesnt synergy with how a RTS game works
It's good for ability and specifically for ability that need to be use on network. You probably don't need the GAS for what you are mentioning
@brittle fiber Yes
doing everything with data assets and structs seems better to me
@narrow wyvern I do not use this template. First do you know where the widget get spawned?
@elfin inlet It mainly depend on the speed of your game I guess, unreal network is not perfect, the GAS help for very fast mechanic that need to be reliable over multiple client regarding what need to be display
I see, there isn't time-critical gameplay for me
So you can go without GAS
i just wanted to know if GAS would be worth implementing
From what you describe to me, no. After all, the best way to find out is to try ๐
at this point i'm thinking it could potentially flood the network with all the units using gas
because apparently GAS does everything to keep clients in perfect sync
It's possible, you'll have to deal potentially with syncing yourself some content, but could be worth if you have multiple hundred of unit spawned
wondering how would you do that with Select nodes? I am definitely in to learn all ways regardless. And of course proper coding and non-bloated ones would be nice.
i realised this way is actually can get messy once more Occupation is being added up, especially Subclass Occupation. This one subclass took my whole 20inch monitor screen size in one go =.=
your post really made me think bro
lol
how do i make collisions smooth as a skate park
when modeling
and implementing the models in unreal
sometime my shit flys through the models like "too fast sorry"
how do i make a model 100% solid
do you have ccd enabled?
ccd=?
continuos collision detection setting in physics for fast moving actors
okay, so i need to set this only for the pawn or the map
the thing moving and your collidiong with, your skateboard
matze you know something about physics constraints? using it to pick shit up but its all wobly and flies everything lol
okay
think its damping but theres no damping on the physics constraint
thats a pretty intense mesh for collisions ^^
i can add more damping to the physics object i can grab BUT itll make them fall super slow lol
you using complex as simple collision in the mesh?
trance?
@trim matrix try setting all limits to locked and projection disabled
there is a video of what happens
at about 2/3rds through the video the capsule passes through the ramp
yeah try setting ccd on the capsule and if that doesnt help you can lower the physic sim steps, but would be careful with that
@summer harness kinda works but now it just fucking everything up lol
so glitchy pushing it into stuff
looking that up
@trim matrix https://www.youtube.com/watch?v=trTeXPzhA2A thats how its supposed to work in games ๐
I know there's a way to do this that gets the Snark "stuck" to your feet, allowing you to fly upwards without walls nearby, but I don't know how to do it.
haha
so many hidden options ๐
thats a spring or soft constrain
click the magic v button and check if its enabled
they shouldnt hide the guts like that
should it be disabled?
i think i saw a autoexpand option in the engine somewhere but could be wrong
yeah disabled it, but youll have to snap your object yourself
linear movement is xyz right?
yes
most of the time i do grabbing like that just with lerp to grab pos and attach to socket
ah feels so much better now ๐
What is map and what is it used to do?
thanks matze!
@trim matrix you can for example store meshes by a name in a map with string as key and mesh as value, easy to search and check
see it like an array with a custom index
When should you implement it?
for example in a parser when you litarlly want to map values from one thing to another
Ohh so if I want to store some objects variable in a UI should I use maps then?
Like for example if you click on this button you will get this actor and if you press on the other button you will get another type of actor
Can it only store a mesh as a variable or was that just an example
how do you make the pretty straight lines?
@trim matrix just an example
Damn those lines look nice
@summer harness Can you choose yourself if the node itself is going to be default or not?
sry dont understand
you mean this? https://gumroad.com/l/IHfzV
An alternative flatter appearance of Unreal Engine 4 Blueprint nodes in a minimalist style. Improves the readability of nodes.Suitable for the latest version of the engine.To install, you need to unpack it into the folder with the engine with the replacement of files.This design pack does not affect the stability or performance of the engine in ...
Ohhh so you it is two different
if you're looking to make that tech tree we spoke about you can kind of fake that by having a ton of enums
the drawback is that you kind of have to do a lot of selects and they will boolean options
@summer harness Is the electric nodes plug-in just for the lines?
yes
https://github.com/pdlogingithub/UE4-Node-Graph-Assistant/blob/master/README.md unreal should implement these 3 ๐
@summer harness Are they all free?
no, but totally worth it
my chickens sizzling bois
will definitely get the node graph assistant and electric nodes
@summer harness why isnt that in unreal yet for free?
thats looks SO GOOD
"tons of enums" and "selects with boolean options" similar to what I showed earlier?
What action is this one? cant find it
oh.. nvm
im stupid
it was my byte variable
._.
haha i was just trying to look for it.
At first i was going to tell you that am new to BP so i wouldnt know but i thought maybe i could still find it @safe narwhal
Oh is k
im dumb and didnt realised what it was
at least i could figure it out on my own lol
haha yea, +500 XP
I didn't see your earlier options only that you had a bunch of isvalids
Is it even possible to reference blueprint classes in data tables?
i'm trying to add a "class to spawn" in my data table but it's not editable (atleast from the editor)
iirc it should be - what type did you make the column?
as in, did you make it an object reference, or a class reference
based on the color it looks like Building Master is an object reference
right, so if you want to refer to a BP class, make it a class reference. Then you should be able to set it in the data table
Object refs are references to specific objects, such as ones that are spawned in your level, so using that doesn't make a whole lot of sense in DT's :)
i tried that and i guess it was frozen, because it was still saying its unsettable
Ah
yeah they dont exist yet
thank you!!

This was shown earlier
can't we have like a list of enum with values attached (instance editable) on it, then make arrays for each randomly given job straight forward?
or that is only possible with C++ ?
never heard of map, now that is interesting to check out.
Thank you
can you replicate map in BP yet?
no that looks terrible and could be cleaned up with probably an enum and a couple of bools connected to a SetRole function
as of 4.25, no replication directly for map. but im sure there's work arounds
it is indeed terrible, that screenshot is only One Subclass. And it is already taking whole 20" inch monitor screen.
Imagine having 10 more of that.
wasn't there a quote from Tim Sweeney where he said something like "I meant to do TMap replication for Unreal 1" 
i might i get that struct might not be as efficient but that can replicate
dont be sharing my code
sorry, i fell down and some UE4 blueprints fell out of my pocket
blueprintsfromhell
honestly some of them are pretty impressive
Advent of Code is coming up in a few days. I made some crazy spagetti trying to solve those puzzles last year ๐ฉ
What's the proper way to put child components in a custom SceneComponent?
e.g. have a component I can place on my model that has some functionality and a mesh attached to it
Depends on where you're casting from and to what
Best way is to use an event on an Interface. It avoids a cast and you don't even have to check if it's implemented
yea but i only want the boolean to affect the thing im pointing/casting at
Line Trace will yield the actor it hits
Then send the boolean using an interface ๐
You should avoid casting in cases like these usually, since it creates an asset connection between unrelated classes
Sure
Simple functions in interfaces without return nodes are events
functions like these are normal functions ๐
this doesnt work
cause of the input I guess
pretty sure im being a big dumdum now
I'm not sure what you're trying to accomplish
You probably want to pass something other than self to the call target though ๐
so i got a line trace
to object
and when I press Q
i wanna send a signal to that object
for something to happen
Then you need to pass that object to the signal call
i already got something set up, cause I can pick up objects
but its on my player
and this
wich works
but i cant do the whole bolean stuff
cant i use the hit actor somehow?
Yes. Call the interface method on the hit actor
sorry im quite new
And implement the interface on whatever you're trying to hit
Just find a tutorial on how to use interfaces or look at the docs, it's not very complicated ๐
It doesn't matter what you're trying to send
The mechanism is the same ๐
You get a reference to another actor from the line trace and you can operate on it
Interfaces let you establish a common "language" between classes
yea but my parameters dont work lol
Not sure which parameters you're talking about
isnt there another thing you have to do since he wants to return the bool with that interface event
There's a ton of tutorials for exactly this on youtube by the way ๐ It's fairly straightforward.
like another node to handle that
Then it's a just an interface call of a function instead of an event
when I press Q on an object, send a signal to that object
โ๏ธ
is the problem the interface event never happens at all or that it happens but doesnt return your bool correctly?
just not sure how to set it up thats al
do you even have the interface event in your object, you havent shown it in a picture
you showed a function
You need to implement the interface on whatever actor you're trying to hit
Just look up the docs on blueprint-to-blueprint communication and/or interfaces
That's what they're written for ๐
Overview of when to use different methods of Blueprint Communications.
ya and on top of that once its implemented there will be a new event in your menu, thats the node you need in your graph to call your eat function
iirc if you are returning something with the interface, like your bool, theres an extra node to handle that part too i think
ah you so you cant just get the function? you need the event
ya it should show up once you implement the interface in the actor
the caller should be using the function
got it to work
somehow
heh
thanks both of you! youre the best ๐
@steady apex @languid lichen
just pretend theyr bones ๐
Yay!
all that headache just to replace an actor haha
bruh you cant put delays in functions?
how can i add two actor bps in one array
like get all actors of 1 get all actors of 2 put them in a array
What would be the best way to setup different hairstyles for the player to chose? Can anyone point me towards the right tutorial/doc to learn that?
trying to wrap my head around adding impulse to an object when it leaves a sphere. but I don't want it to ever have the impulse added more then the speed of the sphere its leaving + specified additional speed.... sounds like a logical statement.
Reality I get is A - It will always break the speed i want it gated at and B its calling the exit sometimes as soon as it enters the moving sphere anyone ever run into similar issues?
wait i got an idea..
When i add a camera to an actor, it Doesnโt get added to its child actors
Is there a way to do so?
@stray island Not sure what you mean? A child actor is a very vague term in unreal because it can mean a lot of things. It doesn't get added to classes that inherit from the class you added the camera to?
Um like i have a main enemy character , and i created a child actors of it , when i add a camera to the main it doesnt get added to childs
I have to add a camra to each child individually
That's odd. That's not normal behavior. You compiled the parent class?
hates the term Child used for inheritance lol
Yes , everything gets added to childs besides camera
@stray island Pure blueprint, no C++?
there is Editable when Inherited checkbox on components
you sure your Camera has that on?
Oh never mind i think I figured out that its not the main character i got the childs from
Thanks
Haha. Asking if the child's parent in the top right of their blueprint was the parent class was my next question.
So I have setup a dialog system that works by a dialog system that triggers events in the ui Blueprint. But how can I make it so I get typewriter text. (Text is typed out letter by letter) Here is the setup:
Hey. I have disable input and after that I would make it enable input after a while. How can I have the character have input held down during the phase of disable input and automatically register on enable input? Now I have to press the button again when enable input happens.
sorry fixed it was not the input enablers fault
Hi everyone! I'm trying to use SetTimerbyFunctionName on the Construct Script but seems like it doesn't even run. Function name and everything is correct but it's not working ๐ฆ Any idea? Thanks!
@marsh lintel Itยดs much better to use set timer by event instead as it is easy to forget the name of some functions later
@trim matrix My idea was to use evets at the start, but from the construct script it seems like it's not possible to create events :/
@marsh lintel use beginplay
Construction script is more of a level editing thing. I never tried setting a timer there but I'm not surprised it doesn't work
In a packaged game, all construction scripts for actors placed in a level are run in advance so those scripts don't even run at runtime
e.g.
I wanted to blink some lights and would be "fun" if we can already see the result from the editor instead on the game itself. But from all I've been doing and from what you just said, from BeginPlay would be the best choice.
Thanks! ๐
How can I make it so a behavior tree "remembers" if it already did something?
Same way that a brain does. Make a decorator for it and a bool to set. DidDoThisAlready? False or True?
@maiden wadi thanks
and make the bool randomly flip if you want real brain behavior ๐
Haha. No kidding.
At the moment, my brain is frying trying to work around this solar system orbit lane particle. I'm almost there though. Attempting to draw a simple solar orbit with nothing more than the gravity location, and the Periapsis and Apoapsis. Thankfully I'm doing this all in local space.
Hi do you know why in python, when i do a for loop to 4, it do the loop from 0 to 3 in the correct order
but in ue4 when i does that :
it give me this order ?
new lines are printed above old lines if im not wrong
^
so first it prints 0, then it moves it down to print 1 and so on
ok, that's why.
Newest line will always be on top.
And the index goes to 4 is that normal ? different convention ?
its inclusive
ok
It's to last index, not to length of loop.
you get one bonus iteration for free in unreal ๐
Haha
another question, do you know how to see what is inside a variable (for example a 2D array of int) ?
i could print each value
but is there a way to see it in a table or something more visual ?
maby save it it in json format ?
I think the blueprint debugger can do that? I haven't used it much.
I keep most of it sorted logically in my head and print them for a visual picture.
Try right clicking and putting a breakpoint on the SetArrElemINT and right click the array and WatchThisVariable.
ok, where can i see the value next ?
i have debug windows but it isn't showing the value
did you enable something to see it in the blueprint editor ? (other than the breackpoint and the see variable ?)
Nah. Just those two. Breakpoint on the print, and right click the 9square array icon pin and WatchThisValue
I'm out for a bit, but someone else might know better if you can't get it working.
ok, thanks
i'm trying to understand how the debugging in blueprint work
i have add debug filter, it help
I changed the blueprint to execute on begin play but now my viewport is black and i can only resume but it don't play every tick i think ๐ค
https://www.youtube.com/watch?v=sPC3QBPBocw
Hd version will be here in some minutes
thats a breakpoint like in visual studio, you are stepping through the code one by one, disabled debugging and it should run normal
Hello, I'm trying to detect where a hitr has happened on my character, but when I draw a debug sphere it looks like its in the wrong place, very wrong... any ideas?
oh, that is break point, ok, thanks ๐
I didn't know the existance of breakpoint, ok, thanks, the debug now work fine without breakpoint ( i just don't fully understand the data struct of the var but that's another issue $$ )
try printing the object name with get display name and check with what exaclty you are overlapping
if you only want to overlap your player character, cast other actor to that
dumb thought, is it possible to clear a string append?
https://docs.unrealengine.com/en-US/BlueprintAPI/Utilities/Text/FormatText/index.html i like this one for append with variables, bur youll have to cast to string
Format Text
i have an animated skeletal mesh and want to get another one that copies the exact movements, how would i go about doing that?
I am getting
LogScript: Warning: Script Msg: No world was found for object (/Game/Unlighted/DecalSystem/BP_MeshDecalActor.BP_MeshDecalActor_C:TEST_ComponentWithRef_GEN_VARIABLE) passed in to UEngine::GetWorldFromContextObject().
When i'm trying to get ChildrenComponents of SceneComponent based BlueprintClass from CallIneditor function on child component in blueprint editor. So there is no world context in blueprint editor on CallInEditor function ?
I think there is get editor world in editor blueprints
GetOwner also returns null actor reference when calling CallInEditor function from child component details in Actor Blueprint Editor
https://docs.unrealengine.com/en-US/Engine/Editor/ScriptingAndAutomation/Blueprints/index.html for in editor stuff its better to use these
Describes how to use Blueprints in the editor to automate content production tasks.
Yeah, I know. There is just a specific case where I need to copy vertices from spline component to another component in blueprint editor. So I need to get reference to child spline component somehow
Hey does someone mind helping me optimize a bit of code just so I can see how smart people do it? ๐
Depends on what it is.
its more like id like to know how YOU would of done it, so i can learn from it
it already works its just iffy haha
What is it though?
when it overlaps it begins a ''timer'' its a freaking delay
that increases the cookingtimer float
and im using that to control how cooked it is
its pretty flawed tbh
and then here i have it set up the different states based on the float
like it works.. somehow
but I feel like this is a terrible way to do it
You can ditch tick entirely by just calling a SetTimerByEvent where you're setting the boolean IsOverlapping. The boolean list of Raw, Cooked, Burned can be condensed into one Enum. The smoke component thing can be activated at the same time you set the enum for burned.
Not sure what enums are
