Please login or register.

Login with username, password and session length
Advanced search  

News:

IRC channel - server: waelisch.de  channel: #wme (read more)

Author Topic: SetLightPosition doesn't work when called from plugin!  (Read 4433 times)

0 Members and 1 Guest are viewing this topic.

ErV

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 54
  • I regret nothing!
    • View Profile
SetLightPosition doesn't work when called from plugin!
« on: October 12, 2006, 07:04:57 PM »

Hello.
For some reason, SetLightPosition doesn't work when called from my plugin. It makes shadow disappear instead of changing it's direction. However, when SetLightPosition is called from script, it works fine, even with same coordinates.
Here is the code (actor is initialized earlier):

   IWmeParamSet* paramSet = game->CreateParamSet();
   paramSet->Clean();
   paramSet->AddParam(50.0);//xPos);
   paramSet->AddParam(50.0);//yPos);
   paramSet->AddParam(50.0);//zPos);
   actor->CallMethod("SetLightPosition", paramSet);      
   game->DeleteParamSet(paramSet);

What's the problem? I've even tried passing ints instead of floats, but shadow keeps disappearing. The actor holds correct reference (I've checked this several time - it has type of "actor3dx", and contains valid name). So, what is the reason of this, and how this problem can be solved?
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: SetLightPosition doesn't work when called from plugin!
« Reply #1 on: October 13, 2006, 07:09:21 AM »

Hmm, I don't know, it looks like it should work. I'll have to test it.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

ErV

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 54
  • I regret nothing!
    • View Profile
Re: SetLightPosition doesn't work when called from plugin!
« Reply #2 on: October 13, 2006, 12:25:37 PM »

It looks like SetProperty() function of IWmeObject\IWmeValue doesn't accept neither doubles nor floats.
I've tried to do lightPos adjustment in script (using data passed from plugin), and every time I'm calling SetProperty() with a floating-point argument, script gets zeros instead of floats, while passing ints work fine. I'm not sure if this is a bug, or if I am doing something wrong way, but the only workaround I've found so far is to create IWmeValue*, use it's SetVal function, and pass this IWmeValue* as parameter.
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: SetLightPosition doesn't work when called from plugin!
« Reply #3 on: October 13, 2006, 12:39:10 PM »

Aeugh... >:( You're right, I found it, it's a bug. I'll fix it later today.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: SetLightPosition doesn't work when called from plugin!
« Reply #4 on: October 13, 2006, 05:26:27 PM »

A fixed version of wme.exe can be downloaded here (WME 1.7b1).
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

ErV

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 54
  • I regret nothing!
    • View Profile
Another bug?
« Reply #5 on: October 13, 2006, 06:54:54 PM »

I've found another problem with setLightPosition.
If LightPosition uses world space transform, then it looks like X and Z parameters gets swapped when they are passed from script. I mean - when I call SetLightPosition(x, y, z) the shadow looks like I've been using
SetLightPosition(z, y, x) (I've written daemon script that prints actor3D coordinates as well as lightPosition coordinates to check this).

Is this a bug?
« Last Edit: October 13, 2006, 08:36:21 PM by ErV »
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: SetLightPosition doesn't work when called from plugin!
« Reply #6 on: October 14, 2006, 12:31:52 PM »

*sigh* Fixed, same link as above.
It's interesting no one reported this problem before, I'm pretty positive some people did use SetLightPosition before..
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

ErV

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 54
  • I regret nothing!
    • View Profile
Re: SetLightPosition doesn't work when called from plugin!
« Reply #7 on: October 14, 2006, 02:57:58 PM »

*sigh* Fixed, same link as above.
It's interesting no one reported this problem before, I'm pretty positive some people did use SetLightPosition before..
LOL

I think that most of them just didn't try to make moving shadow... :)
Logged

leucome

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 86
    • View Profile
    • Leucome Games
Re: SetLightPosition doesn't work when called from plugin!
« Reply #8 on: October 14, 2006, 09:56:16 PM »

Maybe with stencil shadow it became more interesting to have an interactive shadow. Like me I want to have the shadow projected by my campfire and i never Thought about  it before ..
Logged
Look my Site ——► http://news.leucome.ca

ErV

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 54
  • I regret nothing!
    • View Profile
Re: SetLightPosition doesn't work when called from plugin!
« Reply #9 on: October 14, 2006, 11:18:12 PM »

Maybe with stencil shadow it became more interesting to have an interactive shadow. Like me I want to have the shadow projected by my campfire and i never Thought about  it before ..
Many games has (or had) an interactive, but flat shadows. I've seen games that had a single interactive shadow with a large number of light sources. (IMHO)It doesn't matter if shadow is flat, or if it is stencil, or just if is just a blob - as long as shadow fits game purpose and looks nice enough. Anyway it's good that this bug is fixed, isn't it? :)
Logged
 

Page created in 0.058 seconds with 23 queries.