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"

Spawning lights at night time

I have a city level with movable sunlight + atmospheric fog. I would like to know if its possible to spawn movable lights on my lightpoles when the sun is nearing the horizon. I have the lightpoles blueprint setup with spawn function but not sure how to spawn lights when its night time.

Product Version: Not Selected
Tags:
more ▼

asked Mar 11 '14 at 02:49 AM in Blueprint Scripting

avatar image

ue4-archive ♦♦ STAFF
50k 3670 2000 9124

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

2 answers: sort voted first

You can either create the light component with the rest of the lamp post and just toggle it's visibility, or use the AddComponent node to create it at runtime.

more ▼

answered Mar 11 '14 at 02:49 AM

avatar image

ue4-archive ♦♦ STAFF
50k 3670 2000 9124

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:49 AM

Hi James,

I know about visibility and AddComponent but my question was how can i spawn them at night time only. In my current level i can move the suns direction using mouse wheel. So when the sun gets near to the horizon i want these lightpoles to spawn lights. The lightpole itself is a blueprint asset but am not sure how to make this blueprint know that the sun is near the horizon so it can spawn lights. I hope you got the idea. :)

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:49 AM

how are you moving the sun with mousewheel?

how is that set up exactly?

Rama

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:49 AM +

Exactly. Am already using that method to set suns evening color. I have printed suns position to the screen and got the value and its all set. But my question is how can i pass that value to my lightpole blueprint? Note that they are assigned only at runtime.

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

oooooooooooh

so your is issue is you are wanting to communicate across blueprints

got it

What you want is Blueprint Interfaces

"Adding Functions Functions are the primary component of an Interface. Interface functions have no implementation. They exist simply as a definition of inputs and outputs. These can be used to send data through the interface, "


:)

there's a forum discussion about cross blueprint communication using interfaces here:

"It looks like I can't access the variables of a blueprint from another blueprint " http://forums.epicgames.com/threads/974326-Game-Jam-Mougli-s-thread?p=31669687&viewfull=1#post31669687


Passing Data Through Blueprint Functions


Lauren Ridge: Make sure to add the interface to both the Blueprint that you want to call the interface (for example, a planet) and the Blueprint that you want to implement the interface (for example, a moon).

More links and details in her entire post:

more ▼

answered Mar 11 '14 at 02:49 AM

avatar image

ue4-archive ♦♦ STAFF
50k 3670 2000 9124

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:49 AM

Hi Rama,

I am already using interfaces but still its not working. To better illustrate the problem i'll post some screenies.

So in my RoadSideWalk Blueprints am spawning Lightpole_BP like this:

SpawnBlueprint

Then in my Sun_BP am calling the interface functions like this (I can see both print strings on my screen):

Sun_BP

And this is my Lightpole_BP events that never get fired. These events are there to make the lights illuminate. :(

Lightpole_BP

My doubt is since am spawning new instances using SpawnActor, these Interface Events in Sun_BP are not registered for the new instances....am i right?

image1.png (178.6 kB)
image2.png (392.9 kB)
image3.png (252.4 kB)
avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:49 AM

does the interface exist in the lightpole as well? Something Lauren mentioned?

That both classes must have it?

I cant help much here since I dont use blueprints myself, hopefully someone else with more experience can assist :)

Wishing you luck with this!

Rama

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:50 AM +

can you please post at least part 1 of your sun tutorial soon

I really really wanna know how to move the sun around in the sky :)

I never figured it out in UE3 :)

Rama

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:50 AM

Am going to post a new thread on Rocket forum. I will explain sun movement there plus some other stuff. :)

(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