Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (Ayumi, NewbieZorro, TipmyPip), 13,887 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
[HELP] New Car code from aum10 #144279
07/29/07 06:20
07/29/07 06:20
Joined: Aug 2006
Posts: 49
J
Jourdan Offline OP
Newbie
Jourdan  Offline OP
Newbie
J

Joined: Aug 2006
Posts: 49
i got problem when i try to add the "new car code" from aum10(codesnippet).
the model of the character not changing to the car model. Here's the screenshots:

Before enter the vehicle:


After enter the vehicle


pretty weird.. please help

Re: [HELP] New Car code from aum10 [Re: Jourdan] #144280
07/29/07 17:05
07/29/07 17:05
Joined: Sep 2003
Posts: 733
Whitefish, Montana
JazzDude Offline
User
JazzDude  Offline
User

Joined: Sep 2003
Posts: 733
Whitefish, Montana
The snippet syntax is probably out of date. If you post it, someone may see the problem.

Re: [HELP] New Car code from aum10 [Re: JazzDude] #144281
07/30/07 14:12
07/30/07 14:12
Joined: Aug 2006
Posts: 49
J
Jourdan Offline OP
Newbie
Jourdan  Offline OP
Newbie
J

Joined: Aug 2006
Posts: 49
here's the code:


string car_mdl = <rally.mdl>;

entity car_entity
{
type = <rally.mdl>;
layer = 10;
view = camera;
x = 0;
y = 0;
z = -30;//-60;
}

function create_car()
{
wait (1);
vec_set(temp, my.x);
my.pan = player.pan;
temp.z -= 2000; // trace 2000 quants below the car
trace_mode = ignore_me + ignore_passable + ignore_models + ignore_sprites;
my.z -= trace (my.x, temp) - 20; // place the car at ground level
my_car(); // start the action again
}

function player_to_car()
{
wait (1);
ent_remove (me);
player.shadow = off;
player._MOVEMODE = _MODE_DRIVING;
player._FORCE = 1.5;
player._BANKING = 0.1;
player.__SLOPES = on;
player.__WHEELS = on; // rotate only when moving
player.__JUMP = off; // the car can't jump
player.__STRAFE = off; // can't strafe
player.__TRIGGER = on;
astrength.pan = 1.5; // decrease rotation speed (pan)
ent_morph (my, car_mdl);
car_entity.visible = on;
while (key_space == 0) {wait (1);} // press space to switch from car to player
temp.x = player.x - 100 * sin(player.pan); // check to see if there is an empty space (near the car door) to deploy the player
temp.y = player.y + 100 * cos(player.pan) ;
temp.z = player.z;
ent_create (car_mdl, player.pos, create_car);
vec_set (player.pos, temp);
car_entity.visible = off;
car_to_player();
}

function car_to_player()
{
player._MOVEMODE = _MODE_WALKING;
player._FORCE = 0.75;
player._BANKING = -0.1;
player.__SLOPES = off;
player.__WHEELS = off;
player.__JUMP = on;
player.__DUCK = on;
player.__STRAFE = on;
player.__BOB = on;
player.__TRIGGER = on;
astrength.pan = 7; // restore the original value in move.wdl
}

function key_to_car()
{
if (key_f)
{
my.event = player_to_car;
}
}

action my_car
{
my.enable_impact = on;
my.event = key_to_car;
//my.event = player_to_car;
}

Re: [HELP] New Car code from aum10 [Re: Jourdan] #144282
08/02/07 13:18
08/02/07 13:18
Joined: Aug 2006
Posts: 49
J
Jourdan Offline OP
Newbie
Jourdan  Offline OP
Newbie
J

Joined: Aug 2006
Posts: 49
lil help pls

Re: [HELP] New Car code from aum10 [Re: Jourdan] #144283
08/02/07 20:44
08/02/07 20:44
Joined: Sep 2002
Posts: 700
Orange County, CA
L
LogantheHogan Offline
Developer
LogantheHogan  Offline
Developer
L

Joined: Sep 2002
Posts: 700
Orange County, CA
*see post below*

Last edited by LogantheHogan; 08/02/07 20:54.
Re: [HELP] New Car code from aum10 [Re: LogantheHogan] #144284
08/02/07 20:47
08/02/07 20:47
Joined: Sep 2002
Posts: 700
Orange County, CA
L
LogantheHogan Offline
Developer
LogantheHogan  Offline
Developer
L

Joined: Sep 2002
Posts: 700
Orange County, CA
Scratch that. I think the problem is that you're removing the car, which terminates the function before it can morph the player. Try the function below in place of your existing one:

entity* temp_car;

function player_to_car()
{
temp_car = me;
me = null; // now the function is global, and continues to run
wait(1);
ent_remove(temp_car);
player.shadow = off;
player._MOVEMODE = _MODE_DRIVING;
player._FORCE = 1.5;
player._BANKING = 0.1;
player.__SLOPES = on;
player.__WHEELS = on; // rotate only when moving
player.__JUMP = off; // the car can't jump
player.__STRAFE = off; // can't strafe
player.__TRIGGER = on;
astrength.pan = 1.5; // decrease rotation speed (pan)
ent_morph (player, car_mdl);
car_entity.visible = on;
while (key_space == 0) {wait (1);} // press space to switch from car to player
temp.x = player.x - 100 * sin(player.pan); // check to see if there is an empty space (near the car door) to deploy the player
temp.y = player.y + 100 * cos(player.pan) ;
temp.z = player.z;
ent_create (car_mdl, player.pos, create_car);
vec_set (player.pos, temp);
car_entity.visible = off;
car_to_player();
}

Re: [HELP] New Car code from aum10 [Re: LogantheHogan] #144285
08/03/07 07:25
08/03/07 07:25
Joined: Aug 2006
Posts: 49
J
Jourdan Offline OP
Newbie
Jourdan  Offline OP
Newbie
J

Joined: Aug 2006
Posts: 49
okay.. it works.. but i got another buggy thingy..
when i try to make it back to the character model (out of car) the model still the car.

what do i need to do with this code?

function car_to_player()
{
player._MOVEMODE = _MODE_WALKING;
player._FORCE = 0.75;
player._BANKING = -0.1;
player.__SLOPES = off;
player.__WHEELS = off;
player.__JUMP = on;
player.__DUCK = on;
player.__STRAFE = on;
player.__BOB = on;
player.__TRIGGER = on;
astrength.pan = 7; // restore the original value in move.wdl
}

sry for my bad english

thx in advance

Last edited by Jourdan; 08/03/07 07:35.
Re: [HELP] New Car code from aum10 [Re: Jourdan] #144286
08/05/07 03:38
08/05/07 03:38
Joined: Aug 2006
Posts: 49
J
Jourdan Offline OP
Newbie
Jourdan  Offline OP
Newbie
J

Joined: Aug 2006
Posts: 49
help pls :|

Re: [HELP] New Car code from aum10 [Re: Jourdan] #144287
08/19/07 10:39
08/19/07 10:39
Joined: Aug 2006
Posts: 49
J
Jourdan Offline OP
Newbie
Jourdan  Offline OP
Newbie
J

Joined: Aug 2006
Posts: 49
pls help :|

Re: [HELP] New Car code from aum10 [Re: Jourdan] #144288
08/19/07 12:51
08/19/07 12:51
Joined: Jan 2006
Posts: 968
EpsiloN Offline
User
EpsiloN  Offline
User

Joined: Jan 2006
Posts: 968
ent_morph(entity,model_string);
Look in the manual for every command used in the script to understand what it does. It'll help you


Extensive Multiplayer tutorial:
http://mesetts.com/index.php?page=201

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | 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