• ✨ ARCHIVE MODE ✨
    The forum has now been set to read-only mode, no new posts, resources, replies etc will not be possible.
    We recommend you join our Discord server to get real-time response: Discord Invite Link

Tutorial The Glorious Return Of Mapping Thread

Status
Not open for further replies.

DracoHouston

Kolben Developer
Contributor
Personally I'd like to see the maps completed before doing anything else. Get a working map editor and I'll love you forever.
Someone is making one, this thread is for making maps for nilllzz to help out, or just learning to make custom maps for fun. a map editor is a big job for a 3d game, so i dont blame nilllzz for not doing one sooner. doing this by hand is tedious at times though, especially with no reference docs for the syntax and keywords.

I've gotten that computer password thing working, I use the save registry to store how far through the sequence you are, if you progress it will register to say you need to enter the next number, the script sees this after doing the @options thing and then does another options. You can nest options in ifs but if you want to do things normally done with nested ifs etc you can just do it sequentially with the save registry allowing you to save the results of the logic as the sequence goes.

such a hacky solution but it works
 

DracoHouston

Kolben Developer
Contributor
Scratch that, it stops working about 3 options deep in for no reason. Here is my script

Code:
@Text:Booting up the PC...*Choose a host to~connect to.
 
@Options:Bills PC,<playername>s PC,Hall of Fame,Bruces PC,Log off
 
:when:Bills PC
@Text:Pokemon storage~system accessed.
@Action:StorageSystem
:end
:when:Bruces PC
@Register:brucelogin0
:when:Log off
@Text:Kolben OS~shutting down...
:end
:endwhen
:if:register(brucelogin0)
:then
@Text:You access BRUCES PC*A password is required~4 numbers.
@Options:one,two,three,four
:when:one
@Text:Wrong password~logging off...
:end
:when:two
@Text:Wrong password~logging off...
:end
:when:three
@Text:Wrong password~logging off...
:end
:when:four
@Unregister:brucelogin0
@Register:brucelogin1
:endwhen
:if:register(brucelogin1)
:then
@Text:That seemed to work.~There are 3 more spaces.
@Options:one,two,three,four
:when:one
@Text:Wrong password~logging off...
:when:two
@Unregister:brucelogin1
@Register:brucelogin2
:when:three
@Text:Wrong password~logging off...
:when:four
@Text:Wrong password~logging off...
:endwhen
:if:register(brucelogin2)
:then
@Text:That seemed to work.~There are 2 more spaces.
@Options:one,two,three, four
:when:one
@Text:Wrong password~logging off...
:end
:when:two
@Text:Wrong password~logging off...
:end
:when:three
@Unregister:brucelogin2
@Register:brucelogin3
:when:four
@Text:Wrong password~logging off...
:end
:endwhen
:if:register(brucelogin3)
:then
@Text:That seemed to work.~There is 1 more space
@Options:one,two,three, four
:when:one
@Text:You find~BRUCES CREDIT CARD DETAILS!*You use them to buy potions~before the bank notices*they'll be fenced at~cash converters*Score!
@GiveItem:18,20
@Unregister:brucelogin3
:end
:when:two
@Text:Wrong password~logging off...
:end
:when:three
@Text:Wrong password~logging off...
:end
:when:4
@Text:Wrong password~logging off...
:end
:endwhen
:endif
:end
Selecting the 2nd digit of the password makes it just stop, nothing happens. It's the exact same syntax as the first one that worked, I can't figure it out.

What I'd like to do is have the player sell the potions and that can buy them something that makes the main quest (getting the steak for the outback steakhouse back from a dingo that stole it) easier, but I don't think that would be possible at all. I'm going to work on a chase sequence through route 69 where you try and hunt the dingo down as it runs away through grass.
 

Saruish

Dragon Tamer
Personally I'd like to see the maps completed before doing anything else. Get a working map editor and I'll love you forever.
Someone is making one, this thread is for making maps for nilllzz to help out, or just learning to make custom maps for fun. a map editor is a big job for a 3d game, so i dont blame nilllzz for not doing one sooner. doing this by hand is tedious at times though, especially with no reference docs for the syntax and keywords.

I've gotten that computer password thing working, I use the save registry to store how far through the sequence you are, if you progress it will register to say you need to enter the next number, the script sees this after doing the @options thing and then does another options. You can nest options in ifs but if you want to do things normally done with nested ifs etc you can just do it sequentially with the save registry allowing you to save the results of the logic as the sequence goes.

such a hacky solution but it works
Allright cool. I think I got a idea on how the nurse pc and pokemark will work
Nurse pc of how many time you save the center from team rocket:
  1. 5x potion's. Some stuff to make potions later when and if it become craft-able.
  2. 10x potion's
  3. 5 x super potions
  4. 10x super potions
  5. Some notes about Pokemon's health and 5x antidotes
  6. 10x antidotes
  7. 5x full heals
  8. 10x full heals
  9. 5x full restores
  10. 10x full restores Some notes about pokemon's health.
  11. A free Chancey resets to the start of it.
While you'll still need the password to get on. the items and such wont be on there till team rocket attack the center. Which only happens every so often.
Pokemark pc:
  1. 5x 10% off coupon(disappear when used and only use able for 1 item)
  2. 5x 20% off coupon(disappear when used and only use able for 1 item)
  3. 5x 30% off coupons(disappear when used and only use able for 1 item)
  4. 5x 40% off coupons(disappear when used and only use able for 1 item)
  5. 5x 50% off coupons(disappear when used and only use able for 1 item)
  6. 5x 60% off coupons(disappear when used and only use able for 1 item)
  7. 5x 70% off coupons(disappear when used and only use able for 1 item)
  8. 5x 80% off coupons(disappear when used and only use able for 1 item)
  9. 5x 90% off coupons(disappear when used and only use able for 1 item)
  10. 5x 100% off coupons(disappear when used and only use able for 1 item) Reset to the start of it.
Again the items will only appear after team rocket attacks the mark.
as for the gate officer and train station. I dont have a clue to what their pc could hold. lol Golden rod market pc would be much of the same but a less of a chance of team rocket taken it over. then the others.
 

Saruish

Dragon Tamer
Scratch that, it stops working about 3 options deep in for no reason. Here is my script

Code:
@Text:Booting up the PC...*Choose a host to~connect to.
 
@Options:Bills PC,<playername>s PC,Hall of Fame,Bruces PC,Log off
 
:when:Bills PC
@Text:Pokemon storage~system accessed.
@Action:StorageSystem
:end
:when:Bruces PC
@Register:brucelogin0
:when:Log off
@Text:Kolben OS~shutting down...
:end
:endwhen
:if:register(brucelogin0)
:then
@Text:You access BRUCES PC*A password is required~4 numbers.
@Options:one,two,three,four
:when:one
@Text:Wrong password~logging off...
:end
:when:two
@Text:Wrong password~logging off...
:end
:when:three
@Text:Wrong password~logging off...
:end
:when:four
@Unregister:brucelogin0
@Register:brucelogin1
:endwhen
:if:register(brucelogin1)
:then
@Text:That seemed to work.~There are 3 more spaces.
@Options:one,two,three,four
:when:one
@Text:Wrong password~logging off...
:when:two
@Unregister:brucelogin1
@Register:brucelogin2
:when:three
@Text:Wrong password~logging off...
:when:four
@Text:Wrong password~logging off...
:endwhen
:if:register(brucelogin2)
:then
@Text:That seemed to work.~There are 2 more spaces.
@Options:one,two,three, four
:when:one
@Text:Wrong password~logging off...
:end
:when:two
@Text:Wrong password~logging off...
:end
:when:three
@Unregister:brucelogin2
@Register:brucelogin3
:when:four
@Text:Wrong password~logging off...
:end
:endwhen
:if:register(brucelogin3)
:then
@Text:That seemed to work.~There is 1 more space
@Options:one,two,three, four
:when:one
@Text:You find~BRUCES CREDIT CARD DETAILS!*You use them to buy potions~before the bank notices*they'll be fenced at~cash converters*Score!
@GiveItem:18,20
@Unregister:brucelogin3
:end
:when:two
@Text:Wrong password~logging off...
:end
:when:three
@Text:Wrong password~logging off...
:end
:when:4
@Text:Wrong password~logging off...
:end
:endwhen
:endif
:end
Selecting the 2nd digit of the password makes it just stop, nothing happens. It's the exact same syntax as the first one that worked, I can't figure it out.

What I'd like to do is have the player sell the potions and that can buy them something that makes the main quest (getting the steak for the outback steakhouse back from a dingo that stole it) easier, but I don't think that would be possible at all. I'm going to work on a chase sequence through route 69 where you try and hunt the dingo down as it runs away through grass.
I see where you mess up at.
you didnt add the :end to the 2nd password.
 

nilllzz

Original Developer
Administrator
P3D Developer
For the script:
Code:
:end
is supposed to be at the very end of the entire script.

@Options works like that:
Code:
@Options:Option1,Option2,Option3,Option4
:when:Option1
@Text:Option1
:when:Option2
@Text:Option2
:when:Option3
@Text:Option3
:when:Option4
@Text:Option4
:endwhen
:end
 

DracoHouston

Kolben Developer
Contributor
I see where you mess up at.
you didnt add the :end to the 2nd password.
Where, exactly? Some of the missing :ends are intentional, because if you use the end keyword the script stops, if you want a chain of ifs checking registry like this you have to make the paths that progress through it not have :end in it. Ones that exit the sequence can :end
 

DracoHouston

Kolben Developer
Contributor
For the script:
Code:
:end
is supposed to be at the very end of the entire script.

@Options works like that:
Code:
@Options:Option1,Option2,Option3,Option4
:when:Option1
@Text:Option1
:whenOption2
@Text:Option2
:when:Option3
@Text:Option3
:when:Option4
@Text:Option4
:endwhen
:end
:end lets you exit the script prematurely though, I've seen you use it in your own scripts

some things for people to remember when using options, you can have multiple words but they are separated by commas (,), so an option can't be 'Crikey, mate! I'd love a steak!', lol. also whitespace matters when setting the options, i had the script break earlier because i had the options one,two,three, four (note the space) and the when would check for 'four', not ' four'
 

Saruish

Dragon Tamer
I see where you mess up at.
you didnt add the :end to the 2nd password.
Where, exactly? Some of the missing :ends are intentional, because if you use the end keyword the script stops, if you want a chain of ifs checking registry like this you have to make the paths that progress through it not have :end in it. Ones that exit the sequence can :end
Ah nvm then.
Hey nillz what do you think of my hills and coding for ledges? like can you add a code into ledges where we can make the player land lower. when landing?
 

DracoHouston

Kolben Developer
Contributor
yep that's true.
I'll craft a little specification this week.
how locked down is the specification? can you easily (well, relatively speaking, lol) add in new features like interation and nesting tags? It doesn't ignore tabs either so you can't use them to be all ~*pretty programmer*~ and format your scripts to be more readable. I see you can leave line gaps between stuff which helps a bit at least

It might be much easier to script up the game with that sort of thing, I would also suggest adding in a simple a* pathfinding to NPCs, and having the move and turn keywords automatically make the npc make the necessary movement and turns to reach the desired tile, if pathable. Turning could then take a desired direction instead of how far to turn from the current direction, 0 for north, 1 for east, 2 for south, 3 for west or something.

Ah nvm then.
Hey nillz what do you think of my hills and coding for ledges? like can you add a code into ledges where we can make the player land lower. when landing?
Jump blocks and teleport blocks please! Also the option to make the player or npc do an animation from scripts.
 

Saruish

Dragon Tamer
yep that's true.
I'll craft a little specification this week.
how locked down is the specification? can you easily (well, relatively speaking, lol) add in new features like interation and nesting tags? It doesn't ignore tabs either so you can't use them to be all ~*pretty programmer*~ and format your scripts to be more readable. I see you can leave line gaps between stuff which helps a bit at least

It might be much easier to script up the game with that sort of thing, I would also suggest adding in a simple a* pathfinding to NPCs, and having the move and turn keywords automatically make the npc make the necessary movement and turns to reach the desired tile, if pathable. Turning could then take a desired direction instead of how far to turn from the current direction, 0 for north, 1 for east, 2 for south, 3 for west or something.

Ah nvm then.
Hey nillz what do you think of my hills and coding for ledges? like can you add a code into ledges where we can make the player land lower. when landing?
Jump blocks and teleport blocks please! Also the option to make the player or npc do an animation from scripts.
Well Techonlly if he was to just figure out a way for the legdes to control where the player lands. it would a solution to the issue of the ledges. tho Jump blocks and teleport blocks would still be fun to use.
 

DracoHouston

Kolben Developer
Contributor
Well I'm going to pinch this one off and make another huge post about my progress.

I added an entrance to one side of route69.dat, linking to a copy of pokemon center, outbackfosters.dat. You can view it in its entirety here

This map features the usual NPC dialogue changes on 2 characters, which we have already covered. It also makes use of script blocks and 3 very special NPCs, a trio of pokeballs.

First lets look at my adaption of the elm's lab trigger zone for starting the sequences

Code:
entrance script:
{"Entity"{ENT[{"EntityID"{str[ScriptBlock]}}{"Position"{sngArr[4,0,7]}}{"TexturePath"{str[Center]}}{"Textures"{recArr[[0,48,16,16]]}}{"TextureIndex"{intArr[0,0]}}{"Collision"{bool[0]}}{"ModelID"{int[0]}}{"Action"{int[0]}}{"AdditionalValue"{str[outbackentrance]}}{"Rotation"{int[0]}}]}}
{"Entity"{ENT[{"EntityID"{str[ScriptBlock]}}{"Position"{sngArr[5,0,7]}}{"TexturePath"{str[Center]}}{"Textures"{recArr[[0,48,16,16]]}}{"TextureIndex"{intArr[0,0]}}{"Collision"{bool[0]}}{"ModelID"{int[0]}}{"Action"{int[0]}}{"AdditionalValue"{str[outbackentrance]}}{"Rotation"{int[0]}}]}}
{"Entity"{ENT[{"EntityID"{str[ScriptBlock]}}{"Position"{sngArr[6,0,7]}}{"TexturePath"{str[Center]}}{"Textures"{recArr[[0,48,16,16]]}}{"TextureIndex"{intArr[0,0]}}{"Collision"{bool[0]}}{"ModelID"{int[0]}}{"Action"{int[0]}}{"AdditionalValue"{str[outbackentrance]}}{"Rotation"{int[0]}}]}}
{"Entity"{ENT[{"EntityID"{str[ScriptBlock]}}{"Position"{sngArr[7,0,7]}}{"TexturePath"{str[Center]}}{"Textures"{recArr[[0,48,16,16]]}}{"TextureIndex"{intArr[0,0]}}{"Collision"{bool[0]}}{"ModelID"{int[0]}}{"Action"{int[0]}}{"AdditionalValue"{str[outbackentrance]}}{"Rotation"{int[0]}}]}}
{"Entity"{ENT[{"EntityID"{str[ScriptBlock]}}{"Position"{sngArr[8,0,7]}}{"TexturePath"{str[Center]}}{"Textures"{recArr[[0,48,16,16]]}}{"TextureIndex"{intArr[0,0]}}{"Collision"{bool[0]}}{"ModelID"{int[0]}}{"Action"{int[0]}}{"AdditionalValue"{str[outbackentrance]}}{"Rotation"{int[0]}}]}}
{"Entity"{ENT[{"EntityID"{str[ScriptBlock]}}{"Position"{sngArr[9,0,7]}}{"TexturePath"{str[Center]}}{"Textures"{recArr[[0,48,16,16]]}}{"TextureIndex"{intArr[0,0]}}{"Collision"{bool[0]}}{"ModelID"{int[0]}}{"Action"{int[0]}}{"AdditionalValue"{str[outbackentrance]}}{"Rotation"{int[0]}}]}}
{"Entity"{ENT[{"EntityID"{str[ScriptBlock]}}{"Position"{sngArr[10,0,7]}}{"TexturePath"{str[Center]}}{"Textures"{recArr[[0,48,16,16]]}}{"TextureIndex"{intArr[0,0]}}{"Collision"{bool[0]}}{"ModelID"{int[0]}}{"Action"{int[0]}}{"AdditionalValue"{str[outbackentrance]}}{"Rotation"{int[0]}}]}}
This is a line of script blocks to trigger if you try and enter or leave the room.

Code:
:if:register(enteredoutbackbutnotdone)
:then
@Text:BRUCE: Crikey, mate!~ Come back here.
@Turn:Player,2
@Move:Player,1
@Text:BRUCE: Cheers, big ears!
:endif
First we check if we have started the sequence but it isn't over yet, if so we are drawn back to the starter pokemon.This is achieved by checking the player registry, which is a text file containing keywords 'registered' by scripts, that can be checked for if they do or don't exist, and can be unregistered. We register enteredoutbackbutnotdone later

Code:
:if:register(leavingoutback)
:then
@Text:BRUCE: Go get me steaks!*It's dangerous to go alone~take this
@Unregister:leavingoutback
@Register:outbackdone
@GiveItem:18,5
:endif
we check if we're done in here, this is so Bruce gives us potions. Note the GiveItem keyword, it takes an id number for the item then the quantity to give, this is 5 potions. We also flag the player as done with the sequence so it can't start again.

Code:
:if:not register(enteredoutback)
:then
:if:not register(outbackdone)
:then
@Text:BRUCE: G'Day <playername>!~Me name's Bruce*You're probably after~some steak?
@Options:Strewth,Nah
:when:Strewth
@Text:Fair 'nuff, mate. There's a~problem though.*A dingo took me steak!~You have to get it back.*I'm going to give you one~ of these pokemon,*each one a fair dinkum Aussie.
@Register:enteredoutback
@Register:enteredoutbackbutnotdone
:when:Nah
@Text:Bugger off then! Crikey.
@Turn:Player,2
@Move:Player,4
:endwhen
:endif
:endif
This is the part that goes the first time you are there, it sets the sequence up and does the dialogue. Unfortunately, moving the character through the door in script will not trigger warp blocks, so the character walks through the wall, oops! This is something I probably can't help.

With that done you are free to choose your starter, but only 1. When you grab it it has to be removed from the world, and the game must remember what you chose for the rival later. This is done in 2 parts, the NPC and the script.

Code:
balls:
{"NPC"{NPC[{"Scale"{sngArr[0.5,0.5,0.5]}}{"Position"{sngArr[6,0.15,2]}}{"TextureID"{str[Pokeball]}}{"ID"{int[3]}}{"Name"{str[Pidgey]}}{"Action"{int[1]}}{"AdditionalValue"{str[outbackpidgey]}}{"Rotation"{int[0]}}{"Movement"{str[Pokeball]}}{"MoveRectangles"{recArr[]}}]}}
{"NPC"{NPC[{"Scale"{sngArr[0.5,0.5,0.5]}}{"Position"{sngArr[8,0.15,2]}}{"TextureID"{str[Pokeball]}}{"ID"{int[4]}}{"Name"{str[Rattata]}}{"Action"{int[1]}}{"AdditionalValue"{str[outbackrattata]}}{"Rotation"{int[0]}}{"Movement"{str[Pokeball]}}{"MoveRectangles"{recArr[]}}]}}
{"NPC"{NPC[{"Scale"{sngArr[0.5,0.5,0.5]}}{"Position"{sngArr[9,0.15,2]}}{"TextureID"{str[Pokeball]}}{"ID"{int[5]}}{"Name"{str[Catapie]}}{"Action"{int[1]}}{"AdditionalValue"{str[outbackcatapie]}}{"Rotation"{int[0]}}{"Movement"{str[Pokeball]}}{"MoveRectangles"{recArr[]}}]}}
These are just NPCs set to a pokeball model that do nothing, and have a script attached to their additional value. Let's look at catapie,

Code:
:if:register(brucepokemongot)
:then
@Text:It contains a~POKEMON caught by~BRUCE.
:end
:endif
This checks if we already have a pokemon from Bruce. If you do you just get text and that is it.

Code:
:if:not register(brucepokemongot)
:then
@ViewPokemonImage:10,0,1
@Text:BRUCE: You'll take~Catapie, the bug~POKEMON?
@Options:Yes,No
:when:Yes
@NPC:remove(5)
@NPC:register(outbackfosters.dat|5|remove|5)
@Register:brucepokemongot
@Register:starter3
@Text:BRUCE: I think that one's a~bloody legend too!
@Action:GetPokemon(10,5,As a gift from BRUCE,5,at Outback Steakhouse)
@Text:<playername> received~Catapie!
@Text:This shiela will heal~your pokemon*Hey true blue.
@Unregister:enteredoutback
@Unregister:enteredoutbackbutnotdone
@Register:leavingoutback
:when:No
@Text:BRUCE: Good idea, mate.~Think it over.
:endwhen
:else
@Text:It contains a~POKEMON caught by~BRUCE.
:endif
:end
This is the actual selection sequence. ViewPokemonImage will bring up a square window with the sprite of the pokemon facing you. Pokemon that can't be given or battled at the time can't be used by this either or it will crash (dragonair has a sprite but isn't actually in yet for example). it takes the national pokedex number, then 2 arguments, which might make it shiny etc, did not try them myself.

Here we have an Options, you give it the possible choices and they will be presented to the player in a list. There can be more than 2 options, I am not aware of the hard limit the game can display, if there even is one (the list could scroll already for all I know). Options can be multiple words like 'yeah sure' or 'no thanks' but you separate them out with commas, so options can't use commas (eg "crikey, mate!") so avoid fancy formatting. Whitespace matters when setting options, for example

Code:
@Options:One, Two, Three, Four
 
:when:One
 
@Text:Number One
 
:end
 
:when:Two
 
@Text:Number Two
 
:end
 
:when:Three
 
@Text:Number Three
 
:end
 
:when:Four
 
@Text:Number Four
 
:end
 
:endwhen
will only work for 'One', because of the spaces after commas, to make it work the first line would be

@Options:eek:ne,Two,Three,Four

On 'Yes' we remove the NPC, this takes the same NPC index as move and turn, look at the order you defined the NPCs, that is the order in which they will spawn and be assigned index numbers. The next line seems to ensure that the game does not forget that NPC is removed.

Then we register some things and give the player the pokemon, this takes a few arguments. The first is national pokedex number for the pokemon, then level, then a description to put in the stats sheet, some number I don't know about, then a description of where it was caught.

That covers what I've got working so far, youtube incoming
 

DracoHouston

Kolben Developer
Contributor
i really wanted to have 'beds are burning' by midnight oil or that men at work song play inside the steakhouse, but I couldnt convert music properly or something, the xnb would not play. I'm guessing it takes a specific format, I tried to convert a midi of the song but XNA didn't even have a converter for that out of the box, so if they're midis i need the library for it i guess. i think i really should play around with custom textures though, because until more features are added to the scripts I've just about tapped out this build lol
 
Status
Not open for further replies.
Top