On moving objects; Instant move?

Post your scripting questions / solutions here

Moderator: Moderators

Stevo
Corporal
Posts: 38
Joined: Tue Dec 16, 2003 8:31 pm
Location: Florida, USA
Contact:

On moving objects; Instant move?

Post 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
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post 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
hope this helps, prob not cos it's all foreign 2 me :-/
matt_moh
Sergeant
Posts: 65
Joined: Sat Feb 08, 2003 12:04 am

Post 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 
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

hide

Post 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 
Tom Trude,

Image
Stevo
Corporal
Posts: 38
Joined: Tue Dec 16, 2003 8:31 pm
Location: Florida, USA
Contact:

Post 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!)
omniscient
Major General
Posts: 694
Joined: Tue Sep 16, 2003 12:02 am

Post 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
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post 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
hope this helps, prob not cos it's all foreign 2 me :-/
omniscient
Major General
Posts: 694
Joined: Tue Sep 16, 2003 12:02 am

Post 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.
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post 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,
hope this helps, prob not cos it's all foreign 2 me :-/
omniscient
Major General
Posts: 694
Joined: Tue Sep 16, 2003 12:02 am

Post by omniscient »

well if u are correct what would be the point of using caulk if something not seen still efefcts fps?
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

read a tutorial on VISDATA, and paths for ai are harder to calculate around more obstacles
hope this helps, prob not cos it's all foreign 2 me :-/
omniscient
Major General
Posts: 694
Joined: Tue Sep 16, 2003 12:02 am

Post by omniscient »

o i didnt know ai was involved, musta missed that part, mb.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

nuggets wrote:read a tutorial on VISDATA
Visdata is not affected by entities :wink:
Image
Stevo
Corporal
Posts: 38
Joined: Tue Dec 16, 2003 8:31 pm
Location: Florida, USA
Contact:

Post 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
omniscient
Major General
Posts: 694
Joined: Tue Sep 16, 2003 12:02 am

Post by omniscient »

if its harder then i wouldnt bother, just a suggestion because i dont know the other way to do it.
Post Reply