Need Help Plot-scripting Vehicles to move across maps

Make games! Discuss those games here.

Moderators: Bob the Hamster, marionline, SDHawk

Post Reply
Guroo
Slime
Posts: 5
Joined: Tue Jan 14, 2014 11:34 pm

Need Help Plot-scripting Vehicles to move across maps

Post by Guroo »

Last edited by Guroo on Tue Jan 14, 2014 11:54 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 »

User avatar
Meowskivich
Blubber Bloat
Posts: 2199
Joined: Tue Mar 06, 2012 12:38 am
Location: Earth
Contact:

Post by Meowskivich »

dOn'T MiNd mE! i'M jUsT CoNtAgIoUs!!!
Play Orbs CCG: http://orbsccg.com/r/4r6x :V
Guroo
Slime
Posts: 5
Joined: Tue Jan 14, 2014 11:34 pm

Post by Guroo »

Bob the Hamster wrote:Vehicles can have mount/dismount scripts. The mount script can turn on a tag, and the dismount script can turn it off.
With the vehicle bitset "Enable door use" turned on, if the player enters a door leading to another map, does the dismount script or map autorun script run first? if the map autorun script runs first i could make it to where a tag is turned on when in the vehicle and make the plotscript automatically use the vehicle npc in the new map when the tag is on
Guroo
Slime
Posts: 5
Joined: Tue Jan 14, 2014 11:34 pm

Post by Guroo »

Meowskivich wrote:Something off the top of my head, perhaps a script that changes the first person in the party's sprite to the vehicle and then disable caterpillar party so only hero 1 shows. Just an idea.
I really like this idea but how would i go about exiting the vehicle aswell as having it appear on the map in the location that it was exited? i would like it to be where the player can get in there characters car, drive around the world and explore, and then be able to hop back in at there will
User avatar
Meowskivich
Blubber Bloat
Posts: 2199
Joined: Tue Mar 06, 2012 12:38 am
Location: Earth
Contact:

Post by Meowskivich »

Guroo wrote:
Meowskivich wrote:Something off the top of my head, perhaps a script that changes the first person in the party's sprite to the vehicle and then disable caterpillar party so only hero 1 shows. Just an idea.
I really like this idea but how would i go about exiting the vehicle aswell as having it appear on the map in the location that it was exited? i would like it to be where the player can get in there characters car, drive around the world and explore, and then be able to hop back in at there will
I...haven't quite got that part figured, perhaps with a menu command to exit the vehicle that simultaneously turns back on caterpillar party (if you want it on), changes front hero back to normal, and creates the vehicle NPC right where you are. Um, I don't know how to script much of that, so it's up to a plotsccript veteran to let you know the specifics, but that's my idea. It would probably be best to listen to whatever Bob the Hamster sez...er, says, he knows many things.
dOn'T MiNd mE! i'M jUsT CoNtAgIoUs!!!
Play Orbs CCG: http://orbsccg.com/r/4r6x :V
Guroo
Slime
Posts: 5
Joined: Tue Jan 14, 2014 11:34 pm

Post by Guroo »

Meowskivich wrote:
Guroo wrote:
Meowskivich wrote:Something off the top of my head, perhaps a script that changes the first person in the party's sprite to the vehicle and then disable caterpillar party so only hero 1 shows. Just an idea.
I really like this idea but how would i go about exiting the vehicle aswell as having it appear on the map in the location that it was exited? i would like it to be where the player can get in there characters car, drive around the world and explore, and then be able to hop back in at there will
I...haven't quite got that part figured, perhaps with a menu command to exit the vehicle that simultaneously turns back on caterpillar party (if you want it on), changes front hero back to normal, and creates the vehicle NPC right where you are. Um, I don't know how to script much of that, so it's up to a plotsccript veteran to let you know the specifics, but that's my idea. It would probably be best to listen to whatever Bob the Hamster sez...er, says, he knows many things.
ill look into how i could make this work in my game however i dont know if i could make that function smoothly. if dismount scripts run after a map startup script if a player enters a door to a seperate map in a vehicle i could make it where the tag turned on by being in the vehicle would make you automatically use the vehicles npc in the next map, however i dont know if thats how it is or not.
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 »

Guroo wrote:With the vehicle bitset "Enable door use" turned on, if the player enters a door leading to another map, does the dismount script or map autorun script run first? if the map autorun script runs first i could make it to where a tag is turned on when in the vehicle and make the plotscript automatically use the vehicle npc in the new map when the tag is on
I actually can't remember which will happen first. The easiest way to test is with a pair of scripts like this

Code: Select all

plotscript, on dismount test, begin
  $0="dismount script"
  trace(0)
end

plotscript, map autorun test, begin
  $0="autorun script"
  trace(0)
end
Compile these scripts and assign them to the vehicle and the map autorun in your game, and then play and go through a door while riding the vehicle.

the "trace" command adds a line to the end of the g_debug.txt file

If you open g_debug.txt and look at the bottom and you find

Code: Select all

autorun script
dismount script
then that means the autorun script ran first before the dismount script.
User avatar
Mystic
Metal Slime
Posts: 322
Joined: Wed Jul 23, 2008 4:32 am

Post by Mystic »

I should do more thorough testing, but a couple years ago I was trying to get a script with mounting and dismounting vehicles working and it just never worked the way I assumed it would. I might look at it again.

I was asking in IRC and most people said "just do [x]" and so I assumed it was some stupid mistake I was making. There was a deadline so I ended up working on something else and having that scene not happen.
Post Reply