Author Topic: Different spawn locations / Maze map / Dialog crittter look number.  (Read 2713 times)

Offline Slowhand

  • Go for the eyes, Boo! Go for the eyes!
Q1: How do I make multiple spawns for characters. If I want to spawn the players at differnt locations (when they log in for the first time after char creation), taking in consideration what skills did they tag, how do I do that? Are there any sample scripts?

Q2: Can I change the Grid Exit of a map dynamically, so it leads the player to different maps, either random or by some condition. (Player skills, STATS, or some internal timer)

Q3: There is a numbering at the Dialog info, which allows me to enter different dialog info's. How can I access/trigger those?
« Last Edit: August 03, 2015, 09:49:27 pm by Slowhand »

Offline Slowhand

  • Go for the eyes, Boo! Go for the eyes!
Re: Different spawn locations / Maze map / Dialog crittter look number.
« Reply #1 on: August 04, 2015, 09:32:29 pm »
Saved IRC conversation for later use :)

[22:03] <cirnAoPoE> Slowhand
[22:03] <Slowhand> Hi
[22:04] <cirnAoPoE> you got your answers for http://fodev.net/forum/index.php/topic,29790.msg260850.html#msg260850?
[22:04] <Slowhand> tyvm, I will look into it :)
[22:04] <cirnAoPoE> nono
[22:05] <cirnAoPoE> im asking if anyone, or have you figured it out
[22:05] <cirnAoPoE> if anyone has answered*
[22:05] <Slowhand> ah,not yet, I still got lot to figure out
[22:05] <Slowhand> but I'm progressing
[22:05] <Slowhand> I will post the answer there if I figure it out
[22:05] <cirnAoPoE> have you a handle on angelscript?
[22:06] <Slowhand> none at all, but if u know aobut scripting FOnline, I have a question
[22:06] <cirnAoPoE> you know c++ or programming in general?
[22:06] <Slowhand> (I can understand most of the script, I mean I got a clue, but not enough)
[22:06] <Slowhand> I do C++, C#, now learning Java
[22:06] <cirnAoPoE> ok
[22:06] <cirnAoPoE> then for your first question
[22:06] <Slowhand> so, let me check the sacript file
[22:07] <Slowhand> bool s_RefillRobot(Critter& player, Scenery& robot, int skill, Item@ item)
[22:07] <cirnAoPoE> find the function binded in script.cfg @ server bind critter_init
[22:07] <Slowhand> this is a header of a script function, that is called on a Scenery object
[22:08] <cirnAoPoE> normaly is should say @ server bind critter_init main but im not sure what it is in reloaded / 2238
[22:09] <Slowhand> ah, I have not studied this file so intensely, sec
[22:09] <cirnAoPoE> just open script.cfg inside /server/scripts
[22:09] <Slowhand> yes
[22:09] <cirnAoPoE> and ctrl f @ server bind critter_init
[22:10] <cirnAoPoE> or just critter_init
[22:10] <Slowhand> @ server bind critter_init               main
[22:10] <Slowhand> this line
[22:10] <cirnAoPoE> ok then in open main.fos
[22:10] <cirnAoPoE> in /server/script/
[22:10] <Slowhand> yes
[22:10] <cirnAoPoE> this function is called for all new critters NPC or Players
[22:11] <Wipe> and it's a mess :)
[22:11] <cirnAoPoE> so all new player characters start from there
[22:11] <cirnAoPoE> probalby under some if(firstTime && cr.IsPlayer()) statement
[22:12] <Slowhand> so this functions form main.fos? void critter_init(Critter& cr, bool firstTime) {
[22:12] <cirnAoPoE> yes
[22:12] <Wipe> replication@SetStartLocation
[22:13] <Slowhand> if(cr.IsPlayer())     {         cr.ParamBase[TO_SLEEPY_STOPPED] = 0;         if(!firstTime)             MakeSleepy(cr);
[22:13] <cirnAoPoE> lol sleepy
[22:14] <cirnAoPoE> wipe i don't mean no disrespect but why
[22:14] <cirnAoPoE> does that even exist
[22:14] <Slowhand> SetStartLocation(cr); ok, this line form critter_init
[22:14] <Slowhand> this is where u set it up then?
[22:15] <Slowhand> okay, one question please about scripts:)
[22:15] <cirnAoPoE> ok ctrl +f SetStartLocation
[22:15] <cirnAoPoE> thats  afunction
[22:15] <Wipe> becouse it was added
[22:15] <Wipe> :)
[22:15] <cirnAoPoE> you'll probably find #import blahblah
[22:15] <cirnAoPoE> well I guess i'm also guilty of adding inane things as well
[22:15] <cirnAoPoE> #import "stuff" from "scriptname"
[22:16] <cirnAoPoE> go to scriptname.fos and find SetStartLocation
[22:16] <Slowhand> yes
[22:18] <Wipe> < cirnAoPoE> well I guess i'm also guilty of adding inane things as well >>> it was mostly designed by player, we just codemonkey'd it
[22:18] <Slowhand> okay, I think I will figure out from here, I have something I dont understand
[22:18] <cirnAoPoE> just ask
[22:18] <Slowhand> bool s_RefillRobot(Critter& player, Scenery& robot, int skill, Item@ item) {
[22:18] <Slowhand> this is a signature of a function assigned to a Scenery in mapper
[22:19] <Slowhand> if I use this (like the Well/WaterPump in adytum) it works fine
[22:19] <Slowhand> I tried to changed the signature, to use the same logic on critters, but it did not work,
[22:19] <Slowhand> can I achieve the same effect on critters as well? like I use an item form Bag on a critter?
[22:20] <Slowhand> or everride the Skill uses of science repair etc on some critters
[22:20] <Slowhand> Is my questions understanadable?
[22:21] <cirnAoPoE> critter init looks like this
[22:21] <cirnAoPoE> void _FuncName( Critter& cr, bool firstTime )
[22:22] <Slowhand> okay, so in mapper I can only bind 1 function to anything, including critters, so in critter init I have to override these functionalities? do u know of any examples where someoen did similar things?
[22:23] <cirnAoPoE> inside
[22:23] <Slowhand> what I want to do, is at some point of my quest, the player shall be able to use some item (amo) on the critter, do u know of any examples in the code for that?
[22:23] <cirnAoPoE> yes hold on
[22:23] <Slowhand> kk
[22:24] <cirnAoPoE> inside your void _FuncName( Critter& cr, bool deleted )
[22:24] <cirnAoPoE> you just add all the other functions you want
[22:24] <cirnAoPoE> to attatch to your critter
[22:25] <cirnAoPoE> you only need to bind 1 Initalizing function to the critter
[22:25] <cirnAoPoE> that initalizing function cna then call all the other functions you want, to attach event listeners ect
[22:25] <cirnAoPoE> to modify how a critter will react to having an item used on them
[22:25] <Slowhand> ah, okay, did not figure out yet to use the events and listeners, any clue where to start out to understand them easy?
[22:27] <cirnAoPoE> already
[22:27] <cirnAoPoE> have you attatched any script onto a critter
[22:28] <Slowhand> no, I haven't attached scripts to critters, except one, but from dialog and not mapper
[22:28] <Slowhand> and I called an existing one
[22:28] <cirnAoPoE> jus tlook at existing one then
[22:29] <Slowhand> well, I attached the default script to rats so they attack the player by default when close, but that was all, I will sniff around a bit more then
[22:29] <cirnAoPoE> just read that script
[22:31] <Slowhand> okay, will do, when I find out the answer and I understand it, Iwill post it to my question and close it with solved :)

Offline Wipe

  • Rotator
  • Random is god
Re: Different spawn locations / Maze map / Dialog crittter look number.
« Reply #2 on: August 05, 2015, 01:44:38 pm »
You'll most likely need to use triggers for dynamic exit grids, and in trigger script check stats etc. then move the player around.
Games are meant to be created, not played...