Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,486 guests, and 10 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
A tilt-loop #148961
08/19/07 12:02
08/19/07 12:02
Joined: Aug 2006
Posts: 96
Netherlands
P
Polypfreak1987 Offline OP
Junior Member
Polypfreak1987  Offline OP
Junior Member
P

Joined: Aug 2006
Posts: 96
Netherlands
Hello,

I have a model, but I want to have a tilt loop. So the model is rotating around the tilt angle to 15 degrees, and if the model is at 15 degrees, the model rotates back to 0 degrees. Is there a posible way to do something like that?

Thanks in advance.

Re: A tilt-loop [Re: Polypfreak1987] #148962
08/19/07 12:13
08/19/07 12:13
Joined: Jan 2006
Posts: 968
EpsiloN Offline
User
EpsiloN  Offline
User

Joined: Jan 2006
Posts: 968
Please,read the C-Script tutorials for beginners and post questions like this in the Starting with game studio section
Code:

my.skill5 = 15; // max tilt
my.skill6 = 0; // min tilt
while(1)
{
while(my.tilt < my.skill5)
{
my.tilt += 2 * time; // speed
wait(1);
}
while(my.tilt > my.skill6)
{
my.tilt -= 2 * time;
wait(1);
}
wait(1);
}




Extensive Multiplayer tutorial:
http://mesetts.com/index.php?page=201
Re: A tilt-loop [Re: EpsiloN] #148963
08/19/07 12:20
08/19/07 12:20
Joined: Oct 2006
Posts: 873
S
Shadow969 Offline
User
Shadow969  Offline
User
S

Joined: Oct 2006
Posts: 873
you can also use sin() to make the code more elegant...

Re: A tilt-loop [Re: Shadow969] #148964
08/19/07 12:40
08/19/07 12:40
Joined: Aug 2006
Posts: 96
Netherlands
P
Polypfreak1987 Offline OP
Junior Member
Polypfreak1987  Offline OP
Junior Member
P

Joined: Aug 2006
Posts: 96
Netherlands
Thank you epsilon.

But I have still one problem. This model is a part of a fair ride. the arms rotating around the centerpiece. I have attached them, but when it rotates around the centerpiece, the model frooze a couple of frames. I know it's because "wait(1);". But is there a way to run it smoothly?

So, the model (arm) it rotating around the centerpiece (with my.pan) and it's tilting (with the code you gave me).

Thanks in advance.

Re: A tilt-loop [Re: Polypfreak1987] #148965
08/19/07 12:46
08/19/07 12:46
Joined: Jan 2006
Posts: 968
EpsiloN Offline
User
EpsiloN  Offline
User

Joined: Jan 2006
Posts: 968
It cant be because its waiting just one frame,and it should be smooth because I've added * time. There is something else in your script thats freezing the model or your computer is slow to display the model (eg. If its 20 000 poly.)
You should post your code...(or send it thru PM to me,and I'll fix it)


Extensive Multiplayer tutorial:
http://mesetts.com/index.php?page=201
Re: A tilt-loop [Re: EpsiloN] #148966
08/19/07 12:55
08/19/07 12:55
Joined: Aug 2006
Posts: 96
Netherlands
P
Polypfreak1987 Offline OP
Junior Member
Polypfreak1987  Offline OP
Junior Member
P

Joined: Aug 2006
Posts: 96
Netherlands
This is the code of the model:

Code:
action arm1
{
arm_1 = my;
my.passable = on;

vec_for_vertex(temp,my,87);
ent_create("kruis.mdl",temp, kruis1);

while(my)
{
vec_for_vertex(temp, machine, 235);
my.x = temp.x;
my.y = temp.y;
my.z = temp.z;
my.pan = machine.pan +90;

my.scale_x = 1.7;
my.scale_y = 1.7;
my.scale_z = 1.7;
//my.roll = arm_1.roll;

my.skill5 = 0; // max tilt
my.skill6 = -15; // min tilt

if(key_e == 1)
{
while(my.tilt < my.skill5)
{
my.tilt += 2 * time; // speed
//my.pan == machine.pan;
wait(1);
}
while(my.tilt > my.skill6)
{
my.tilt -= 2 * time;
//my.pan == machine.pan;
wait(1);
}
}
if(key_d == 1)
{
while(my.tilt > my.skill6)
{
my.tilt -= 2 * time;
//my.pan == machine.pan;
wait(1);
}
}

wait(1);
}
}



I know, my code may be look a real disaster.

Re: A tilt-loop [Re: Polypfreak1987] #148967
08/19/07 12:59
08/19/07 12:59
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
wouldnt it be easier if you programmed this using bones?


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: A tilt-loop [Re: Helghast] #148968
08/19/07 13:04
08/19/07 13:04
Joined: Jan 2006
Posts: 968
EpsiloN Offline
User
EpsiloN  Offline
User

Joined: Jan 2006
Posts: 968
actualy your code looks fine to me. Hit F11 and see the FPS value , maby it drops fast from time to time. I dont see any other problems.

dennis , it would if I knew how to use bones to tell him. I'm still 'old school' with the vertex animations (and until 2 days I tought you cant manipulate the bones,only use predefined animations blending (for eg.) the head animation with legs animation. (I read somewhere that you can turn the bones thru script...)


Extensive Multiplayer tutorial:
http://mesetts.com/index.php?page=201
Re: A tilt-loop [Re: EpsiloN] #148969
08/19/07 13:26
08/19/07 13:26
Joined: Aug 2006
Posts: 96
Netherlands
P
Polypfreak1987 Offline OP
Junior Member
Polypfreak1987  Offline OP
Junior Member
P

Joined: Aug 2006
Posts: 96
Netherlands
The FPS drops not very much. So I don't know what it could be. But I think it is the wait at the end of the while loop, but I know that is required...

Re: A tilt-loop [Re: EpsiloN] #148970
08/19/07 13:32
08/19/07 13:32
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
Quote:

dennis , it would if I knew how to use bones to tell him. I'm still 'old school' with the vertex animations (and until 2 days I tought you cant manipulate the bones,only use predefined animations blending (for eg.) the head animation with legs animation. (I read somewhere that you can turn the bones thru script...)




if you would take the time, you could animate your whole model using script and a bone setup, no MED animations whatsoever.

i use bones on my NPC's to make their head look towards the player (untill a specific point that is, we dont want any excorsist stuff in a normal RPG ).

regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
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