using puzzle items?
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
using puzzle items?
2 questions,
inventory system?
i see that there are several boxes for inventory, are these for items u can hold and use them when your ready (hexen,)or would puzzle items go in here?
and
Puzzle Items.. how would I go about using them, Im assuming its all script based, but any suggestions would help because im clueless about it..but ill be checking hexen.wad out alot to see how it is setup
inventory system?
i see that there are several boxes for inventory, are these for items u can hold and use them when your ready (hexen,)or would puzzle items go in here?
and
Puzzle Items.. how would I go about using them, Im assuming its all script based, but any suggestions would help because im clueless about it..but ill be checking hexen.wad out alot to see how it is setup
-
- Posts: 1061
- Joined: Wed Jul 16, 2003 5:29 pm
- Location: Monrovia, CA, USA
I'm not much up on Hexen, but Heretic has lots of inventory items to carry around and use when appropriate. Using an editor, I can see the "puzzle piece" items in Hexen.wad and I'm quite sure that they would usually be assigned a "special", which could be a script to execute, or some direct action to effect.
-
-
- Posts: 26441
- Joined: Tue Jul 15, 2003 4:58 pm
- Location: Scotland
On looking at the line types available in Hexen using DeePsea, I spotted this:
Type 129 Script W/Puzzle+item0~16 - script - arg3 - arg4 - arg5
So from that, I guess you set a line to be type 129, tell it which puzzle item you want to activate it (using a number from 1 to 16), tell it the script number you want and pass any other relevant args as well.
So, it looks like that's how it should work in Hexen. Whether that will work in a Doom/Heretic game too - I dunno.
Type 129 Script W/Puzzle+item0~16 - script - arg3 - arg4 - arg5
So from that, I guess you set a line to be type 129, tell it which puzzle item you want to activate it (using a number from 1 to 16), tell it the script number you want and pass any other relevant args as well.
So, it looks like that's how it should work in Hexen. Whether that will work in a Doom/Heretic game too - I dunno.
-
- Posts: 912
- Joined: Tue Jul 15, 2003 5:12 pm
In theory it should work (as long as you have that puzzle piece in Doom/Heretic) since all the specials hard coded into Doom and Heretic (not 100% sure about Heretic since I never edited for it) with set speeds and such have been generalized using the better Hexen format. I have to run off to work now but I'm sure I'll check it when I get back :)
-
- Posts: 1061
- Joined: Wed Jul 16, 2003 5:29 pm
- Location: Monrovia, CA, USA
Thanks Nigel, that makes sense and I did not know about that linetype. So, puzzle items can have several uses. By assigning the item a special, it can do something at the time it's picked up, and also do something later when the player encounters the matching line.Enjay wrote: So from that, I guess you set a line to be type 129, tell it which puzzle item you want to activate it (using a number from 1 to 16), tell it the script number you want and pass any other relevant args as well.
Cyb, eagerly anticipating your test results of this in a doom game.
-
- Posts: 912
- Joined: Tue Jul 15, 2003 5:12 pm
okay just tried it, and indeed it does work
made a hexen map with yorik's (sp?) skull and a switch that lowered a pillar via the line enjay mentioned to make sure it worked in hexen. then I loaded it into wadauth with the zdoom2 wcf loaded, switched the textures and swapped the skull for a key which activated a script that gave you yorki's skull (PuzzSkull is the actor name) and takes away the blue key and it worked exactly the same way, so yes, the line does work in doom and I presume heretic
made a hexen map with yorik's (sp?) skull and a switch that lowered a pillar via the line enjay mentioned to make sure it worked in hexen. then I loaded it into wadauth with the zdoom2 wcf loaded, switched the textures and swapped the skull for a key which activated a script that gave you yorki's skull (PuzzSkull is the actor name) and takes away the blue key and it worked exactly the same way, so yes, the line does work in doom and I presume heretic
-
- Posts: 1061
- Joined: Wed Jul 16, 2003 5:29 pm
- Location: Monrovia, CA, USA
-
-
- Posts: 26441
- Joined: Tue Jul 15, 2003 4:58 pm
- Location: Scotland
You should be able to. You can certainly summon them. If you try and use them after picking them up, you correctly get a "cannot be used here" message. What the puzzle item does is determined by the script on the line rather than the item itself. Of course the item could also be given a script on pickup by setting a special for it after it is spawned.Biff wrote:No way to directly put that puzzle item into doom, then? Well, not exactly directly but use a spawnspot command to put it there in an open script, ala heretic weapons and such?
I'm guessing Cyb just used the key because he found it more convenient.
-
- Posts: 1061
- Joined: Wed Jul 16, 2003 5:29 pm
- Location: Monrovia, CA, USA
-
- Site Admin
- Posts: 7731
- Joined: Wed Jul 09, 2003 10:30 pm
Yes. If the puzzle item is used, it also gets removed from the player's inventory like any other artifact. If that's not appropriate to your needs, you can always add it back through the script that gets executed.Biff wrote:Does a line type 129 simply check for the presence of the needed puzzle item in the player's "inventory", and activate the script if the puzzle item is present?
-
- Posts: 912
- Joined: Tue Jul 15, 2003 5:12 pm
-
- Posts: 4220
- Joined: Tue Jul 15, 2003 5:07 pm
- Location: Nottingham, UK
You could probably use any custom item as a puzzle item... Basically, you can spawn a custom item (using decorate) and make it clear that it has to be used somewhere. As soon as you use it on that place, execute a script to check weather the player has the item, and if he/she does, then remove the item and activaste the special or whatever. With this method you can use much more than just the hexen puzzle pieces...
I think this works... just a rough guess, but it should work...

I think this works... just a rough guess, but it should work...

-
-
- Posts: 26441
- Joined: Tue Jul 15, 2003 4:58 pm
- Location: Scotland
What you suggest would work. Create an item using decorate. Pick it up to run a script that sets a variable. Whatever you need to happen when you try and use the item checks the variable before it does what it is supposed to. If you have picked up the item, things happen, if you haven't they don't.
The main difference between that and using the Hexen puzzle items is that the Hexen puzzle items can actually appear in the status bar inventory. Since Randy has added an inventory bar to Doom, if you pick up a Hexen (or Heretic) item in a Doom game, provided suitable graphics have been included, it will appear in the status bar.
You could keep track of non Hexen (decorate) items using scripts and fonts, but seeing as how a system already exists, there's no need in most cases.
The main difference between that and using the Hexen puzzle items is that the Hexen puzzle items can actually appear in the status bar inventory. Since Randy has added an inventory bar to Doom, if you pick up a Hexen (or Heretic) item in a Doom game, provided suitable graphics have been included, it will appear in the status bar.
You could keep track of non Hexen (decorate) items using scripts and fonts, but seeing as how a system already exists, there's no need in most cases.
-
- Posts: 10002
- Joined: Fri Jul 18, 2003 6:18 pm
- Location: Idaho Falls, ID
It would be nice if puzzle items could also execute a script on "Player attempts to use at wrong time." If no script it set, you get the usual, cryptic and confusing "Item can't be used here" crap. Otherwise, the script runs and you can actually inform the player of what he's doing wrong.
Just a thought.
Just a thought.