|
|
Re: model won`t move
[Re: jigalypuff]
#128653
05/08/07 19:15
05/08/07 19:15
|
Joined: Oct 2005
Posts: 196
ambe
Member
|
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
OP
Serious User
|
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
Member
|
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
Expert
|
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;
|
|
|
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
OP
Serious User
|
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
Expert
|
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 ) {
|
|
|
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
OP
Serious User
|
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
OP
Serious User
|
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: ambe]
#128662
05/09/07 02:17
05/09/07 02:17
|
Joined: Jun 2002
Posts: 3,682 Coppell, Texas
Ran Man
Expert
|
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! 
|
|
|
|