Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
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
3 registered members (TedMar, AndrewAMD, fairtrader), 578 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: model won`t move [Re: jigalypuff] #128653
05/08/07 19:15
05/08/07 19:15
Joined: Oct 2005
Posts: 196
ambe Offline
Member
ambe  Offline
Member

Joined: Oct 2005
Posts: 196
Okay look...

Code:
 //Main script

Include <cship.wdl>;

Function main{
Video_switch(7,0,0);
wait(3);
Load_level("cship.wmb");
}


so thats my main script right ..

Code:

//Cship.wdl
var camera_number = 2;

action c_ship
{
player = my;
my.scale_x = 2.0;//scale it down to have it's size
my.scale_y = my.scale_x;//same as scale x
my.scale_z = my.scale_x;//same as scale x
var ship_speed;
var player_dist;
while (1)
{
if (key_w == on)
{
if (ship_speed.x < 1)
{
ship_speed.x += 1.3 * time;
}
}
else
{
if (ship_speed.x >= 0)
{
ship_speed.x -= 0.05 * time;
}
}
if (ship_speed.x < 0) {ship_speed.x = 0;}
if (key_a == on)
{
my.pan += 3 * time;
my.roll - = 3 * time;
}
if (key_d == on)
{
my.pan -= 3 * time;
my.roll + = 3 * time;
}
if (ship_speed.z < 0) {ship_speed.z = 0;}
if (key_q == on)
{
my.tilt + = 3 * time;
}
if (ship_speed.z < 0) {ship_speed.z = 0;}
if (key_e == on)
{
my.tilt - = 3 * time;
}
ent_move (ship_speed.x, nullvector);
ship_camera();
wait (1);

}
}

function ship_camera()
{
if (key_1 == on) {camera_number = 1;}
if (key_2 == on) {camera_number = 2;}
if (key_3 == on) {camera_number = 3;}
if (camera_number == 1) // top view
{
camera.x = player.x;
camera.y = player.y;
camera.z = player.z + 900; // play with this value
camera.pan = player.pan;
camera.tilt = -90;
}
if (camera_number == 2) // simulated first person view (that's just another isometric view, really)
{
camera.x = player.x - 20 * cos(player.pan);
camera.y = player.y - 20 * sin(player.pan);
camera.z = player.z + 18;
camera.pan = player.pan;
camera.tilt = 0;
}
if (camera_number == 3) // true isometric view
{
camera.x = player.x - 200 * cos(player.pan); // 200 = distance
camera.y = player.y - 200 * sin(player.pan); // same value here
camera.z = player.z + 150; // above the player
camera.pan = player.pan;
camera.tilt = -27; // look down at the player
}
wait (1);
}

and heres your script .. with the exeption of the var camera_number being on the out side of the script making it a global var... and thats nice and all seeing as you should get an error if you put it inside any thing ..

but no matter, if it dosen't work.. whats your engine version .. ?

Last edited by ambe; 05/08/07 19:16.
Re: model won`t move [Re: ambe] #128654
05/08/07 19:27
05/08/07 19:27
Joined: Nov 2005
Posts: 1,007
jigalypuff Offline OP
Serious User
jigalypuff  Offline OP
Serious User

Joined: Nov 2005
Posts: 1,007
weird this just won`t work for me at all
Code:

include <cship.wdl>;

var video_mode = 8;
var video_depth = 32;
var video_screen = 1;
var torpedos = 30;
var shields = 100;
var health = 100;


function main()
{
level_load("darkfrontiers.wmb");
mouse_map = hempire_pcx;
mouse_mode = 1;
while (1)
{
mouse_pos.x = pointer.x;
mouse_pos.y = pointer.y;
wait (5);
}
}



Code:

bmap c_mpan_pcx = "c_mpan.pcx";
bmap hempire_pcx = "hempire.pcx";
bmap but2_pcx = "but2.pcx";
bmap but3_pcx = "but3.pcx";

panel main_pan
{
bmap = c_mpan_pcx;
pos_x = 0;
pos_y = 0;
flags = overlay, refresh, visible;
}

var camera_number = 2;

action c_ship
{
player = my;
my.scale_x = 2.0;//scale it down to have it's size
my.scale_y = my.scale_x;//same as scale x
my.scale_z = my.scale_x;//same as scale x
var ship_speed;
while (1)
{
if (key_w == on)
{
if (ship_speed.x < 1)
{
ship_speed.x += 1.3 * time;
}
}
else
{
if (ship_speed.x >= 0)
{
ship_speed.x -= 0.05 * time;
}
}
if (ship_speed.x < 0) {ship_speed.x = 0;}
if (key_a == on)
{
my.pan += 3 * time;
my.roll - = 3 * time;
}
if (key_d == on)
{
my.pan -= 3 * time;
my.roll + = 3 * time;
}
if (ship_speed.z < 0) {ship_speed.z = 0;}
if (key_q == on)
{
my.tilt + = 3 * time;
}
if (ship_speed.z < 0) {ship_speed.z = 0;}
if (key_e == on)
{
my.tilt - = 3 * time;
}
ent_move (ship_speed.x, nullvector);
ship_camera();
wait (1);

}
}

function ship_camera()
{
if (key_1 == on) {camera_number = 1;}
if (key_2 == on) {camera_number = 2;}
if (key_3 == on) {camera_number = 3;}
if (camera_number == 1) // top view
{
camera.x = player.x;
camera.y = player.y;
camera.z = player.z + 900; // play with this value
camera.pan = player.pan;
camera.tilt = -90;
}
if (camera_number == 2) // simulated first person view (that's just another isometric view, really)
{
camera.x = player.x - 20 * cos(player.pan);
camera.y = player.y - 20 * sin(player.pan);
camera.z = player.z + 18;
camera.pan = player.pan;
camera.tilt = 0;
}
if (camera_number == 3) // true isometric view
{
camera.x = player.x - 200 * cos(player.pan); // 200 = distance
camera.y = player.y - 200 * sin(player.pan); // same value here
camera.z = player.z + 150; // above the player
camera.pan = player.pan;
camera.tilt = -27; // look down at the player
}
wait (1);
}



i have commercial version 6.40.5


Why does everyone like dolphins? Never trust a species which smiles all the time!
Re: model won`t move [Re: jigalypuff] #128655
05/08/07 19:44
05/08/07 19:44
Joined: Oct 2005
Posts: 196
ambe Offline
Member
ambe  Offline
Member

Joined: Oct 2005
Posts: 196
still no forward movement? this works by me too.. can't see any errors either.


- code monkey
Re: model won`t move [Re: jigalypuff] #128656
05/08/07 19:51
05/08/07 19:51
Joined: Jun 2002
Posts: 3,682
Coppell, Texas
Ran Man Offline
Expert
Ran Man  Offline
Expert

Joined: Jun 2002
Posts: 3,682
Coppell, Texas
Hi,

Try giving ent_move the mode to operate in.
Put this line right before the ent_move instruction.

Code:
 
move_mode=ignore_passable + ignore_passents + ignore_sprites + glide + ACTIVATE_TRIGGER + IGNORE_PUSH + IGNORE_YOU;




Cougar Interactive

www.zoorace.com
Re: model won`t move [Re: ambe] #128657
05/08/07 19:54
05/08/07 19:54
Joined: Nov 2005
Posts: 1,007
jigalypuff Offline OP
Serious User
jigalypuff  Offline OP
Serious User

Joined: Nov 2005
Posts: 1,007
ya still no forward movement, i can`t figure why this code works for you but not me, it`s strange that pan and tilt work but not the w key for going forward. and yes i tested to make sure that key works lol.


Why does everyone like dolphins? Never trust a species which smiles all the time!
Re: model won`t move [Re: jigalypuff] #128658
05/08/07 19:58
05/08/07 19:58
Joined: Jun 2002
Posts: 3,682
Coppell, Texas
Ran Man Offline
Expert
Ran Man  Offline
Expert

Joined: Jun 2002
Posts: 3,682
Coppell, Texas
I don't know.

could it be moving, but it's hard to see? One is a pretty small number. lol


If so, try increasing this number 1 to number 7 or something.

if (ship_speed.x < 1 ) {

change to:

if (ship_speed.x < 7 ) {


Cougar Interactive

www.zoorace.com
Re: model won`t move [Re: Ran Man] #128659
05/08/07 20:04
05/08/07 20:04
Joined: Nov 2005
Posts: 1,007
jigalypuff Offline OP
Serious User
jigalypuff  Offline OP
Serious User

Joined: Nov 2005
Posts: 1,007
tried that but still no forward movement, thing is without the camera code the ship moves around just fine, once that camera stuff is added bang no forward movement. i really want this code to work as i want the fps view to be the bridge of the ship, so when camera view is changed i can ent_create the ships bridge.


Why does everyone like dolphins? Never trust a species which smiles all the time!
Re: model won`t move [Re: jigalypuff] #128660
05/08/07 20:18
05/08/07 20:18
Joined: Nov 2005
Posts: 1,007
jigalypuff Offline OP
Serious User
jigalypuff  Offline OP
Serious User

Joined: Nov 2005
Posts: 1,007
god i`m a dork due to the level having nothing in it i never noticed the forward movement it seems to be working just fine now, thanks guys for your patience.


Why does everyone like dolphins? Never trust a species which smiles all the time!
Re: model won`t move [Re: jigalypuff] #128661
05/08/07 21:19
05/08/07 21:19
Joined: Oct 2005
Posts: 196
ambe Offline
Member
ambe  Offline
Member

Joined: Oct 2005
Posts: 196
haha glad it worked out for you


- code monkey
Re: model won`t move [Re: ambe] #128662
05/09/07 02:17
05/09/07 02:17
Joined: Jun 2002
Posts: 3,682
Coppell, Texas
Ran Man Offline
Expert
Ran Man  Offline
Expert

Joined: Jun 2002
Posts: 3,682
Coppell, Texas
Quote:

god i`m a dork



Everybody is a dork, when working with this stuff.

I've called myself and my computer "un-mentionable" names while programming.

But, NEVER GIVE UP!, and NEVER SURRENDER!


Woo, Ha, Ha!


Cougar Interactive

www.zoorace.com
Page 2 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