2 registered members (AndrewAMD, dr_panther),
1,282
guests, and 4
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
I am getting close.........
#223681
08/25/08 21:39
08/25/08 21:39
|
Joined: Aug 2008
Posts: 408 mi usa
sadsack
OP
Senior Member
|
OP
Senior Member
Joined: Aug 2008
Posts: 408
mi usa
|
I am getting close to being moving my ship. I think if I can get over this one problem I will have it made. here is the error I am getting. I been looking all over trying how to do this, but I am at a lose. here is all of my code
//////////////////////////////
#include <acknex.h>
#include <default.c>
function main()
{
level_load ("");
wait(2); // wait until the level is loaded
vec_set(camera.x, vector(-500, 0, -10));
ent_create("ship.mdl", vector(0, 0, 0),NULL);
ent_create("land.mdl", vector(-900,2000, -400),NULL);
}
action move_ship()
{
while (1)
{
// move the player using the "W", "S", "A" and "D" keys; "10" = movement speed, "6" = strafing speed
c_move (ship, vector(10 * (key_w - key_s) * time_step, 6 * (key_a - key_d) * time_step, 0), nullvector, GLIDE);
}
}
wait (1);
I hope some one can help. It has been two days now, I been working on this. manual said it was easy, most likely so if you know it already. Thank You renny
Last edited by sadsack; 08/25/08 23:38.
I have A7 Commercial .............. Now I just need to learn how to use it
|
|
|
Re: I am getting close.........
[Re: crumply]
#223683
08/25/08 22:06
08/25/08 22:06
|
Joined: Aug 2008
Posts: 408 mi usa
sadsack
OP
Senior Member
|
OP
Senior Member
Joined: Aug 2008
Posts: 408
mi usa
|
Well crumply, that got me very close. see photo I don't know what syntax error, but I did mot get it on till I put action move_ship above main. here is the code
//////////////////////////////
#include <acknex.h>
#include <default.c>
action move_ship()
function main()
{
level_load ("");
wait(2); // wait until the level is loaded
vec_set(camera.x, vector(-500, 0, -10));
ent_create("ship.mdl", vector(0, 0, 0),move_ship);
ent_create("land.mdl", vector(-900,2000, -400),NULL);
}
{
while (1)
{
// move the player using the "W", "S", "A" and "D" keys; "10" = movement speed, "6" = strafing speed
c_move (ship, vector(10 * (key_w - key_s) * time_step, 6 * (key_a - key_d) * time_step, 0), nullvector, GLIDE);
}
}
wait (1);
I think if we can get this fixed it will work. thank you renny
Last edited by sadsack; 08/25/08 23:39.
I have A7 Commercial .............. Now I just need to learn how to use it
|
|
|
Re: I am getting close.........
[Re: sadsack]
#223684
08/25/08 22:15
08/25/08 22:15
|
Joined: Jan 2008
Posts: 1,580
Blade280891
Serious User
|
Serious User
Joined: Jan 2008
Posts: 1,580
|
Why are you double posting?
My Avatar Randomness V2"Someone get me to the doctor, and someone call the nurse And someone buy me roses, and someone burned the church"
|
|
|
Re: I am getting close.........
[Re: crumply]
#223687
08/25/08 22:56
08/25/08 22:56
|
Joined: Aug 2008
Posts: 408 mi usa
sadsack
OP
Senior Member
|
OP
Senior Member
Joined: Aug 2008
Posts: 408
mi usa
|
Yes crumply, I did see that and changed it so it was right. but still have the same error. What can be wrong with the main function.
Blade, I did not know I was. Thank you renny
I have A7 Commercial .............. Now I just need to learn how to use it
|
|
|
Re: I am getting close.........
[Re: sadsack]
#223690
08/25/08 23:22
08/25/08 23:22
|
Joined: Oct 2004
Posts: 1,655
testDummy
Serious User
|
Serious User
Joined: Oct 2004
Posts: 1,655
|
//////////////////////////////
#include <acknex.h>
#include <default.c>
var mv_v1[3];
function move_ship() {
while(1) {
mv_v1.x = 10 * (key_w - key_s) * time_step;
mv_v1.y = 6 * (key_a - key_d) * time_step;
mv_v1.z = 0;
// move the player using the "W", "S", "A" and "D" keys; "10" = movement speed, "6" = strafing speed
c_move (ME, mv_v1, nullvector, GLIDE);
wait(1);
}
}
function main() {
level_load ("");
wait(2); // wait until the level is loaded
vec_set(camera.x, vector(-500, 0, -10));
ent_create("ship.mdl", vector(0, 0, 0),move_ship);
ent_create("land.mdl", vector(-900,2000, -400),NULL);
}
|
|
|
Re: I am getting close.........
[Re: testDummy]
#223692
08/25/08 23:37
08/25/08 23:37
|
Joined: Aug 2008
Posts: 408 mi usa
sadsack
OP
Senior Member
|
OP
Senior Member
Joined: Aug 2008
Posts: 408
mi usa
|
I can see this is a hard thing to learn. For two days I been working on this with some help from all of you who have took your time to help. well, test Dummy, You code came close,but still an error. I don't know what they are talking about with this one. This is something, to go through all of this just to make a ship move. Well, that is how life goes renny
I have A7 Commercial .............. Now I just need to learn how to use it
|
|
|
Re: I am getting close.........
[Re: sadsack]
#223695
08/26/08 00:19
08/26/08 00:19
|
Joined: Aug 2008
Posts: 408 mi usa
sadsack
OP
Senior Member
|
OP
Senior Member
Joined: Aug 2008
Posts: 408
mi usa
|
Blade, I am sorry, you are right I deleted it, But it only some it. I did not know that it was still there on till you said some thing about. I hope you can forgive me foe being so dumb. renny
I have A7 Commercial .............. Now I just need to learn how to use it
|
|
|
Re: I am getting close.........
[Re: sadsack]
#223701
08/26/08 02:37
08/26/08 02:37
|
cemetarycat
Unregistered
|
cemetarycat
Unregistered
|
hey sadsack and others here too... why not try this? I just used the x component of the vector. As well as excluded the time_step system variable. You can place it in to multiply. And I used the Red Dragon model too. //////////////////////////////
#include <acknex.h>
#include <default.c>
VECTOR* mv[3];
function move_ship() {
mv.x=0;
mv.y=0;
mv.z=0;
while(1) {
if (key_w) vec_add(my.x,vector(7,0,0));
if (key_s) vec_add(my.x, vector(-7,0,0));
// mv_v1.x = 7 *time_step;
// mv_v1.y = 6 * time_step;
// mv_v1.z = 0;
// move the player using the "W", "S", "A" and "D" keys; "10" = movement speed, "6" = strafing speed
c_move (me, nullvector, vector( mv.x, mv.y, mv.z), GLIDE);
wait(1);
}
}
function main() {
level_load ("");
wait(2); // wait until the level is loaded
vec_set(camera.x, vector(-500, 0, -10));
ent_create("RED_DRAGON.mdl", vector(0, 0, 0),move_ship);
//ent_create("land.mdl", vector(-900,2000, -400),NULL);
}
and the proof is in the pudding. on start up of the program after I pressed the w key once cheers
Last edited by cemetarycat; 08/26/08 02:40.
|
|
|
|