Page 1 of 1

Need Help Plot-scripting Vehicles to move across maps

Posted: Tue Jan 14, 2014 11:51 pm
by Guroo

Posted: Tue Jan 14, 2014 11:56 pm
by Bob the Hamster

Posted: Tue Jan 14, 2014 11:58 pm
by Meowskivich

Posted: Wed Jan 15, 2014 12:30 am
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

Posted: Wed Jan 15, 2014 12:42 am
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

Posted: Wed Jan 15, 2014 1:49 am
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.

Posted: Wed Jan 15, 2014 2:46 am
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.

Posted: Wed Jan 15, 2014 3:39 am
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.

Posted: Sat Jan 18, 2014 6:13 pm
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.