Page 1 of 4
Action RPG Starter Kit - DSTeleporter.cs Script
Posted: Sun Aug 16, 2015 9:24 am
by bohnstudios
I am having an issue with Dialogue System's third party support for Action RPG Starter Kit. For the most, I found through pretty thorough testing that everything works great except one thing.......The DSTeleport.cs script changes scenes and saves the data, but it spawns my player in the next scene at the exact same spot where I entered the trigger. The script is supposed to spawn the player at the spawnpoint name provided like in the C# example of the Action RPG Starter Kit. I have been messing with this for the past two days and I'm having such a hard time. I would be so grateful if somebody could help me that knows about this third party integration! I've tried several re-installs on new projects and checking my spawnpoint names and everything I could possibly think of.
Re: Action RPG Starter Kit - DSTeleporter.cs Script
Posted: Sun Aug 16, 2015 10:14 am
by Tony Li
Hi,
You can download an updated ARPG support package on the
Dialogue System Extras page. It makes it much easier to set up teleporters with DSTeleporter. The extras page also includes a set of example scenes that demonstrate how to set up teleporters. This updated package will also be included in the next full release of the Dialogue System (1.5.5).
Re: Action RPG Starter Kit - DSTeleporter.cs Script
Posted: Mon Aug 17, 2015 5:56 am
by bohnstudios
I'm in the process of testing the updated files thoroughly. At first glance, it appears to be working great. Thanks so much for your fast reply and developing such a great asset!
Re: Action RPG Starter Kit - DSTeleporter.cs Script
Posted: Mon Aug 17, 2015 9:23 am
by Tony Li
Thanks! Happy to help!
Re: Action RPG Starter Kit - DSTeleporter.cs Script
Posted: Mon Aug 17, 2015 9:58 am
by terrymorgan
Another ARPG/dialog system user? On the same planet, what's the odds of that? ;--]
If there's a 3rd one..
A couple of things to keep in mind,
#1. There are no SpawnPoint tags
on any spawn points.
Supposing you have a game_main type terrain that goes to different dungeons,
Your main player start does have a spawnplayerc
script on it
the returns to game_main from the dungeons don't have spawnpointc scripts, they're
just invisible cubes with box colliders, trigger is
checked.
The dungeon spawnpoints (I only have 1 per dungeon) do have spawnplayerc scripts, they're invisible cubes with box colliders, trigger is checked.
For some reason I had TeleporterC on a couple of
teleports, this should be DS Teleporter.
You'll see all this with Tony's example, but it
took me a while to notice everything.
More tuts at
https://sites.google.com/site/terrymorgan1213/
Re: Action RPG Starter Kit - DSTeleporter.cs Script
Posted: Mon Aug 17, 2015 10:03 am
by terrymorgan
Also
Add a persistent player spawner script to the Dialog manager.
add all scenes you change levels to to the /file/build settings.
I have 'record level' on my player's Persistent Position Data, it's not checked by
default like 'restore' is. Not sure if that's required, but I get my player spawning in
outer space if I don't check it.
I also added my dialog manager prefab to each level. Be careful here, there's also a default one that you didn't make.
Re: Action RPG Starter Kit - DSTeleporter.cs Script
Posted: Mon Aug 17, 2015 10:14 am
by Tony Li
terrymorgan wrote:I also added my dialog manager prefab to each level.
That's a good tip for debugging. It lets you test a level without having to come in from the "main" scene. When you do come in from the main scene, the main scene's Dialogue Manager will destroy the Dialogue Manager in the level, so you're always guaranteed to have a single, correct Dialogue Manager either way.
Re: Action RPG Starter Kit - DSTeleporter.cs Script
Posted: Fri Aug 21, 2015 5:00 am
by bohnstudios
Do you have any suggestions on making a modified version of the DSTeleport.cs script to load a scene using OnTriggerEnter and Input.GetKeyDowown?...so it changes the level when you press "e" inside of a box collider. Or similar functionality? I'm having a difficult time with the syntax on the script. Not sure if I would need a coroutine or what.
Is it possible to change scenes from a conversation and keep the data intact?
I was also trying to figure wondering how I would change scenes from a menu and keep all the data intact like the DSTeleport script does.
Re: Action RPG Starter Kit - DSTeleporter.cs Script
Posted: Fri Aug 21, 2015 9:03 am
by Tony Li
You'd want to combine the "press E" functionality of ShopC.cs and the level loading functionality of DSTeleporter.cs. I'll see if I can whip up something today and post it here. I'll make sure the script is fully documented so you can see how it works. The key to keeping data intact is calling LevelManager.LoadLevel to load the new level. This method does these things:
1. Tells the current level to save its state. All persistent data components will store their state into the Lua environment.
2. Loads the new level.
3. Tells the new level to restore its state. All persistent data components will restore their state from values stored in the Lua environment, if those values are present.
Re: Action RPG Starter Kit - DSTeleporter.cs Script
Posted: Fri Aug 21, 2015 12:45 pm
by bohnstudios
It's relieving to know that using the "press E" functionality of ShopC.cs was the right track. That would be amazing if you whip that up and commented it for me. I've spent so much time on it that once I see the way you do it I'll never forget! I wish you had more assets. I would buy them all just because you've been so helpful. I did pick up love/hate the other day it looks pretty awesome!