HomePortalFAQSearchMemberlistUsergroupsRegisterLog in
The domain www.kitopen.com will expire on 2018-08-17. Update your bookmarks to point at http://kito.forumotion.com/
Meet the new KITO admins & hear their plans here.
You can use google search to find threads and posts here now. Example

Share | 
 

 NPC Monologs

Go down 
AuthorMessage
DarkHeta

avatar

Game username : DarkHeta
Server : Eternal Time
Female Posts : 70
Join date : 2016-01-18
Age : 18
Location : Russia

PostSubject: NPC Monologs   Thu Mar 15, 2018 9:06 pm

Hello!
Today I write a code, that makes Mobs in critter file an NPC

[Hare]
mesh=hare
hp=65
isCampGiver=true (This string makes Mob an NPC)

Than I create a function "Talk to"




Well, with some magic it works!



But... I want, that all NPCs would have their own monolog, that would write in critter file.
Something like that:
[Hare]
mesh=hare
hp=65
isCampGiver=true
Monolog="Hare: Hello world!"

What shoud I do? Can anyone help me with this problem?
Back to top Go down
https://vk.com/eternaltimenewserver
Hamilton

avatar

Game username : Hamilton
Server : Myatar Legends // Dragon's Den
Female Posts : 395
Join date : 2011-10-20
Age : 32
Location : everywhere

PostSubject: Re: NPC Monologs   Fri Mar 16, 2018 1:56 am

add additional if/else if statements into the function. such as i've done for my npcs here:

Quote :

else if(tFunction=="Talk to")
{
MagixCritter *tCritter = mCritterManager->getByObjectNode(mCurrentObject);
if(tCritter->getCritterType() == "Villager")mChatManager->message("I'm a Villager! Thanks for creating me, "+mCharScreenManager->getName()+"!");
else if(tCritter->getCritterType() == "Village Leader")mChatManager->message("Hey, "+mCharScreenManager->getName()+", you should make some more villagers so that I am not lonely...");
else if(tCritter->getCritterType() == "Ellie")mChatManager->message("Ellie: It's quite the swim, I know. But if you stick through it, you'll discover new lands. I've seen them! In the north and in the east! You really can't miss them.");
else if(tCritter->getCritterType() == "Laurence")mChatManager->message("Laurence: *pant* It's so hot....I'm so thirsty....I heard there was a beautiful oasis out here but it looks like I've only ended up getting myself lost....OH! Will I ever find my way out of this awful place?!");
}

you'll still need to define the critter type for each one

Quote :

else if(tCritter->getCritterType() == "Villager")

you could even assign more talking buttons to them for more phrases and even give those randomizers for endless possibilities.
Back to top Go down
DarkHeta

avatar

Game username : DarkHeta
Server : Eternal Time
Female Posts : 70
Join date : 2016-01-18
Age : 18
Location : Russia

PostSubject: Re: NPC Monologs   Fri Mar 16, 2018 5:19 am

Hamilton wrote:
add additional if/else if statements into the function. such as i've done for my npcs here:

Quote :

else if(tFunction=="Talk to")
{
MagixCritter *tCritter = mCritterManager->getByObjectNode(mCurrentObject);
if(tCritter->getCritterType() == "Villager")mChatManager->message("I'm a Villager! Thanks for creating me, "+mCharScreenManager->getName()+"!");
else if(tCritter->getCritterType() == "Village Leader")mChatManager->message("Hey, "+mCharScreenManager->getName()+", you should make some more villagers so that I am not lonely...");
else if(tCritter->getCritterType() == "Ellie")mChatManager->message("Ellie: It's quite the swim, I know. But if you stick through it, you'll discover new lands. I've seen them! In the north and in the east! You really can't miss them.");
else if(tCritter->getCritterType() == "Laurence")mChatManager->message("Laurence: *pant* It's so hot....I'm so thirsty....I heard there was a beautiful oasis out here but it looks like I've only ended up getting myself lost....OH! Will I ever find my way out of this awful place?!");
}

you'll still need to define the critter type for each one

Quote :

else if(tCritter->getCritterType() == "Villager")

you could even assign more talking buttons to them for more phrases and even give those randomizers for endless possibilities.

It is not almoust, what i need, but sounds interesting.  I thing, that i can make some critter types, that would choose random dialog.
Like this:
[Hare]
Hp=65
Mesh=Hare
isCampGiver=true
isVillager=true
Back to top Go down
https://vk.com/eternaltimenewserver
Hamilton

avatar

Game username : Hamilton
Server : Myatar Legends // Dragon's Den
Female Posts : 395
Join date : 2011-10-20
Age : 32
Location : everywhere

PostSubject: Re: NPC Monologs   Fri Mar 16, 2018 6:24 am

the original code isn't really mine (am i still not allowed to even say their name on here? lol) but it basically is a duplication of the setup for drawpoints but without a bool (true/false) setting. instead, it recognizes the critter class by the critters [name] given. So the game is essentially going:

a critter is clicked on
what is it's name?
[npc]
okay, give "talk" button instead of "attack/praise/draw"
"talk" button was clicked
output [npc] dialogue
Back to top Go down
Sponsored content




PostSubject: Re: NPC Monologs   

Back to top Go down
 
NPC Monologs
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Keeping I.T. Open :: SUPPORT :: Support-
Jump to: