Mystic Software Forums

Miscellaneous => Archives => Archive => Topic started by: Anonymous on February 18, 2004, 09:36:10 AM

Title: (no subject)
Post by: Anonymous on February 18, 2004, 09:36:10 AM
I need to know how to put and use airships in a game with RPG Toolkit 2. I'm not a good programmer so anyone out there , if you could help it would be greatly appreciated. Also I need to know how to count items and then progess. I tried doing 6 #if statements but it failed. So if you could, I'd appreciatete it.
Title: (no subject)
Post by: Spyder on February 18, 2004, 09:37:57 AM
What do you mean by "count items and then progress"? Progress to what?
Title: (no subject)
Post by: Anonymous on February 18, 2004, 09:47:06 AM
I put the programme in like this:

#countitem("object",name)
I did this six times
#if (no1!==3)
 {
 #if (no2!==3)
  {
  #if (no3!==3)
   {
   #if (no4!==1)
    {
    #if (no5!==1)
     {
      #if (no6!==1)
       {
       #next!=1
       }
}
}
}
}
}

#if (next!=1)
   {
   #day!=1
                {
It wont work and I can't see why
Title: (no subject)
Post by: Cesque on February 18, 2004, 09:50:49 AM
#itemcount for different default items...

Progress? You can add #progress!=progress+(number) in parts of game, then add some calculation to count this as percentage of maximum progress possible (100%) or simply make 100 progress points in total.

Airships? Get some plugins, heh... It's virtually impossible in default tk, if they have to land in all places on map (and if map consists of more than 1 board).
Title: (no subject)
Post by: Cesque on February 18, 2004, 09:52:18 AM
Yeah, I see you've posted code, but it's absolutely senseless. I get only the part with counting items, what is beyond sounds like no cosmos to me.
Title: (no subject)
Post by: Anonymous on February 18, 2004, 09:54:21 AM
The airships would only be on one board and start and finish at certain points (airstations or the like)
Title: (no subject)
Post by: Spyder on February 18, 2004, 10:08:47 AM
Quote from: Edenane,Wednesday, February 18, 2004 8:47 AM
I put the programme in like this:

#countitem("object",name)
I did this six times
#if (no1!==3)
 {
 #if (no2!==3)
  {
  #if (no3!==3)
   {
   #if (no4!==1)
    {
    #if (no5!==1)
     {
      #if (no6!==1)
       {
       #next!=1
       }
}
}
}
}
}

#if (next!=1)
   {
   #day!=1
                {
It wont work and I can't see why
What doesn't work? I'm guessing your using MrG's plugin to count items, correct? Are you using TK2 or TK3? Also, if this code was cut and pasted, your missing the $ after "name" in the #CountItem command...if that's supposed to be a variable at any rate. I'm not too familiar with plugin commands, especially that one, sorry. As far as airships. By saying they land at air stations, does that mean you don't actually control them? If so, you could just make an airship item and use the #PushItem command or something. You could also try making a character file that uses airship graphics instead of character graphics, and then use #NewPlayr, or #RemovePlayer and #AddPlayer by sending the character to layer 8 so there wouldn't be any solid tiles to run into or something by using the #Send command.
Title: (no subject)
Post by: Anonymous on February 18, 2004, 10:37:40 AM
I mean #itemcount not #countitem i got mixed up but it still doesn't work I have TK2 It wasn't copied and pasted, i wrote it as an example
Title: (no subject)
Post by: DarkElite on February 18, 2004, 03:16:33 PM
hmm...im not familiar with G's plugin (i dont use any plugins at all) but i wouldnt use the default items (i hate them) so i just use a variable (potion!=2 or whatever)
but then you would have to make a battle system and menu system
Title: (no subject)
Post by: Xorlak on February 18, 2004, 03:20:37 PM
Quote from: Edenane,Wednesday, February 18, 2004 9:36 AM
I need to know how to put and use airships in a game with RPG Toolkit 2. I'm not a good programmer so anyone out there , if you could help it would be greatly appreciated. Also I need to know how to count items and then progess. I tried doing 6 #if statements but it failed. So if you could, I'd appreciatete it.
Airships can be tricky, but they're not impossible.  In the simplest case, you're going to do a #newplyr to change the character graphics to the ship graphics and a #putplayer command to send the player to a new layer (you don't want things that were solid while on the ground to be solid when you're on the ship):

Code: [Select]
#newplyr("airship.tem")
#putplayer(playerHandle[0]$,playerX[0]!,playerY[0]!,2) *We'll assume the layer 2 is the "air" layer

And to land:
Code: [Select]
#newplyr("hero.tem")
#putplayer(playerHandle[0]$,playerX[0]!,playerY[0]!,1) * 1 is the ground layer

Now, of course all this does is change the hero into a flying ship and back again at will.  If you want to leave the ship and have it stay there for you to come back to later, you'll have to "remember" where you parked it.  Your landing method would look something like this:

Code: [Select]
#newplyr("hero.tem")
#putplayer(playerHandle[0]$,playerX[0]!,playerY[0]!,1)
*Remember where we put it
#airship_X_location!=playerX[0]!
#airship_Y_location!=playerY[0]!
#airship_board$=BoardTitle[8]$ * You have to get creative here, since there's no variable that contains the name of the current board.   One way is to fill in the name of the current board as one the layer names in the board editor.
#layerput(airship_X_location!,airship_Y_location, 2, "airship.gph") * set down an image of the parked airship on the board

Now to get on the airship, you need to check if the player is standing over it:
Code: [Select]
#if(airship_board$=BoardTitle[8]$)
{
  #if(airship_X_location!=playerX[0]!)
  {
    #if(airship_Y_location!=playerY[0]!)
    {
      #newplyr("airship.tem")
      #putplayer(playerHandle[0]$,playerX[0]!,playerY[0]!,2)
    }
  }
}

Also, you'll probably want the player to be able to see the airship if you leave the board and come back.  In your warp programs, you'll have to do something like this:

Code: [Select]
#send( ... )
#if(airship_board$=BoardTitle[8]$)
{
#layerput(airship_X_location!,airship_Y_location!, 2, "airship.gph")
}
#done


As for your second question, I'm not sure what you mean.  Calling

#itemcount( "potion.itm", dest!)

will make the variable dest! equal the number of potions in the player's inventory.
Title: (no subject)
Post by: Anonymous on February 18, 2004, 04:03:04 PM
The things I need for the item, I mean my person has to have, say, 3 potions, 3 high potions, 1 elixir, 1 megalixir and so on to continue on the storyline I have. As for the airship, thank you very much. Also in a reply to an earlier question I don't nor ever will use a plugin, I just wrote somthing wrong. On the page, not the code.
Title: (no subject)
Post by: Xorlak on February 18, 2004, 05:28:04 PM
Okay, then you'll have something like:

#itemcount( "potion.itm", potions!)
#itemcount( "highpotion.itm", highpotions!)
#itemcount( "elixir.itm", elixirs!)
#itemcount( "megaelixir.itm", megaelixirs!)

#if(potions!>=3)
{
#if(highpotions!>=3)
{
#if(elixirs!>=1)
{
#if(megaelixirs!>=1)
{

*"Okay to pass" code here

}
}
}
}
Title: (no subject)
Post by: Anonymous on February 18, 2004, 05:51:48 PM
It must have been a grammar mistake then. Thank you to everyone who helped, expecially Xorlax & Spyder.
Title: (no subject)
Post by: DarkElite on February 19, 2004, 06:44:39 AM
i hate plugins  :blink: ... :ph34r:
Title: (no subject)
Post by: Anonymous on February 21, 2004, 04:38:13 PM
I got both questions answered. Here's another:
I have random battle sequences on a few boards. And the whole game works fine. Then I saved it as a TPK file. And the random battles don't have any enemy graphics. However, they do have graphics when I use the #fightenemy command. What can I do?
Title: (no subject)
Post by: Dude Man on February 21, 2004, 04:47:14 PM
Hmmm....Maybe you chould use a #random thing and then use the #fightenemy command in them. Or is that what you did? I didn't really fully understand what you said...
Title: (no subject)
Post by: Anonymous on February 21, 2004, 05:14:53 PM
I'm using TK2 to put random battles on some boards and the enemy graphics will not appear, but for bosses, say, the graphics will come. I can fight the invisible enemy but it's boring fighting things you can't see.
Title: (no subject)
Post by: Dude Man on February 21, 2004, 05:52:11 PM
Hmmm...Werid. I don't think I know what to do about that.
Title: (no subject)
Post by: Xorlak on February 22, 2004, 10:48:05 AM
Quote from: Edenane,Saturday, February 21, 2004 4:38 PM
I got both questions answered. Here's another:
I have random battle sequences on a few boards. And the whole game works fine. Then I saved it as a TPK file. And the random battles don't have any enemy graphics. However, they do have graphics when I use the #fightenemy command. What can I do?
Do the enemies appear when you test your game through the editor (not using the TPK file)?  Could be a bug...

Make sure you have the enemies "added to the game" and they have the correct skill level.
Title: (no subject)
Post by: Anonymous on February 22, 2004, 04:45:00 PM
It works fine before I save it as a TPK file.
Title: (no subject)
Post by: Xorlak on February 29, 2004, 11:01:03 AM
Hmmm, must be a bug then.  Just use "Create Setup" to make an installation file the normal way.