Scripts / Repeatedly moving non-npc entities in a line

Author
Message
Len the man
8
Years of Service
User Offline
Joined: 12th Jun 2015
Location:
Posted: 28th Jul 2018 22:22
I wanted my game to have a shootout while standing on top of a train, but I can't get the train to move while keeping the player on top of it. So, I'm changing my way of thinking and now I want to leave the train standing still, and make everything else move past it (with the illusion of movement).

I wanted a script to make non-NPC entities [train tracks] move in a straight line, then go back to where they started in order to keep moving down that straight line over and over again.

I tried using the boat script, but after trying it about 50 different ways, I concluded that the solution wasn't the boat script.

I moved on to see if it could be done with the trap_wall script (by smallg) with a delay script (by 3com) thrown in with it. I had to work at altering the numbers for hours.

I can't figure out how to make the entities go far (more then 2,000 to 5,000) without making it stop working. When I make the trigger_range and the move_range numbers too far apart, it goes a short distance and stops, or it goes hay-wire.

It's a bit sloppy and I don't exactly know how to clean it up to be a little better, but here it is:


Attachments

Login to view attachments
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 28th Jul 2018 22:53 Edited at: 28th Jul 2018 23:21
Have you made all entities with scripts 'always active'? Even then when entities get more than a certain distance from where they originate strange things can happen, like AI will stop being able to fire.

I've not had a chance yet to track down the cause in the engine but it's on my todo list.


Tidied the script btw.
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
Len the man
8
Years of Service
User Offline
Joined: 12th Jun 2015
Location:
Posted: 29th Jul 2018 01:03
@AmenMoses - Thanks for cleaning that script up for me... I found that I needed always active = yes, and physics on = no.

Thanks.
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 29th Jul 2018 12:39
Yep, if it's just scenery moving past there is no need for any physics. If you do need to move a 'physics on' object put CollisionOff/CollisionOn around the Position commands.
Been there, done that, got all the T-Shirts!
PM

Login to post a reply

Server time is: 2024-04-16 17:21:52
Your offset time is: 2024-04-16 17:21:52