PDA

View Full Version : setBackground(string url)



JotaFaD
01-24-2017, 02:20 PM
This function would give scripts the ability to change a room's background to the one specified in the url parameter. A possible usage I thought about is: Imagine you have a deck with cards that represent locations (e.g. "Rain Forest"), when this card is draw the scripter could intercept the event and change the background to a rain forest one.

Mark
01-25-2017, 02:28 PM
I've actually suggested this before and I completely agree!

Here's a link to the thread. (http://www.berserk-games.com/forums/showthread.php?3095-Changing-the-Background-using-Scripting)

MrStump
01-25-2017, 11:50 PM
There is already a scripted way to do this I think.

Somebody posted to the workshop a notecard. It had little green go pieces attached on each line to indicate a selection and red ones to indicate non-selected ones. You could switch the room image.

I may be miss-remembering, but I am all but certain I had it open before and looked at the code to see how it was done. Dang it, I can not find it in the workshop right now. Anybody help me out?

EDIT: Good news, bad news. Good new, found it.

http://steamcommunity.com/sharedfiles/filedetails/?id=724778190&searchtext=

Bad news, it was just for table edits, not room. Sorry. =(

Lucky seven
01-26-2017, 12:15 AM
You can actually achieve what your asking for right now if you add in your own Inverted sphere to the room.

So you create a sphere either 1200 or 1800 units across or there abouts (the smaller one is for if you use the"Custom" Background setting)

Invert the normal's on it and UV map it to accept your background image.

once you've set it in your room script it to be un-interactable and it will be indistinguishable from the current custom backgrounds but with the advantage of being a tangible object you can manipulate with scripts :)

Modelling wise its just a UV sphere with enough vets to ensure the surface is visually smooth.

Knil
01-27-2017, 12:21 PM
You can actually achieve what your asking for right now if you add in your own Inverted sphere to the room.

So you create a sphere either 1200 or 1800 units across or there abouts (the smaller one is for if you use the"Custom" Background setting)

Invert the normal's on it and UV map it to accept your background image.

once you've set it in your room script it to be un-interactable and it will be indistinguishable from the current custom backgrounds but with the advantage of being a tangible object you can manipulate with scripts :)

Modelling wise its just a UV sphere with enough vets to ensure the surface is visually smooth.

This is what the current custom background is basically :)

Mark
01-29-2017, 06:01 AM
You can actually achieve what your asking for right now if you add in your own Inverted sphere to the room.

So you create a sphere either 1200 or 1800 units across or there abouts (the smaller one is for if you use the"Custom" Background setting)

Invert the normal's on it and UV map it to accept your background image.

once you've set it in your room script it to be un-interactable and it will be indistinguishable from the current custom backgrounds but with the advantage of being a tangible object you can manipulate with scripts :)

Modelling wise its just a UV sphere with enough vets to ensure the surface is visually smooth.

That wouldn't work for changing the Lighting too. The giant model will also block the light source so there'll be no shadows under objects any more.

Lucky seven
01-29-2017, 12:40 PM
The giant model will also block the light source so there'll be no shadows under objects any more.

That's not how it works Mark. . Take a look at one of the "Full Room" DLC's to see what I mean. objects still retain and cast their shadows even when inside other meshes, if the conditions are right to do so.

The sphere has its normals on the inside, so if you were to stand outside of it and look in it would appear invisible. :)


That wouldn't work for changing the Lighting too.

Very true. But in my defence there was no mention of changing the lighting in the O.P's post just.



the ability to change a room's background to the one specified in the url parameter

and applying a custom background to your own mesh would I think give you this ability with the scripting tools currently available.

Mark
01-29-2017, 12:54 PM
That's not how it works Mark. . Take a look at one of the "Full Room" DLC's to see what I mean. objects still retain and cast their shadows even when inside other meshes, if the conditions are right to do so.

The sphere has its normals on the inside, so if you were to stand outside of it and look in it would appear invisible. :)

Oh, right. You can tell I'm not that experienced with modelling.


Very true. But in my defence there was no mention of changing the lighting in the O.P's post just.

It's not that useful if you can't change the lighting too IMO. We really just need actual features implemented to do this stuff. Go to the thread I linked to at the top to see my thoughts on how it could work.

Lucky seven
01-29-2017, 01:06 PM
It's not that useful if you can't change the lighting too IMO. We really just need actual features implemented to do this stuff. Go to the thread I linked to at the top to see my thoughts on how it could work.

yeah. . . I do agree. lighting control would be extremely useful. It can make or break the atmosphere your trying to create in a room.

Its no secret that giving lighting control to the players is right up there on the Dev's wish list, but as I understand it.The way HDR images are currently handled will require quite a bit of an overhaul to make it happen. :(