Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (dr_panther, 1 invisible), 620 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
[req] simple traffic light w/ red,yellow,green animation #357010
02/05/11 07:33
02/05/11 07:33
Joined: Aug 2008
Posts: 81
J
jpxtreme Offline OP
Junior Member
jpxtreme  Offline OP
Junior Member
J

Joined: Aug 2008
Posts: 81
I already have some traffic light models but they don't have animations. I cannot figured out how to animate the model to make the color change. I'm really a noob in model making in MED.

If someone is kind enough to share or better yet animate this model. Just 3 frames of animation is enough. The frame 1 is for red and then next is yellow then green. Then I really be thankful because It's a big help for my simple car game.

here's the link...

traffic_light.MDL


Hoping for someone to lend a hand. Thanks!

Re: [req] simple traffic light w/ red,yellow,green animation [Re: jpxtreme] #357031
02/05/11 09:41
02/05/11 09:41
Joined: Sep 2003
Posts: 303
Germany
Clemens Offline
Senior Member
Clemens  Offline
Senior Member

Joined: Sep 2003
Posts: 303
Germany
Did you already try to realize that effect with a dynamic light, switching its position and changing its color?

Edit: Oh and by the way: a look inside the model shows me that it has a lot of polygons related to its extreme low poly look.

Last edited by Clemens; 02/05/11 09:44.
Re: [req] simple traffic light w/ red,yellow,green animation [Re: Clemens] #357140
02/05/11 19:48
02/05/11 19:48
Joined: Jul 2002
Posts: 5,181
Austria
Blattsalat Offline
Senior Expert
Blattsalat  Offline
Senior Expert

Joined: Jul 2002
Posts: 5,181
Austria
Hi,

The easiest way to create the effect would be exchangable textures for every state of light set up.

Another way would be hiding (or creating in realtime) models underneath the unlit lights that have a lit texture on them. Then either animate them to hover over the unlit version of themselfs or create them via code during runtime.

Another way would be shaders, but thats not a beginners way.

I would highly recommend to create this stuff by yourself instead asking others to do it for you. its harder and more time consuming but you will learn quite a bit about models, textures, meshes and problem sollution that way.


just give it a try,
cheers


Models, Textures and Levels at:
http://www.blattsalat.com/
portfolio:
http://showcase.blattsalat.com/
Re: [req] simple traffic light w/ red,yellow,green animation [Re: Blattsalat] #357145
02/05/11 20:14
02/05/11 20:14
Joined: Apr 2005
Posts: 653
Germany
D
Det Offline
User
Det  Offline
User
D

Joined: Apr 2005
Posts: 653
Germany
Hello !

If you need a code for a Trafficlight I have it but it`s not Lite C it`s C Script that works with a Traffic Light Model but you must to modify the C Script Code in to a Lite C Code Let me know if you want the code .


Wissen ist macht.
Nichts wissen macht auch nichts.

A7.86
Re: [req] simple traffic light w/ red,yellow,green animation [Re: Det] #357202
02/06/11 01:49
02/06/11 01:49
Joined: Aug 2008
Posts: 81
J
jpxtreme Offline OP
Junior Member
jpxtreme  Offline OP
Junior Member
J

Joined: Aug 2008
Posts: 81
@det

I would like to see your code if I can convert it to lite c. The most easiest way to do it would be changing the model by coding. Model 1 has red light model 2 has green light and 3 for red light.

I think this is easy for a noob like me. Thanks all for the response.

Re: [req] simple traffic light w/ red,yellow,green animation [Re: jpxtreme] #357344
02/06/11 19:27
02/06/11 19:27
Joined: Apr 2005
Posts: 653
Germany
D
Det Offline
User
Det  Offline
User
D

Joined: Apr 2005
Posts: 653
Germany
Hi jpextreme !

Ok here is the Code in C Scipt for your Trafficlight :

Code:
var ampelvar = 1;

function ampel_event()
{
  while (ampelvar == 1) // wenn Ampel an 
  {
    my.skin = 1; //grüner Skin  green skin
    my.lightrange = 1000; //Reichweite des Lichts range of light 
    my.red = 0;
    my.green = 255; 
    my.blue = 0;//grünes Licht   green light 
    waitt (960); //warte 60 sek
    my.skin = 2; //gelber Skin
    my.lightrange = 1000; //Reichweite des Lichts  range of light 
    my.red = 255;
    my.green = 255; 
    my.blue = 0; //gelbes Licht  yellow ligt 
    waitt (32); //warte 2 sek
    my.skin = 3; //roter Skin    red skin 
    my.lightrange = 1000; //Reichweite des Lichts  range of light 
    my.red = 255;
    my.green =0; 
    my.blue = 0; //rotes  Lcht    red light 
    waitt (240); //warte 15 sek   wait 15 seconds 
    my.skin = 2; //gelber Skin    yellow skin 
    my.lightrange = 1000; //reichweite des Lichts
    my.red = 255;
    my.green = 255;
    my.blue = 0; //gelbes Licht   yellow light 
    waitt (32); //warte 2 sek     wait 2 seconds 
  }
}

action ampel  // Tis is the Trafficlight Action 
{
  my.event = ampel_event();
}




I wrote some Comments for you in English so you can understand it better .

Last edited by Det; 02/06/11 19:30.

Wissen ist macht.
Nichts wissen macht auch nichts.

A7.86
Re: [req] simple traffic light w/ red,yellow,green animation [Re: Det] #357349
02/06/11 19:35
02/06/11 19:35
Joined: Jan 2011
Posts: 797
Da wo du nicht bist! Muhahaha!
xxxxxxx Offline
User
xxxxxxx  Offline
User

Joined: Jan 2011
Posts: 797
Da wo du nicht bist! Muhahaha!
Det why do you wrote waitt(960);! It should be wait(-60);
and you forgot () after action ampel!
Sorry for my english!
mfg
xxxxxxx


Es ist immer wieder erstaunlich, dass Leute die riesen Scripte schreiben die einfachsten sachen nicht können zb. mich mit SIEBEN x zu schreiben! tongue
Re: [req] simple traffic light w/ red,yellow,green animation [Re: xxxxxxx] #357362
02/06/11 19:57
02/06/11 19:57
Joined: Apr 2005
Posts: 653
Germany
D
Det Offline
User
Det  Offline
User
D

Joined: Apr 2005
Posts: 653
Germany
Ich weiß nicht was Du hat der Code läuft 1A zumindest in der A5 lief der Code so wie er da steht das kann man so lassen . Man kann es schon ändern aber ist nicht nötig.

Mußte ihnm in Englisch Antworten

Last edited by Det; 02/06/11 20:00.

Wissen ist macht.
Nichts wissen macht auch nichts.

A7.86
Re: [req] simple traffic light w/ red,yellow,green animation [Re: Det] #357368
02/06/11 20:07
02/06/11 20:07
Joined: Jan 2011
Posts: 797
Da wo du nicht bist! Muhahaha!
xxxxxxx Offline
User
xxxxxxx  Offline
User

Joined: Jan 2011
Posts: 797
Da wo du nicht bist! Muhahaha!
Ich hab halt A8 und da heißt es wait() und nicht waitt jedenfalls kam mir das noch nie vor und in a8 muss man wenn ma sekunden angeben will ein - davor machen, ansonsten wartet die engine dort soviele frame-zyklen wie man angibt und bei uterschiedlichen frameraten kann die zeit dann variieren! Wenns in a5 leuft is gut esseiden er benutzt kein a5!
mfg
xxxxxxx


Es ist immer wieder erstaunlich, dass Leute die riesen Scripte schreiben die einfachsten sachen nicht können zb. mich mit SIEBEN x zu schreiben! tongue
Re: [req] simple traffic light w/ red,yellow,green animation [Re: xxxxxxx] #357372
02/06/11 20:19
02/06/11 20:19
Joined: Apr 2005
Posts: 653
Germany
D
Det Offline
User
Det  Offline
User
D

Joined: Apr 2005
Posts: 653
Germany
Nein benutzt er nicht ich vermute A7 oder A8 aber ich hab ihm schon gesagt das er den Code in Lite C Kovertieren muß damit er bei ihm läuft. Und das die Befehle sich gegenüber C Script geändert haben ist ja klar. Lite C soll ja einfacher sein als C Script.Müssen wir eben alle Lite C nehmen in Zukunft .


Wissen ist macht.
Nichts wissen macht auch nichts.

A7.86

Moderated by  adoado, checkbutton, mk_1, Perro 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1