Gamestudio Links
Zorro Links
Newest Posts
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Newbie Questions
by AndrewAMD. 12/04/23 11:14
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
2 registered members (TipmyPip, izorro), 556 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Rotating plaforms in a level #156903
09/25/07 14:02
09/25/07 14:02
Joined: Sep 2007
Posts: 3
S
sokkeh Offline OP
Guest
sokkeh  Offline OP
Guest
S

Joined: Sep 2007
Posts: 3
I want to make a level in which part can rotate. They can either be entitys or level-parts with an action attached. I've been trying for the past 3 hours, but I can't get it to work.
Does anybody know how I should handle this...?

Thanks in advcance.
- sokkeh

Re: Rotating plaforms in a level [Re: sokkeh] #156904
09/25/07 23:20
09/25/07 23:20
Joined: Mar 2007
Posts: 677
0x00000USA
M
MrCode Offline
User
MrCode  Offline
User
M

Joined: Mar 2007
Posts: 677
0x00000USA
For a model-based platform:

1. Create the model in MED (easy as pie)

2. put it in your level (assuming you've already built it, )

3. Create a new script in SED that contains this code (Lite-C)

Code:

#include <acknex.h>
#include <default.c>

action platform_rotate()
{
c_setminmax(me); //use this for a square platform
my.flags= POLYGON; //but use this if it's oddly shaped
while(1)
{
my.pan+= (whatever) * time_step;
wait(1);
}
}

void main()
{
video_mode= 8; //1024x768 resolution
video_screen= 1; //fullscreen
level_load("(level).wmb") //load our level
}



I'm sure it works, so don't worry .

Just replace (whatever) with a number, delete either c_setminmax or my.flags= POLYGON depending on your needs, and replace (level) with your level name.

Then attach the script to the level in WED's Map Properties, attach the action "platform_rotate" to the appropriate model, and then you're good to go!

If you have A6, here's the C-Script code:

Code:

var video_mode= 8;
var video_screen= 1;

action platform_rotate
{
c_setminmax(me);
//or
my.polygon= on;
while(1)
{
my.pan+= (whatever) * time_step;
wait(1);
}
}

function main()
{
level_load("(level).wmb");
}



There's other ways with the templates, but I never use them, and I think this will be a lot more efficient than the templates.


Code:
void main()
{
    cout << "I am MrCode,";
    cout << "hear me roar!";
    system("PAUSE");
}
Re: Rotating plaforms in a level [Re: MrCode] #156905
09/30/07 18:13
09/30/07 18:13
Joined: Sep 2007
Posts: 3
S
sokkeh Offline OP
Guest
sokkeh  Offline OP
Guest
S

Joined: Sep 2007
Posts: 3
Thanks alot for the help, and sorry for the late response =))

Re: Rotating plaforms in a level [Re: sokkeh] #156906
10/02/07 12:43
10/02/07 12:43
Joined: Sep 2007
Posts: 3
S
sokkeh Offline OP
Guest
sokkeh  Offline OP
Guest
S

Joined: Sep 2007
Posts: 3
I have a problem with the rotating platform, when my player controlled ball collides with the model while it is rotating it will go into the model for a part or go trough parts of it completely. is there any flag or option i have missed? its a polygon based model and the idea is that u have to get in the model to pick up some items

Last edited by sokkeh; 10/02/07 13:51.
Re: Rotating plaforms in a level [Re: sokkeh] #156907
10/02/07 14:10
10/02/07 14:10
Joined: Jul 2007
Posts: 959
nl
F
flits Offline
User
flits  Offline
User
F

Joined: Jul 2007
Posts: 959
nl
maby add my.push =1 ore higer on the action
my.pan == c_rotate(my,(2*time_step,0,0),ignore_push);
c_rotate triggers collions and push stops movinge the platform

Last edited by flits; 10/02/07 14:20.

"empty"
Re: Rotating plaforms in a level [Re: flits] #156908
10/02/07 14:24
10/02/07 14:24
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline
User
demiGod  Offline
User

Joined: Mar 2006
Posts: 752
Portugal
To use precise collision detection you will need to use c_rotate, dont change my.pan directly


Moderated by  HeelX, rvL_eXile 

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