Vehicle help

Make games! Discuss those games here.

Moderators: Bob the Hamster, marionline, SDHawk

User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7460
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

If you want an example of two vehicles on the same map, Wandering Hamster has one.

The only difference is that you need an additional set of global variables for each vehicle.

As for the remote vehicle triggering script, can you post it? We might be able to help you figure out what is wrong
User avatar
jcenterprises
Slime Knight
Posts: 132
Joined: Sun Aug 21, 2011 7:30 pm
Contact:

Post by jcenterprises »

plotscript, call jet, begin
use NPC (1)
end
User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7460
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

Ah, yes. That will cause the heroes to walk to whereever the jet is located. Try something like this

Code: Select all

plotscript, call jet, begin
    set NPC speed(1, 20) # really fast
    walk NPC to Y(1, hero Y(0))
    walk NPC to X(1, hero X(0))
    wait for NPC(1)
    set NPC speed(1, 10) # back to whatever is normal for the vehicle
    use NPC (1)
end
User avatar
jcenterprises
Slime Knight
Posts: 132
Joined: Sun Aug 21, 2011 7:30 pm
Contact:

Post by jcenterprises »

Bob the Hamster wrote:Ah, yes. That will cause the heroes to walk to whereever the jet is located. Try something like this

Code: Select all

plotscript, call jet, begin
    set NPC speed(1, 20) # really fast
    walk NPC to Y(1, hero Y(0))
    walk NPC to X(1, hero X(0))
    wait for NPC(1)
    set NPC speed(1, 10) # back to whatever is normal for the vehicle
    use NPC (1)
end
Tried it, had the same result as the old one, the characters still walk to the jet.
User avatar
Gizmog
Metal King Slime
Posts: 2615
Joined: Tue Feb 19, 2008 5:41 am

Post by Gizmog »

Did the jet move at all? It's possible you might have to suspend obstructions or wall maps or something so the vehicle can get all the way there.
User avatar
jcenterprises
Slime Knight
Posts: 132
Joined: Sun Aug 21, 2011 7:30 pm
Contact:

Post by jcenterprises »

Gizmog wrote:Did the jet move at all? It's possible you might have to suspend obstructions or wall maps or something so the vehicle can get all the way there.
Thanks, I added a set NPC ignores walls command and it worked the way I wanted it too. Now I just need to find a way to stop the other vehicle from following me where the jet should have parked.
TMC
Metal King Slime
Posts: 4101
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Just an aside. "suspend npc walls" by itself is dangerous because it will allow wandering npcs to start walking through things. Usually you want to use "suspend npcs" at the same time, and also in this case "suspend obstruction" to let the vehicle move through NPCs.

However you can let NPC 1 walk through anything without having to use "suspend npcs" wth

Code: Select all

set npc ignores walls(1, true)
set npc obstructs(1, false)
Last edited by TMC on Wed Feb 27, 2013 4:08 am, edited 1 time in total.
User avatar
jcenterprises
Slime Knight
Posts: 132
Joined: Sun Aug 21, 2011 7:30 pm
Contact:

Post by jcenterprises »

I don't have any moving NPCs on the map, so that's not an issue. All I need to do now is adjust the autorun map script so that the helicopter is parked only when it is actually used, instead of appearing where the jet was last.
User avatar
jcenterprises
Slime Knight
Posts: 132
Joined: Sun Aug 21, 2011 7:30 pm
Contact:

Post by jcenterprises »

Actually, now I need to know how to make the Remote only work when I am not already in a vehicle because using it while in a vehicle causes some odd behavior, such as characters walking at a higher speed than usual, and vehicles floating in mid-air when not in use.
User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7460
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

jcenterprises wrote:Actually, now I need to know how to make the Remote only work when I am not already in a vehicle because using it while in a vehicle causes some odd behavior, such as characters walking at a higher speed than usual, and vehicles floating in mid-air when not in use.
In the vehicle editor, look for the line that says "If riding set tag"

You can pick a tag that will automatically be turned ON when you ride a vehicle, and turned OFF when you dismount

At the beginning of your vehicle remote script, you can have something like:

Code: Select all

   if(check tag(tag: using vehicle)) then(exit script)
User avatar
jcenterprises
Slime Knight
Posts: 132
Joined: Sun Aug 21, 2011 7:30 pm
Contact:

Post by jcenterprises »

Thanks! I also figured out how to stop having the copter follow the player after parking the jet. I simply got the stop jet script to stop trying to remember where the vehicle was parked everytime the jet was dismounted, it would only work with the copter for some reason, even though I never used it. Now the only way to use the jet at all everytime you enter the world map is with the remote.

EDIT:Oh, so close! Now I gotta make it so the Remote only works on the World Map, no other maps, or it gets errors.
Last edited by jcenterprises on Fri Mar 01, 2013 4:53 pm, edited 1 time in total.
User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7460
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

Try something like this, also at the top of the vehicle remote script

Code: Select all

    if&#40;current map <> map&#58;World Map&#41; then&#40;exit script&#41;
Or you could even get fancy and show a text box that says "This remote only works on the world map!"

Code: Select all

    if&#40;current map <> map&#58;World Map&#41; then&#40;
      show text box&#40;45&#41;
      exit script
    &#41;
Last edited by Bob the Hamster on Fri Mar 01, 2013 6:18 pm, edited 1 time in total.
User avatar
jcenterprises
Slime Knight
Posts: 132
Joined: Sun Aug 21, 2011 7:30 pm
Contact:

Post by jcenterprises »

How do I prevent vehicles from parking on each other? This isn't exactly game-breaking, it's just something I want to know.
TMC
Metal King Slime
Posts: 4101
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

How do you park two vehicles on top of each other? Are they each set to pass through NPCs?
User avatar
jcenterprises
Slime Knight
Posts: 132
Joined: Sun Aug 21, 2011 7:30 pm
Contact:

Post by jcenterprises »

No, not under Vehicle Bitsets anyway, but they pass through other NPCs and park on each other anyway.
Post Reply