Quick scripting question.

Make games! Discuss those games here.

Moderators: Bob the Hamster, marionline, SDHawk

Post Reply
User avatar
Taco Bot
Meat, Cheese, and Silicon
Posts: 484
Joined: Fri Jul 18, 2014 12:15 am
Location: Santa Cruz
Contact:

Quick scripting question.

Post by Taco Bot »

Okay, so I made a textbox that displays a message and then teleports you if you answer "yes."

The teleport script is as follows:

Code: Select all

include, plotscr.hsd
include, scancode.hsi
include, pH.hsi

plotscript,hackin,begin
	add hero (hero:Syre)
	delete hero (hero:Vate)
	if (current map() == map:Test) then(
		teleport to map (map:HackTest, 5, 5)
	)
end
It works just fine, only once I get to the map; my hero and all other NPCs are invisible. I'm still able to interact with them, and by using F1 I can see where the hero is.

Edit: Sorry! Solved it! Accidentally put my background layer above my hero layer...
(Like taking everything in a computer apart and then finding out that the battery just wasn't charged...)
Last edited by Taco Bot on Sat Oct 25, 2014 11:00 pm, edited 2 times in total.
Sent from my iPhone
TMC
Metal King Slime
Posts: 4101
Joined: Sun Apr 10, 2011 9:19 am

Re: Quick scripting question.

Post by TMC »

I think there's a good chance you want to just swap Vate out of the active party and lock (hide) him rather than deleting.
Taco Bot wrote:(Like taking everything in a computer apart and then finding out that the battery just wasn't charged...)
I've done exactly that. Being an ancient laptop with a probably bad battery, it turned out the battery charging light didn't even light up until it's been plugged in an hour.
User avatar
Taco Bot
Meat, Cheese, and Silicon
Posts: 484
Joined: Fri Jul 18, 2014 12:15 am
Location: Santa Cruz
Contact:

Re: Quick scripting question.

Post by Taco Bot »

TMC wrote:I think there's a good chance you want to just swap Vate out of the active party and lock (hide) him rather than deleting.
What's the difference?
Sent from my iPhone
User avatar
kylekrack
Liquid Metal Slime
Posts: 1188
Joined: Mon Jun 16, 2014 8:58 am
Location: USA
Contact:

Post by kylekrack »

I have an unrelated question, but I figured it would fit well on this thread.

How do I tell the game to save certain data in the save file, like where a certain slice is on the screen when the game saves? In Stand, the player is just a walkabout sprite, so it doesn't save where the sprite is, which would be nice, so I can have multiple save points.
My pronouns are they/them
Ps. I love my wife
TMC
Metal King Slime
Posts: 4101
Joined: Sun Apr 10, 2011 9:19 am

Re: Quick scripting question.

Post by TMC »

Taco Bot wrote:
TMC wrote:I think there's a good chance you want to just swap Vate out of the active party and lock (hide) him rather than deleting.
What's the difference?
Deleting them is permanent (all equip is also deleted), and you'll have to create a new copy of the hero to re-add them. See also:
How do I prevent a hero in the reserve party from appearing in the team menu?
How do I tell the game to save certain data in the save file, like where a certain slice is on the screen when the game saves? In Stand, the player is just a walkabout sprite, so it doesn't save where the sprite is, which would be nice, so I can have multiple save points.
I didn't understand the second sentence. But in nightly builds there is a new Saved Game Settings menu where you can set that slices parented to the "sprite layer" slice should be saved in save games. By default no slices are saved.

However your hero slice is parented to the hero walkabouts layer by the "set parent(player,lookup slice(sl:hero layer))" command, so it wouldn't be saved either way. For something as simple as a single slice you would just recreate it in the load game script.
Post Reply