Please login or register.

Login with username, password and session length
Advanced search  

News:

For WME related articles and tutorials visit WME Resource Center.

Author Topic: more lights  (Read 4469 times)

0 Members and 1 Guest are viewing this topic.

tinchopunk

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 90
    • View Profile
    • martinarregui.tumblr.com
more lights
« on: January 27, 2005, 12:37:23 AM »

hoy can i make a signal...
1)green, yellow and red light obni in 3ds.
2)i want to only see one of them but for a time like 1 minute red and green and yellow only 1sec...
3)change color of the signal
4)active animation of the cars and tuks only when is green
5)active walk over the street when is red...
thanks
     MArtin
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: more lights
« Reply #1 on: January 27, 2005, 08:29:39 AM »

See the scripting methods of Scene object, namely EnableNode3D, DisableNode3D, EnableLight, DisableLight and SetLightColor. Using them you can enable/disable lights and blocked areas or even change light color at runtime.

The rest is just a matter of several variables and "if" conditions.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

tinchopunk

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 90
    • View Profile
    • martinarregui.tumblr.com
Re: more lights
« Reply #2 on: January 28, 2005, 12:08:54 AM »

ok but about the time?? it´s and if? or some while option??
thanks
 Martin

ps:can you make a mini exaple?
Logged

revvin

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 36
    • View Profile
Re: more lights
« Reply #3 on: January 28, 2005, 01:48:36 AM »

Hi,
You'll find that the script language used in WME is very similar in structure to a number of high-level languages. You would probably benefit by teaching yourself some of the basics of scripting. If you are already versed in basic scripting - sorry...  :-[

But if you are not... then this should help:

I found this after a brief search on google - http://www.phys.ualberta.ca/~tluchko/academic/2004/420/fortran_basics/fortran_basics.html
Its for "Fortran" but looks as though it explains the basics of FOR, IF, WHILE loops quite nicely and should help you learn WME more easily.

http://www.modula2.org/tutor/chapter1.php
This also looks like it could be a useful Tutorial. I havent had a proper read - but they look like a similar structure.

Failing that - maybe find a book on scripting ?

I am definitely no wizard - but I learnt Turbo Pascal at college a few years back - and the fundamentals are very similar... and I am picking up this WME very quickly

Hope that helps... ?
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: more lights
« Reply #4 on: January 28, 2005, 10:42:21 AM »

ok but about the time?? it´s and if? or some while option??
thanks
 Martin

ps:can you make a mini exaple?
You can add something like this to the end of scene_init.script of a given scene:

Code: [Select]
// this global variable will be set to true if red light is on
// you can reference it from other scripts when needed
global IsRedLightOn;

// endless loop
while(true)
{
  // turn on the red light and turn off the green light
  Scene.EnableLight("red_light");
  Scene.DisableLight("green_light");
  IsRedLightOn = true;
 
  // add some other red-light related actions, such as playing some animations etc.
  var Traffic = Scene.GetNode("traffic");
  Traffic.SetSprite("path\cars_running.sprite");
 
  // wait for 30 seconds
  Sleep(30000);
 
  // switch the lights
  Scene.EnableLight("green_light");
  Scene.DisableLight("red_light");
  IsRedLightOn = false;
 
  // again, some green-light related code, for example stopping the traffic animation
  Traffic.SetSprite("path\cars_standing.sprite");
 
  // wait for another 30 seconds
  Sleep(30000);
   
  // and now the loop will start over, switching back to red light et cetera, et cetera...
}

Note that this code snippet should just give you an overall idea, you will need to modify it to suit your needs.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

tinchopunk

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 90
    • View Profile
    • martinarregui.tumblr.com
Re: more lights
« Reply #5 on: January 29, 2005, 06:34:18 AM »

thanks mnemonic that really help a lot... i making a lot of graphics and i a litle bit lost in programing right now...
 Martin
Logged
 

Page created in 0.035 seconds with 20 queries.