Is it possible to place NPCs on top of eachother?

Make games! Discuss those games here.

Moderators: Bob the Hamster, marionline, SDHawk

Post Reply
User avatar
marionline
Metal Slime
Posts: 673
Joined: Sat Feb 26, 2011 9:23 pm

Is it possible to place NPCs on top of eachother?

Post by marionline »

The title is the question. :)

I want to do this, because i want to make doors that lead -depending on the season- to diffrent places.

I didn't find a "On use door: run script"- thing in the editor and i didn't find much in the plotdictionnary either. All I found was an autorun command, but that would mean the player has to enter a map first and then he is beamed to the right map, I guess.

So, I wanted to use the NPC as fake doors, that lead to different version of the same map depending on what tag is set on.
Of couse, the diffrent door should always be on the same place.

I hope you can help me.
Maybe you have a better idea handeling season in game?
User avatar
Newbie Newtype
Reigning Smash Champion
Posts: 1873
Joined: Mon Oct 15, 2007 9:44 pm

Post by Newbie Newtype »

To place NPCs on top of each other you can hold Ctrl + Direction to place instead of just spacebar. Ctrl + Spacebar might work too I don't know.

I'm really not sure how that applies to your scenario, so I'm hoping this is the answer you're looking for and the question is not about something different.
User avatar
marionline
Metal Slime
Posts: 673
Joined: Sat Feb 26, 2011 9:23 pm

Post by marionline »

Thanks! It works! :)
User avatar
shakeyair
Slime Knight
Posts: 215
Joined: Fri Jun 12, 2009 6:15 am

Post by shakeyair »

while it will work just fine to have different NPCs show up with different tags, each with a script linking you somewhere different, its probably easier to do it with plotscripting.

Code: Select all

plotscript, usedoorNPC1, begin
if (checktag (TAG)) then (
 use door (0)
) else (
 if (checktag (TAG2)) then (
  use door (1)
 )
)
end
this way its one NPC per doorway, and the script does all the tag checking for you. But either way will work.

i am 99% positive you can set up door links for plotscripts and not place the door anywhere on the map... if not, well, i'd put them somewhere the person can't get to, hidden by walls.

i am assuming this is the same script that you are having trouble with in the other thread?
Last edited by shakeyair on Sat Oct 01, 2011 10:55 pm, edited 1 time in total.
User avatar
marionline
Metal Slime
Posts: 673
Joined: Sat Feb 26, 2011 9:23 pm

Post by marionline »

Thank you! :D
I tested your script and i'll use it!
And, yes it was the script I had trouble with.

All in all, the three scripts didn't do what i wanted during the last days.
It started to get a little frustraiting.
But you helped me to find the (hopefully) last pice of the puzzle!

Now I can move the hero from inside the house outside, on a snowy map in winter time and a normal map for spring time!

I'm so happy that this works now! :)
Thanks for your help!
TMC
Metal King Slime
Posts: 4101
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Heh. This is actually a built in feature, there's no need to use scripting or step-on NPCs. In the "Link doors" menu you can attach multiple links to each door and add tag conditions to the door links: requiring that one or two tags are set on or off. When you step on the door the first link for that door (going from the top of the menu to the bottom) for which the tag conditionals are met is used. If no door links are enabled, then the door does nothing.
User avatar
marionline
Metal Slime
Posts: 673
Joined: Sat Feb 26, 2011 9:23 pm

Post by marionline »

@ TMC: Thanks for your answer. :)

I need to use 4 Tags wich are either on or off. And there are only two conditional door links. That's why I came up with NPCs.
I guess I could have handled 4 different doorlinks with the following 4 conditions: Tag 1= true, Tag 1= false,Tag 2=true, or Tag 2=false.

But I didn't think of that in the beginning, so in the season-check script each season has a tag with it's name (winter, summer, spring, autumn).
I don't know which method will work better, i'll just try and see how far I get with NPC-fake-Doors...

The bad thing is that I need to plan all the doorlink-data and maps and NPCs. The good thing I that if I later need more conditions or links I can just add them in the NPC's script.
Post Reply