Page 1 of 2

On moving objects; Instant move?

Posted: Fri Dec 19, 2003 9:35 pm
by Stevo
Hey, I've made a moving script -> object in my map. It moves south a distance, then north a greater distance, then back and forth on that greater distance constantly.

The code WORKS. I'm not trying to get help on moving something. The problem is that I don't want it to gradually "move" north. I want it to "teleport" north instantly. I found a command in the allclasses.htm called jumpto but I don't know if that's what I want, nor do I know how to use it.
I searched for this topic, but came up short.
I tried putting the move-time to 0.0, but that does not seem to work. Any suggestions? What should I use as the value for time? or should I use something other than time? (not speed).

Code: Select all

start_object:

	$t1 time 1.0
	$t1 movesouth 2048
	$t1 waitmove
	thread loop_object

end

loop_object:

	$t1 time 0.0
	$t1 movenorth 3072
	$t1 waitmove
	$t1 time 1.0
	$t1 movesouth 3072
	$t1 waitmove
	thread loop_object

end
Thanks for any consideration.
-Stevo

Posted: Sat Dec 20, 2003 12:59 am
by nuggets
jumpto is a $player command, certain commands can only be used by certain entities,

if you use time 0.001 that'll work :D

Posted: Sat Dec 20, 2003 2:23 am
by matt_moh
Try using $t1 speed 0 . If that doesn't work, then try using info_splinepaths instead of a movenorth/movesouth command. In your map, put an info_splinepath where you want the object to move to first with a $targetname of northspot. Then put a splinepath at the second point with a targetname of southspot.

In your script, use this code:

Code: Select all

loop_object: 

$t1 moveto $northspot
$t1 speed 0
$t1 time 0
$t1 waitmove
$t1 moveto $southspot
$t1 time 1.0
$t1 waitmove

end 

hide

Posted: Sat Dec 20, 2003 3:11 am
by tltrude

Code: Select all

loop_object: 

   $t1 time 0.001
   $t1 hide
   $t1 movenorth 3072 
   $t1 waitmove 
   $t1 show
   $t1 time 1.0 
   $t1 movesouth 3072 
   $t1 waitmove 
   thread loop_object 

end 

Posted: Sat Dec 20, 2003 4:49 am
by Stevo
Awesome.
Okay, 0.001 for the time worked well, so thanks nuggets,
but also, Matt, your speed 0 suggestion worked too (about the same, to be honest), so I'm going to stick with speed 0. And Tom, hiding it as it moves back is a good idea too, but for my purposes the object needs to be seen at all times; so much so that if it had to be hidden for even a short period of time, it would not be worth even having the object.

Thanks, all three of you. I'm dissapointed at MOH again, but this will have to do.

(by the way, Matt, the splinepaths are something I didn't know about, but I may use them for other objects. Thanks!)

Posted: Wed Dec 24, 2003 2:50 am
by omniscient
dissapointed about what? also instead of moving it, wouldnt it be easier to put one in every location, and hide/showthem? like have location one shown, then hide it and show location 2? seems like it would be easier.... though i dont know how to script a move :D

Posted: Thu Dec 25, 2003 2:05 am
by nuggets
the best map can be crap if there's a low fps,
adding more entities will slow down the map
scripting doesn't really change fps at all, where as adding duplicates of every item would

Posted: Thu Dec 25, 2003 2:40 am
by omniscient
if u dont show the objects they wouldnt effect fps. compile time may be a little longer, but if its easier to script i think it would be worth it.

Posted: Thu Dec 25, 2003 9:33 pm
by nuggets
objects whether dawn or not drawn still affect fps, try convincing people that having 100 boxes won't affect fps if they're hidden,

Posted: Thu Jan 01, 2004 6:00 am
by omniscient
well if u are correct what would be the point of using caulk if something not seen still efefcts fps?

Posted: Fri Jan 02, 2004 1:21 am
by nuggets
read a tutorial on VISDATA, and paths for ai are harder to calculate around more obstacles

Posted: Fri Jan 02, 2004 2:43 am
by omniscient
o i didnt know ai was involved, musta missed that part, mb.

Posted: Fri Jan 02, 2004 11:27 am
by jv_map
nuggets wrote:read a tutorial on VISDATA
Visdata is not affected by entities :wink:

Posted: Sat Jan 03, 2004 6:50 pm
by Stevo
I give all the suggestions another look...

Oddly enough, omniscient, your idea gives the best effect, though it took longer to do and gives twice as many objects as MOHAA should have to render.

But even that gives a bit of an inconsistency to my moving object. Crap.
Fortunately it's only really noticeable if you're looking for it. It will have to do.

Thanks

Posted: Sat Jan 03, 2004 10:32 pm
by omniscient
if its harder then i wouldnt bother, just a suggestion because i dont know the other way to do it.