Announcement: Be excellent to each other.


Caravel Forum : DROD RPG Boards : RPG Architecture : Inventory with Cmd - help
New Topic New Poll Post Reply
Poster Message
underscorpion
Level: Goblin
Avatar
Rank Points: 17
Registered: 06-17-2008
IP: Logged
icon Inventory with Cmd - help (0)  
Hi.
I have a problem. I want to do special room called "Inventory", using Cmd button. I know how to go there but I don't really know how to return and to make hero stay at the same square.

Example:
Hero - (1,2)
Press Cmd button -> go to Inventory > I can do that ;)
When you are in Inventory, press Cmd - return to the previous level, room at (1,2) > Tell me, how can I do this? ;p
I tried with go to level entrance (return to prior location, but it teleports me to Inventory again (like restarting level))

If you don't really know, what am I talking about, I want to do an Inventory room like in Tower of the Sorcerer hold by TFMurphy ;)

____________________________
I'm one of the polish DROD players ;)

-=Sorry for my English :P=-

[Last edited by underscorpion at 04-22-2009 01:13 PM]
04-22-2009 at 01:12 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
mxvladi
Level: Smitemaster
Rank Points: 2505
Registered: 02-11-2008
IP: Logged
icon Re: Inventory with Cmd - help (0)  
Make a custom character.

Put the following script in its default script:

Imperative Make script global
Equipment Swap Command Inventory
Label "2"
  Each Use "1"
  Go to "2"
Label "1"
  If...
      Wait until var Inv = 0
    Set var Inv = 1
    Go to level entrance (Skip entrance screen) "Inventory: The Entrance: InvEnt" (choose here the location of your inventory level)
    Go to "2"
  Else
    Set var Inv = 0
    Go to level entrance (Skip entrance screen) (Return to prior location)
    Go to "2"


Then put an NPC which has the command:

Equipment swap command <<name of custom character with above script here>>

this will give you an inventory
04-22-2009 at 01:29 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
underscorpion
Level: Goblin
Avatar
Rank Points: 17
Registered: 06-17-2008
IP: Logged
icon Re: Inventory with Cmd - help (0)  
It's not working :(
It still teleports me from Inventory to Inventory :/

This is my script

Each use Use
Equipment 0,4,20000
Go to End
Label Use
Go to level entrance 3,1 <skip entrance screen, Inventory: The Entrance: Entrance 3
Label End


20000 - Inventory NPC's ID
I have an NPC in Inventory and his script is:

Each use Use
Equipment 0,4,20000
Go to End
Label Use
Go to level entrance -2,1 <skip entrance screen, return to prior location>
Label End


Your script does the same what mine does ;)
What am I doing wrong?? ;/

____________________________
I'm one of the polish DROD players ;)

-=Sorry for my English :P=-

[Last edited by underscorpion at 04-22-2009 01:46 PM]
04-22-2009 at 01:45 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
rman
Level: Smiter
Avatar
Rank Points: 371
Registered: 09-24-2007
IP: Logged
icon Re: Inventory with Cmd - help (0)  
underscorpion wrote:
It's not working :(
It still teleports me from Inventory to Inventory :/

This is my script

Each use Use
Equipment 0,4,20000
Go to End
Label Use
Go to level entrance 3,1 <skip entrance screen, Inventory: The Entrance: Entrance 3
Label End


20000 - Inventory NPC's ID
I have an NPC in Inventory and his script is:

Each use Use
Equipment 0,4,20000
Go to End
Label Use
Go to level entrance -2,1 <skip entrance screen, return to prior location>
Label End


Your script does the same what mine does ;)
What am I doing wrong?? ;/

Your script seems really strange to me. Anyway (I'm about mxvladi's script now), are you sure that you have the var Inv?

____________________________
Click here to view the secret text

Best quote ever (TSS ending spoiler):
Click here to view the secret text

04-22-2009 at 02:27 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
underscorpion
Level: Goblin
Avatar
Rank Points: 17
Registered: 06-17-2008
IP: Logged
icon Re: Inventory with Cmd - help (0)  
Yeah, I'm sure :rolleyes
Hmm. Is it possible to make it using _MyscriptX and _MyscriptY??
I don't know how to do it ;(
Or, maybe you'll do an example for me using just 2 empty rooms and NPC(s) ;p Scripting in DROD is sooo weird ;p

____________________________
I'm one of the polish DROD players ;)

-=Sorry for my English :P=-
04-22-2009 at 02:41 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
Nuntar
Level: Smitemaster
Avatar
Rank Points: 4576
Registered: 02-20-2007
IP: Logged
icon Re: Inventory with Cmd - help (+1)  
underscorpion wrote:
It's not working :(
It still teleports me from Inventory to Inventory :/
Yes, because "Each use" in the second script is never called. Both scripts contain the line "Equipment 0,4,20000". This sets the "Command" equipment slot to 20000 -- i.e. the first script, the one that takes you to the inventory -- so when you press "Command" it will go to "Each use" in the first script and will go to the inventory. You can never get out.

There are two ways round this. One, make your second script a character's default script -- let's say the character with ID 20001. Then, after "Go to level entrance" in the first script, put "Equipment 0,4,20001" so that the second script is called next time, taking you out of the inventory. And put "Equipment 0,4,20000" after "Go to level entrance" in the second script so you can get back into the inventory again. Or, have just one script and use a variable to flip between the two behaviours (this is mxvladi's solution).

rman wrote:
Anyway (I'm about mxvladi's script now), are you sure that you have the var Inv?
Variables cannot unexist. If a variable is queried before it has ever been set, its value will be 0.

____________________________
50th Skywatcher

[Last edited by Nuntar at 04-22-2009 05:17 PM]
04-22-2009 at 05:09 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
rman
Level: Smiter
Avatar
Rank Points: 371
Registered: 09-24-2007
IP: Logged
icon Re: Inventory with Cmd - help (0)  
Nuntar wrote:
rman wrote:
Anyway (I'm about mxvladi's script now), are you sure that you have the var Inv?
Variables cannot unexist. If a variable is queried before it has ever been set, its value will be 0.
Huh, I didn't know that. Thanks for the explanation!

____________________________
Click here to view the secret text

Best quote ever (TSS ending spoiler):
Click here to view the secret text

04-22-2009 at 05:24 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
Sillyman
Level: Smiter
Avatar
Rank Points: 339
Registered: 09-08-2006
IP: Logged
icon Re: Inventory with Cmd - help (0)  
This can be made a bit simpler if you split it into three simple scripts (substituting, of course, the proper IDs)...

Put in first room:
  Equipment 0,4,20000

Inventory's Default Script:
Label Loading
  Each use Run
  Go to Ready
Label Run
  Go to level entrance 3,1
Label Ready

Put in inventory room:
  Imperative 14
  Equipment 3,4
  Wait for entity Player 14,14,14,14
  Equipment 4,4
  Go to level entrance -2,1


____________________________
Who, me?
FNORD

[Last edited by Sillyman at 04-22-2009 07:19 PM]
04-22-2009 at 07:18 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
Someone Else
Level: Smitemaster
Avatar
Rank Points: 1299
Registered: 06-14-2005
IP: Logged
icon Re: Inventory with Cmd - help (0)  
Or you can simply do this:

Equipment Swap Command Inventory
  Each Use "1"
  Go to "2"
Label "1"
  If...
      Wait until var Inv = 0
    Set var Inv = 1
    Go to level entrance (Skip entrance screen) "Inventory: The Entrance: InvEnt" (choose here the location of your inventory level)
    Go to "2"
  Else
    Set var Inv = 0
    Go to level entrance (Skip entrance screen) (Return to prior location)
    Go to "2"
  If End
Label "2"

04-22-2009 at 07:50 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
Sillyman
Level: Smiter
Avatar
Rank Points: 339
Registered: 09-08-2006
IP: Logged
icon Re: Inventory with Cmd - help (0)  
I think you'll find that I have fewer lines. Plus your script is not Ctrl-Shift-B compatible.

Seriously, look at the scripts. Not counting whitespace, both are 15 lines. Then you cut out the three lines that aren't part of scripts from mine.

____________________________
Who, me?
FNORD
04-22-2009 at 09:08 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
underscorpion
Level: Goblin
Avatar
Rank Points: 17
Registered: 06-17-2008
IP: Logged
icon Re: Inventory with Cmd - help (0)  
Idiot, idiot, idiot ..., what an idiot :selftwak
I did it by myself, but you all will be in credits for your help ;p
Why I am an idiot? I made very stupid mistake ;)
Thanks a lot for your help :thumbsup

____________________________
I'm one of the polish DROD players ;)

-=Sorry for my English :P=-
04-23-2009 at 02:21 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
12th Archivist
Level: Smitemaster
Avatar
Rank Points: 789
Registered: 12-07-2008
IP: Logged
icon Re: Inventory with Cmd - help (0)  
You are an idiot simply because you are ignorant. If you take the knowledge in this thread and learn from it, you won't be an idiot. Don't call yourself an idiot and believe that, or else you won't learn from your mistakes.

[/post with no relevance to thread]

____________________________
It was going well until it exploded.
~Scott Manley

Check out the DROD Wikia project here!
04-24-2009 at 04:22 AM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
New Topic New Poll Post Reply
Caravel Forum : DROD RPG Boards : RPG Architecture : Inventory with Cmd - help
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.