Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Creating Battle Zones

Hello, I'm currently working on a project thats RPG based. Think RPG on the style of... Kingdom Hearts maybe. Not inspired by but its a good example. I'm trying to think of a blueprint script for when the original character enters a distance from the enemy, Theres a "zone" in which combat is to take place. Until you defeat that enemy, you can't leave the zone. For instance, a boss battle. I would also like insight in leaving the zone or Escaping normal battles. I've seen a few tutorials on UE4 and setting up an RPG in 3rd person view but, no luck in thoughts for creating one. Also, I intend for the boundary to be visual. Not just an invisible wall. Anyone know any tutorial sites that explain this? I've tried searching on youtube but no luck so far.

Product Version: UE 4.20
more ▼

asked Aug 11 '18 at 04:36 PM in Blueprint Scripting

avatar image

6 1

avatar image ThompsonN13 Aug 11 '18 at 04:56 PM

what your saying doesnt make sense, first you say "Until you defeat that enemy, you can't leave the zone" then you say "I would also like insight in leaving the zone", which is it your looking to do? this whole system at its most simple would be like the bosses in zelda where the doors close and your stuck in a room with the boss right, in that case its a pretty simple thing to do in the level bp where you have a trigger volume that closes the doors when entered, then have another event based on the boss health. in the case of normal battles i imagine your talking about something akin to a combat mode where if the player is within range of an enemy they enter combat (unsheath weapon, anim change, etc). in that case theres many solutions such as using volumes on enemies or the player, line traces, perception range, etc. it really depends on the game your looking to make and the combat system involved. ive never played kingdom hearts so the example means nothing to me.

avatar image Shadowriver Aug 11 '18 at 10:18 PM

It makes perfect sense for me. What he want is system which you have optional escape option, common to bosses and normal battles without any needs of environment changes you proposing

avatar image ThompsonN13 Aug 11 '18 at 10:41 PM

what i was getting at was that the person wasnt explaining themselves well (contradicting themselves for one). they also didnt say how their combat system was meant to work. ive seen escape options in turn based games but they are not usually in real time games. real time you would usually just move away from the enemy to be out of combat. without knowing the combat system or specific details of what they want then it cant really be answered.

avatar image Asdene Aug 12 '18 at 06:44 PM

My bad. And Sorry for the late reply. I'm making a TPS RPG that fights in real time. The System i'm working on is normal exploraration. You're in an area able to move freely about, You see an enemy ahead and you enter within a certain range of that enemy and a field appears. Doesn't warp you to a Battle Level Scene or anything but a that field comes up and you draw your weapon right there and then. Sorry for the contradiction. I primarily want to know on a field you can not leave. I have interest in those you can but I want to know those you cant leave first and then work from there into a way you can for normal mobs that spawn about.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

On reading your question, I can only really suggest that you use a mesh of some description.

This would permit you to block character movement via collision as well as represent the barrier with a material on said mesh.

This mesh could be a cylinder with its faces inverted to face inwards towards the zone and could even be scaled depending on the size of the battle zone.

I'm under the assumption that these battles would take place in an external environment, and so an area that cannot be easily sealed off by doors etc.

An alternative would be to take the Devil May Cry approach in which demonic barriers appear at set locations to block your path. This would also be pretty easy to set up, depending on your gameplay and environment.

Does this help answer your question?

more ▼

answered Aug 12 '18 at 12:57 AM

avatar image

240 7 9 15

avatar image Asdene Aug 12 '18 at 06:48 PM

A demonic barrier like that in DMC is a perfect example for what i want to do. Seals off escape. But thats for boss. I want to make a barrier you can escape if you keep running in that direction without getting hit (After I make the one you cant run from of course). Your assumption is also correct. Not every boss will be in a room. So I need to have an idea of what I can do or cook up in a BP to make the player unable to leave no matter what they do.

avatar image Greywacke Aug 12 '18 at 09:44 PM

Okay, well in that case you aught to consider the principals of affordance (link just to help you generate some ideas).

Perhaps have two materials - one indicating that it permits the player to leave and the other indicating its impenetrability.

I was also imagining a material that fades in and out of transparency as the player moves in closer or further away (i.e back towards the fight) so that the bounds wouldn't always be visible from the center of the fight, but only as the player got close t them.

Regarding your requirement to permit escape if the player keeps 'running in that direction without getting hit', well that suggests to me a volume. You could use the overlap begin and end event to indicate whether the player is within the escape bounds, and the use a timer handle to trigger their release. Damage inflicted upon the player could then reset the timer, should you wish.

Such a volume would be able to move too, enabling the battle one to follow the position of the enemy/ player.

Of course, you could do the old trick of displaying a message stating that "You cannot flee from this fight" should the player attempt to escape from a battle involving a boss enemy, but I suspect that you would rather avoid such a crass approach.

Depending on your design - it could be cool to explain these barriers with lore and logic. Perhaps enemies that are of a certain type, level of intelligence or power, for example, have a greater capacity to maintain these barriers. What if the player could physically engage these barriers in order to escape? Just a few ideas - I really can't say whether they would work for you.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

create a trigger volume centered around the enemy, and wide enough that your or the boss' attacks will be out of range unless youre inside it. event onbeginoverlap, if cause by the player, activates the enemy and unlocks their apply damage functionality (like with a gate or boolean branch) event onendoverlap if caused by the player, deactivates the enemy behavior, resets their health, tells them to walk back to the starting point. That way if you flee the battle you have to try again from the beginning state of the battle.

more ▼

answered Aug 12 '18 at 02:54 AM

avatar image

3.8k 18 20 20

avatar image Asdene Aug 12 '18 at 06:49 PM

Hm. I like that idea. I'll try to implement this in a BP.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question