Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Feature requests and bug reports
Bug Fixes

just_in_case
Moderator
Quote
2023-02-04 06:16:34

Yes, I can create a new attribute or API command to change the direction of the spotlight programmatically, but still I won't be able to do any editor-related stuff, I tried doing similar with sound nodes to have pitch and speed and other functionlaity and they did work but only for the first sound node in the scengraph, except that sound node all other sound node not gets embedded into the game.
So I am not sure if adding the attribute for direction for the spotlight, will have a similar issue of having it work for node or not.
But yeah, I can create an API command for it, but it would have been much better if we have the direction attribute built directly into the editor, and also exposed to the scripting api.


Robbo
Guest
Quote
2023-02-04 10:00:33

Cool - I think you can do it !
I only need it for a single node anyway - the player spot light.

It would appear from some testing that I only needed to get the Camera Target and normalize it to get the new Direction for the Directional Light / Spot Light (seemed to work ok).

If you get something working please post somewhere so I can test it out - before next years update....I'm able to use Studio now...


Guest
Guest
Quote
2023-02-04 11:42:04

Can we make a spotlight by using a point light with a mesh that block the light from all other angle, light a real Spotlight did?


just_in_case
Moderator
Quote
2023-02-04 11:44:58

I didn't understand what you wanna achieve but by going to irrlicht/irredit properties, you can change the type of light from point to spotlight and it will act as spotlight. So don't really get why we need a mesh that blocks the light from directions.


Guest
Guest
Quote
2023-02-04 12:11:12

Yeah we can’t do that, the light still go through the mesh anyway. Only directional light get block by mesh when shadow on


Robbo
Guest
Quote
2023-02-04 13:19:54

Well damn - I just got it working !

I just edited the "CFlaceLightSceneNode.cpp" file to include direction on Spot lights and badda boom - she works now Hah !

Then I ran this code below every 20ms in the CCB file:

var mouseX = ccbGetMousePosX();
var mouseY = ccbGetMousePosY();
var end = ccbGet3DPosFrom2DPos(mouseX, mouseY);
end.normalize();
ccbSetSceneNodeProperty(spot, "Direction",end);


Runs quite well now....crap...in Debug mode for Win32


Robbo
Guest
Quote
2023-02-04 13:27:21

For someone with zero knowledge of C++ was able to do this in a few minutes (once I found the file to update) - don't know why Niko didn't think it was worth his few seconds to update...


just_in_case
Moderator
Quote
2023-02-04 13:40:15

The client source of CC is different than the editor source or final source of CC, so it is not just copy pasting stuff or adding lines of code, he needs to make sure that the code doesn't break other stuff. If you have seen the twitter image of the preview of Darkmode of CC then you might already have seen it, there was an extra parameter "Reload Shadow Shaders" in the attribute section of root scene node, which is not in the final version of the editor, that code was there for debug version of the editor only.

btw glad that you are able to find a fix for your problem. Even if that file gets updated , it won't show the direction attribute in the irrlicht/irredit options, but it can only be accessible via scripting api.


pmax
Registered User
Quote
2023-02-04 21:51:25

@Robbo
I don't know if it helps you, try these steps.
1)enable the menu irredit\irrlicht properties
2)create a Directional light
3)select the direction target
4)turn the Directional light into spot from the irredit\irrlicht properties menu.
5)move the selected target ( important if you deselect the target it disappears).


Robbo
Guest
Quote
2023-02-05 01:36:51

Thanks pmax but was using that method before.

For a torch/flashlight effect however this cant be used as previously spot lights had no Direction attribute - after my change now it does in the source code so can now change direction just like a Directional light.

Niko would have to add the 2 small changes though for anyone else to use this. When he does I would publish a free CCB with code to show player flashlight.


Robbo
Guest
Quote
2023-02-05 05:55:39

I just just worked out how to change FPS camera rotation speed, jump speed and 'can fly' options and they are all working now....was not even hard to do....hahah....oh dear...this is fun....

Not sure if Nio will add to the list this year....well see....


Robbo
Guest
Quote
2023-02-05 07:03:40

Possible new commands for the FPS camera controller are:

Player1.rotationspeed
Player1.jumpspeed
Player1.canfly

Updated using the 'Set or Change a Variable' command just like you already do for health, movementspeed and damage.

See if Niko wants toa dd that in...


just_in_case
Moderator
Quote
2023-04-25 18:12:30

Fixed a major bug that was breaking the command ccbSetSceneNodePositionWithoutCollision() when using physics simulation. It now changes the position without the collision even when using physics simulation.


okeoke
Registered User
Quote
2023-04-25 18:52:01

Could you please tell when it's going to be released? I think this will fix my sheep driving game:)

wrote:
Fixed a major bug that was breaking the command ccbSetSceneNodePositionWithoutCollision() when using physics simulation. It now changes the position without the collision even when using physics simulation.



luposian
Registered User
Quote
2023-04-26 07:29:48

SHEEP driving game? Now THAT sounds fun! I'd like to see some screenshots! What are they driving? Dune buggies? Golf carts? Go carts? Sounds zany!

I can hear the knee-slapping bluegrass music already!

wrote:
Could you please tell when it's going to be released? I think this will fix my sheep driving game:)

wrote:
Fixed a major bug that was breaking the command ccbSetSceneNodePositionWithoutCollision() when using physics simulation. It now changes the position without the collision even when using physics simulation.



Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internationa?" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact