Author Topic: Would like advice on creating a transportation system  (Read 564 times)

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
Would like advice on creating a transportation system
« Reply #15 on: June 04, 2011, 08:46:14 am »


               Depending how many travel options you want to have each NPC offer, and if it will be the same number for each, you're either looking at one script per option, or two, plus the starting conditional.
 Even if there are 100 possible destinations, under a token and variable system, if there are only say, six choices, that's all you would need for scripts, plus the initial starting conditional.
 If the number of options varies, then you also need a starting conditional for each of the choices as well as for each choice on selection.

 The initial starting conditional always returns TRUE on convo start, but that's needed to set the tokens used for destination choices, and cost of each trip, if applicable, plus the tag of the WP they will be transported to.
 I'll get my toolset open and make up a quick example script for the starting conditional, and travel script, since that might help explain better what I mean.
               
               

               
            

Legacy_Badwater

  • Full Member
  • ***
  • Posts: 220
  • Karma: +0/-0
Would like advice on creating a transportation system
« Reply #16 on: June 04, 2011, 09:12:25 am »


               Thanks very much, I appreciate the response. It's one of those things where I know what I want but I'm not so sure how to get there.
               
               

               
            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
Would like advice on creating a transportation system
« Reply #17 on: June 04, 2011, 09:27:40 am »


               Okay, this is just quick, and only sets up one possible node, but I tested it and it works.  Hopefully this is enough to at least get you going with what you want, or give you ideas enough to do it another way.

-- The initial starting conditional:

int StartingConditional()
{
 //// Tokens and variable names should be set to what works with your existing mod standards.
 //// One pair of these needed with unique token numbers per travel option the NPC will offer.
 SetCustomToken (4201, GetLocalString (OBJECT_SELF, "TRAVEL_1_NAME") );
 SetCustomToken (4211, IntToString (GetLocalInt (OBJECT_SELF, "TRAVEL_1_COST")) );

 return TRUE;
}

-- The conditional for conversation node 1:

int StartingConditional()
{
 if (GetLocalInt (OBJECT_SELF, "TRAVEL_1") ) return TRUE;
 return FALSE;
}

-- Option ones example line in the convo itself.  Each line needs to match the tokens set:

<CUSTOM4201>: <CUSTOM4211> GPs.


-- The script for selecting option 1:

//// If you want to do anything elaborate, like a mini cutscene, move this whole routine
//// to an include to keep the size of it down.
//// All you need to pass along, is the NPC, PC, and convo option number, "1" in this example.

void main()
{
 object oPC = GetPCSpeaker();
 int nCost = GetLocalInt (OBJECT_SELF, "TRAVEL_1_COST");
 ////  Putting gold check here, instead of in the conditional,
 ////  so a poorer PC will still see the options available to travel.
 if (GetGold (oPC) < nCost)
    {
     //// This message could alternately be set on the NPC, to give each a more "unique" feel,
     //// but this is just a quick example.
     SpeakString ("You don't have enough gold to travel.");
    }
 else
    {
     SpeakString ("Hop in.  [Gesturing to the nearby wagon]");
     TakeGoldFromCreature (nCost, oPC);
     object   oWP = GetObjectByTag (GetLocalString (OBJECT_SELF, "TRAVEL_1_WP"));
     location lWP = GetLocation (oWP);
     DelayCommand (5.0, AssignCommand (oPC, JumpToLocation (lWP)) );
    }
}



Variables used in this example:
string  TRAVEL_1_WP
string TRAVEL_1_NAME
int       TRAVEL_1_COST (GP cost - any positive number will work.)
int       TRAVEL_1              (TRUE/FALSE type.  Set 1 to activate.  Alternatively, you could just use the cost as the check)

All four variables need to be set for each option the NPC will have, with a unique named conditional and selection script for each.
               
               

               
            

Legacy_Badwater

  • Full Member
  • ***
  • Posts: 220
  • Karma: +0/-0
Would like advice on creating a transportation system
« Reply #18 on: June 04, 2011, 09:32:04 am »


               I'm looking this over to see if I have questions. Thanks for the response.

*Update* I'm going to test this in a test module tomorrow. This looks interesting and helpful. Thanks for the idea.
               
               

               


                     Modifié par Badwater, 04 juin 2011 - 08:36 .
                     
                  


            

Legacy_Axe_Murderer

  • Full Member
  • ***
  • Posts: 199
  • Karma: +0/-0
Would like advice on creating a transportation system
« Reply #19 on: June 04, 2011, 11:04:32 am »


               Easy to set up and flexible but not wildly fancy:
http://nwvault.ign.c...id=16716&id=314

... might help
               
               

               


                     Modifié par Axe_Murderer, 04 juin 2011 - 10:06 .
                     
                  


            

Legacy_TSMDude

  • Hero Member
  • *****
  • Posts: 1515
  • Karma: +0/-0
Would like advice on creating a transportation system
« Reply #20 on: June 04, 2011, 01:02:28 pm »


               

Axe_Murderer wrote...

Easy to set up and flexible but not wildly fancy:
http://nwvault.ign.c...id=16716&id=314

... might help

On a quick side note, awesome to see you back here, Axe.
               
               

               
            

Legacy_lordofworms

  • Sr. Member
  • ****
  • Posts: 422
  • Karma: +0/-0
Would like advice on creating a transportation system
« Reply #21 on: June 04, 2011, 05:58:23 pm »


               http://nwvault.ign.c...s.Detail&id=826

is the coach system I used. (: and in the posts I have a link for a custom horse drawn carriage and tileset interior if you wanted to use custom content
               
               

               
            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
Would like advice on creating a transportation system
« Reply #22 on: June 04, 2011, 06:33:09 pm »


               

lordofworms wrote...

http://nwvault.ign.c...s.Detail&id=826

is the coach system I used. (: and in the posts I have a link for a custom horse drawn carriage and tileset interior if you wanted to use custom content



  If that's the whole package, complete with panning skybox outside the carriage windows to simulate movement, it's definately the way to go for servers using content.

  The little script example I posted would work, but it's simplistic.  By the time I'd finished posting it I'd already thought of ways it could have been better set up.
               
               

               
            

Legacy_Badwater

  • Full Member
  • ***
  • Posts: 220
  • Karma: +0/-0
Would like advice on creating a transportation system
« Reply #23 on: June 05, 2011, 12:24:53 pm »


               Thanks Axe_Murderer. With a little bit of customization to charge gold for players to use it, the Port Me NPC system is going to do what I want.

I have not looked at the coach download yet but I am going to.

Thanks again for everyone's replies.
               
               

               
            

Legacy_Taino

  • Sr. Member
  • ****
  • Posts: 268
  • Karma: +0/-0
Would like advice on creating a transportation system
« Reply #24 on: June 08, 2011, 02:47:45 am »


               

Badwater wrote...

Taino wrote...

Their is a Wagon Transportation which I think is pretty neat... It kinda makes the player feel as if they are on a actual wagon.


Does anyone know more about this?

It is a nice system and very simple to use. One thing it is missing is a random encounter ambush while the wagon is rolling. Check it out for yourself. Here's the link: Caravan Wagon Travel
               
               

               


                     Modifié par Taino, 08 juin 2011 - 01:48 .