Author |
Topic: How to move model to origin? |
TrikX |
|
General Member Since: Jul 7, 2012 Posts: 129 Last: Dec 31, 2016 [view latest posts] |
|
|
Category: CoD4 MP Mapping Posted: Sunday, Feb. 9, 2014 10:32 am |
|
Basically what i want to do is for example to move model on Cod4 MP map from the bottom corner of the room, or somewhere else, to the upper corner of the room in a straight line, like shown in the picture.
It doesn't have to have origin, i placed it only for this example, it can also be a script with XYZ coordinates, i just don't know how to do it!
moveX, moveY and moveZ just doesn't do it, i want it to go straight!
Is it possible?
Thank you!
edited on Feb. 9, 2014 03:33 am by denomajstor |
|
|
|
3st0nian |
|
General Member Since: Jan 14, 2008 Posts: 291 Last: Dec 4, 2017 [view latest posts] |
|
|
|
|
TrikX |
|
General Member Since: Jul 7, 2012 Posts: 129 Last: Dec 31, 2016 [view latest posts] |
|
|
Category: CoD4 MP Mapping Posted: Sunday, Feb. 9, 2014 04:15 pm |
|
Thanks for this, but now i'm having an other problem!
I made that model (script_model), made the script with (moveTo)
and it doesn't work!
So i tried with linking a script_brushmodel to it, still nothing, tried to move it to an origin using target, nothing, tried using co-ordinates, nothing, then i started thinking that the script is not good, so i tried with (iprintln) and i get the message only when i step on the trigger!
After everything i tried, i placed insted of moveTo, moveZ, and the model is moving, i get all the messages!
Can someone tell me why it's not working please?
Here is the script i made!
Code: move_model()
{
ghost_mo = getent ("gh_mod","targetname"); //ghost model
trig = getent ("gh_trig","targetname"); //trigger
trig waittill ("trigger");
iprintlnbold("Trigger triggered");
ghost_mo moveto ((88, 392, 184), 1, 2, 3);
ghost_mo waittill ("movedone");
iprintln("model moveto finished");
} |
|
|
|
StrYdeR |
General Member Since: May 11, 2004 Posts: 11672 Last: Apr 20, 2024 [view latest posts] |
|
|
|
|
Category: CoD4 MP Mapping Posted: Sunday, Feb. 9, 2014 04:50 pm |
|
try this:
in your map:
create a script origin at the location you want the model to move to
select your model - then the origin and press ctrl-k to link them (order is important)
Code: move_model()
{
level.ghost_speed = 2;
ghost_mo = getent ("gh_mod","targetname"); //ghost model
temp = getent (ghost_mo.target,"targetname"); // where its going
ghost_mo.dest = temp.origin;
ghost_mo.start = ghost_mo.origin;
trig = getent ("gh_trig","targetname"); //trigger
trig waittill ("trigger");
iprintlnbold("Trigger triggered");
self moveto (self.dest, level.ghost_speed, 0.1,0.1);
wait level.ghost_speed;
iprintln("model moveto finished");
}
you can do other things like show and hide the model until the trigger happens and once the move is done...
hope this helps
|
|
|
|
3st0nian |
|
General Member Since: Jan 14, 2008 Posts: 291 Last: Dec 4, 2017 [view latest posts] |
|
|
|
Category: CoD4 MP Mapping Posted: Sunday, Feb. 9, 2014 05:08 pm |
|
ghost_mo moveto ((88, 392, 184), 1, 2, 3);
Total movetime must be more or equal to accerelation time plus deceleration time.
So either
ghost_mo moveto ((88, 392, 184), 5, 2, 3);
OR
ghost_mo moveto ((88, 392, 184), 1);
Also with Stryders method instead of ctrl+k you must press W as first key combination works only in vCoD and UO. |
|
|
|
TrikX |
|
General Member Since: Jul 7, 2012 Posts: 129 Last: Dec 31, 2016 [view latest posts] |
|
|
Category: CoD4 MP Mapping Posted: Sunday, Feb. 9, 2014 06:25 pm |
|
attachment: image(821.0Kb) |
I'm not new to mapping, i just don't understand why everything is working fine, only (moveto) doesn't!
StrYdeR, i know your script works fine for sure when i see it, but it doesn't work for me, and i don't know why!
I even tried it with different models, on a different map and still nothing, only thing i get in game is the message "Trigger triggered" when i step on the trigger! After that nothing happends!
And i know how to hide and show the model, that's easy!
|
|
|
|
TrikX |
|
General Member Since: Jul 7, 2012 Posts: 129 Last: Dec 31, 2016 [view latest posts] |
|
|
Category: CoD4 MP Mapping Posted: Sunday, Feb. 9, 2014 06:29 pm |
|
Model is script_model
trigger is trigger_multiple
origin is up, and it's welded in a good order!
I have 3 more ghost models on map, but they are just moving straight, and they work fine, but this is driving me crazy! |
|
|
|
TrikX |
|
General Member Since: Jul 7, 2012 Posts: 129 Last: Dec 31, 2016 [view latest posts] |
|
|
|
3st0nian |
|
General Member Since: Jan 14, 2008 Posts: 291 Last: Dec 4, 2017 [view latest posts] |
|
|
|
Category: CoD4 MP Mapping Posted: Tuesday, Feb. 11, 2014 01:45 pm |
|
Code: self moveto (self.dest, level.ghost_speed, 0.1,0.1);
should be
Code: ghost_mo moveto (ghost_mo.dest, level.ghost_speed, 0.1,0.1); |
|
|
|
ukdjaj |
|
General Member Since: Jun 1, 2008 Posts: 2726 Last: Nov 15, 2020 [view latest posts] |
|
|
Category: CoD4 MP Mapping Posted: Tuesday, Feb. 11, 2014 01:48 pm |
|
Try a different model?
Don't know what model you're using, whether it is an import or something, but it might have bones still in it, which may stop it from being moved?
Thanks, Ukdjaj |
|
|
|