"Swap" NPCs on an object

This forum is for discussing anything related to The Quest editor.

"Swap" NPCs on an object

Postby NerfemTudo » Thu Dec 24, 2020 10:41 pm

I wish to know if it is possible to "change" an NPC on a door.
Here's the deal: I want to have a shop NPC during the day, but during the night change it with a non-shop NPC.
My theory is: Script the object that once used, check the time, if it is during the night, make the player talk to another npc instead of going to the store that will be closed at night, if not "default". :geek:
In theory is easy put everytime i tried, the spaghetti code that i wrote made the Editor explode. :oops:
Help?
NerfemTudo
 
Posts: 10
Joined: Wed Dec 23, 2020 11:15 am

Re: "Swap" NPCs on an object

Postby KGold » Sun Dec 27, 2020 5:55 pm

Set the shopkeeper as the default NPC for the door then put this code on the door:

if(evtuse())
{
if(isNight())
talknpc("NPC id here");
else
default();
}
If you have been really too busy,
And you feel your head being dizzy,
It's recommended to have a rest,
I have a good offer-play the Quest! : )
User avatar
KGold
 
Posts: 161
Joined: Sun Jun 10, 2012 3:21 pm
Location: Hungary

Re: "Swap" NPCs on an object

Postby NerfemTudo » Thu Jan 14, 2021 11:39 pm

KGold wrote:Set the shopkeeper as the default NPC for the door then put this code on the door:

if(evtuse())
{
if(isNight())
talknpc("NPC id here");
else
default();
}

Thank you :D
NerfemTudo
 
Posts: 10
Joined: Wed Dec 23, 2020 11:15 am


Return to Editor

Who is online

Users browsing this forum: No registered users and 9 guests