x

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"

Multiple characters share common events via interface

Hello,

I'm trying to setup multiple characters to share common blueprints.

Here's what I'm trying to do: I have multiple games with a single character connected to it, so I can quickly change the gamemode and it automatically changes the camera, inputs and stuff.

But now I want all my characters to share similar "code", and I'll be able to add/remove the event message I want that gamemode to use.

Problem: I'm unable to get the Fire Beam and Fire Rocket to trigger at all (the InputAction Fire in the characters work, tried with Print Text).

Could this be related to the parent class I've chosen for the Fire Beam and Fire Rocket? I've chosen the Actor.h parent class for those. What should I use instead?

Is this the right way of implementing this? Or should I use Blueprint Function Library or something instead?

Hopefully these images will help with what I mean/want to do.

Character: First Person

alt text

Character: Third person

alt text

Interface

alt text

Fire Beam (First Person)

alt text

Fire Rocket (Third Person)

alt text

Thanks for your time.

// Saucy

Product Version: Not Selected
Tags:
first_person.png (41.1 kB)
third_person.png (41.3 kB)
interface.png (10.8 kB)
fire_beam.png (30.7 kB)
fire_rocket.png (30.9 kB)
more ▼

asked Mar 12 '15 at 04:34 PM in Blueprint Scripting

avatar image

Ardoc
7 4 6

avatar image Erasio Mar 12 '15 at 04:52 PM

Where do you call those events? (in which class? Your character as well?)

Because the target for an interface call means the object / actor which should receive the event. If you plug in self... well then you might as well use a custom event as it'd do exactly the same thing ;)

avatar image Ardoc Mar 13 '15 at 03:39 AM

Every image you see are separated in their respected files, so I have 5 files right now. So first_person calls fire_beam via interface message, and then fire_beam should do it's thing (shoot a beam).

I'm not sure what I'm supposed to inject into the target of the interface message. Basically I want fire_rocket and fire_beam to shoot from the character that has those interface message calls.

Interfaces are pretty new to me, so forgive me for not understanding how they suppose to work. Am I better off making all custom events (fire_beam, fire_rocket, etc) in a single file and use that to call from the characters instead?

avatar image Erasio Mar 13 '15 at 11:56 AM

No no. That's actually the usecase for interfaces. All you need is to insert the target BP inside of the target pin.

You could even use the same interface and just switch the target depending on the mode or something like that. All you need is just the reference to that other BP.

avatar image Ardoc Mar 13 '15 at 12:22 PM

Alright, thanks! I'll play around with it.

avatar image Ardoc Mar 13 '15 at 06:15 PM

I followed this tutorial: https://youtu.be/ojvuTz4KCfE

It all works but when I tried to move almost everything to an interface event, everything stopped working. I still don't know how to reference the right blueprint. Because the blueprint I want doesn't exist in the world, it is spawned by the character pressing the Fire button.

Image album: http://imgur.com/a/sQof6#0

avatar image Erasio Mar 14 '15 at 11:18 AM

Wait wait wait... let me get this straight. You're trying to spawn the projectile from within itself? O.o

And that worked in any version? That is impossible. Straight up. No way you can spawn something from within itself. You can spawn the same instance a second time but if you just want to spawn a single instance of it you need to do that somewhere else. What you want to create is a paradox which therefore can not exist.

  1. You can only call that function when the projectile exists.

  2. The projectile can only exist when you call that function.

See the issue? What you need is a simple spawning function inside of a weapon or your character.

avatar image Ardoc Mar 14 '15 at 01:34 PM

Aha. I thought I could make the projectile a reusable thing so if I add more characters they could use that if I wanted to.

I'll keep it simple then and keep each character fire projectile in the character blueprint.

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

0 answers: sort voted first
Be the first one to answer this question
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