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
1 registered members (M_D), 1,501 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Funfair Simulation #259828
04/07/09 22:59
04/07/09 22:59
Joined: Apr 2009
Posts: 113
Netherlands
D
Dreher Offline OP
Warez Victim
Dreher  Offline OP
Warez Victim
D

Joined: Apr 2009
Posts: 113
Netherlands
Hello, I'm new here, and also new to scripting!

Alrightio! - I've been modelling 'Fun Fair Attracties' for a few months now (Within SketchUp), and I want to script them within 3D Game Studio (A7).

Ok, so, it seems nothing *too* advanced probably, but thats all I want to do, so no RPG's or shooters or anything complicated! wink

Here is a link to a YouTube clip I recorded within SketchUp:

http://www.youtube.com/watch?v=gnRm9DJZVEU

What I want to do is, let my model do the same thing it does within SketchUp with SketchyPhysics! (Seen in the clip), and then make it a application.

Is it easy to script these kind of things, or is it still pretty much complicated?

Thanks in advance! laugh


A7 7.77
Re: Funfair Simulation [Re: Dreher] #259832
04/07/09 23:10
04/07/09 23:10
Joined: Jul 2008
Posts: 170
Germany, near Mainz
Nicotin Offline
Member
Nicotin  Offline
Member

Joined: Jul 2008
Posts: 170
Germany, near Mainz
I think it is relativly easy. For a beginner pretty hard thought, because you have to use vector calculations.



Re: Funfair Simulation [Re: Nicotin] #259837
04/07/09 23:20
04/07/09 23:20
Joined: Jul 2005
Posts: 192
Orange County
S
silencer Offline
Member
silencer  Offline
Member
S

Joined: Jul 2005
Posts: 192
Orange County
I like the idea, and I don't think it would be extremely difficult to do.


AMD 64 x2 4400+ 2048mb DDR3200 NVidia 6800GS 256mb Soundblaster Audigy 2 A7 Commercial 7.07
Re: Funfair Simulation [Re: Nicotin] #259838
04/07/09 23:21
04/07/09 23:21
Joined: Apr 2009
Posts: 113
Netherlands
D
Dreher Offline OP
Warez Victim
Dreher  Offline OP
Warez Victim
D

Joined: Apr 2009
Posts: 113
Netherlands
Originally Posted By: Nicotin
I think it is relativly easy. For a beginner pretty hard thought, because you have to use vector calculations.


I see, well I'm totally new but I don't want to give up before I even tried, and I want to get this done anyway

Last edited by Dreher; 04/07/09 23:27.

A7 7.77
Re: Funfair Simulation [Re: Dreher] #259843
04/07/09 23:46
04/07/09 23:46
Joined: Jul 2008
Posts: 170
Germany, near Mainz
Nicotin Offline
Member
Nicotin  Offline
Member

Joined: Jul 2008
Posts: 170
Germany, near Mainz
Okay, some tips (I can't give you more right now because I'd have to look a long time myself smile )

Look for "c_rotate" in the manual for the rotating platform and the single cars.
Then look for vec_rotate to rotate the cars around the center of the platform.

Sorry, my englisch isn't that good. I hope you can unserstand me thought.
I'll take a look after it now thought smile



Re: Funfair Simulation [Re: Nicotin] #259847
04/08/09 00:00
04/08/09 00:00
Joined: Apr 2009
Posts: 113
Netherlands
D
Dreher Offline OP
Warez Victim
Dreher  Offline OP
Warez Victim
D

Joined: Apr 2009
Posts: 113
Netherlands
Originally Posted By: Nicotin
Okay, some tips (I can't give you more right now because I'd have to look a long time myself smile )

Look for "c_rotate" in the manual for the rotating platform and the single cars.
Then look for vec_rotate to rotate the cars around the center of the platform.

Sorry, my englisch isn't that good. I hope you can unserstand me thought.
I'll take a look after it now thought smile


I'm from holland so a bit of german isn't too bad either, but I do understand you in any way!

Thanks alot for helping me getting started, as this is all i want to do, and once I get to know it properly, I'm happy!

I will look into the manuals, looking for 'c_rotate' and 'vec_rotate' and see what I can do with it, then test it out whenever I'm far enough to do so. Atleast I've gotta start with a simpel model, nothing complicated yet.

Thanks again and we'll see how things go! wink


A7 7.77
Re: Funfair Simulation [Re: Dreher] #259848
04/08/09 00:07
04/08/09 00:07
Joined: Jul 2008
Posts: 170
Germany, near Mainz
Nicotin Offline
Member
Nicotin  Offline
Member

Joined: Jul 2008
Posts: 170
Germany, near Mainz
Ok, I made it to get a simple one working. If you want it here is the code: You can work with it smile I hope it helps you at least a little bit
It was much easyer then I thought xD
Click to reveal..

Code:


action platform_action()
{
	var platform_rotation_speed = 0.1;//Rotation Speed of the platform
	var car_rotation_speed = 0.5;//rotation speed of the car
	
	ENTITY* car1;//Pointer to all the cars
	ENTITY* car2;
	ENTITY* car3;
	ENTITY* car4;
	
	//Create the cars at 4 edges of the platform
	car1 = ent_create("car.mdl",vector(my.x + 50,0,0),NULL);//Place the car 50 quands over 0
	car2 = ent_create("car.mdl",vector(my.x - 50,0,0),NULL);//Place the car 50 quands under 0
	car3 = ent_create("car.mdl",vector(0,my.y + 50,0),NULL);//Place the car 50 quands right from 0
	car4 = ent_create("car.mdl",vector(0,my.y - 50,0),NULL);//Place the car 50 quands left from 0
	
	while(1)
	{
		my.pan += platform_rotation_speed*time_step;//Rotate platform
		
		car1.pan += car_rotation_speed*time_step;//rotate cars around themselfes
		car2.pan += car_rotation_speed*time_step;
		car3.pan += car_rotation_speed*time_step;
		car4.pan += car_rotation_speed*time_step;
		
		vec_rotate (car1.x,vector(platform_rotation_speed,0,0));//rotate the cars around the vector(0,0,0)
		vec_rotate (car2.x,vector(platform_rotation_speed,0,0));
		vec_rotate (car3.x,vector(platform_rotation_speed,0,0));
		vec_rotate (car4.x,vector(platform_rotation_speed,0,0));
				
		wait(1);
	}
}

function main()
{
	level_load(NULL);
	wait(3);
	
	camera.z = 200;
	camera.x = -200;//Move camera
	camera.tilt = -45;
	
	ent_create("platform.mdl",vector(0,0,0),platform_action);//create Platform
	
}



EDIT: I didn't used c_rotate because it isn't necessary here. Just rotated with my.pan

EDIT2: I forgot the time_step wink

Last edited by Nicotin; 04/08/09 00:21.


Re: Funfair Simulation [Re: Nicotin] #259850
04/08/09 00:18
04/08/09 00:18
Joined: Apr 2009
Posts: 113
Netherlands
D
Dreher Offline OP
Warez Victim
Dreher  Offline OP
Warez Victim
D

Joined: Apr 2009
Posts: 113
Netherlands
I'll check it out right away after I configured it ^^


A7 7.77
Re: Funfair Simulation [Re: Dreher] #259851
04/08/09 00:30
04/08/09 00:30
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
You can attach the different objects, which are rotating quite independently, with vec_for_vertex to each other.

Re: Funfair Simulation [Re: Pappenheimer] #259855
04/08/09 00:38
04/08/09 00:38
Joined: Apr 2009
Posts: 113
Netherlands
D
Dreher Offline OP
Warez Victim
Dreher  Offline OP
Warez Victim
D

Joined: Apr 2009
Posts: 113
Netherlands
Hmm, I got the model already, but i'm totally UNKNOWN within script editor and model editor LOL

Model is imported from sketchup as a .3DS file, and thats it.

And I can't seem to find a way to use the code you gave me (within the Model Editor, to test it out) ><


A7 7.77
Page 1 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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