Carrying a person? Not an escort mission.

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)

Carrying a person? Not an escort mission.

Postby Enjay » Tue Jun 14, 2022 1:20 pm

Just spitballing an idea here. This is borderline just a project idea because it's quite likely that I won't get around to having the time to do it - or at least do the improved version (read on) but you never know. So I thought I might as well ask for some ideas, code suggestions, etc.

The idea is that you are to rescue a lost person in a map (my current idea is maybe a child left behind after an evacuation, or a plague, or something - no fixed idea really). At present, in my working concept map, you pick the child up and (s)he is added to your inventory. (S)he is a non-interactable item in the inventory but you can see his/her face as an inventory icon.

I do not want to do an escort mission!

Honestly, that might be good enough for something that is unlikely to ever to come to fruition, but I was wondering how to make such a thing better in case I ever get around to it.

I do not want to do an escort mission!

My idea was that I could maybe make the child a "weapon". That way, when you pick him/her up, you could auto-change to him/her. Can that be forced? I mean if players have autoswitch turned off?

I do not want to do an escort mission!

I'd have to come up with some "carrying a person in your arms" sprite as the HUD weapon view (maybe beyond my skills, so a hurdle right at the outset) and perhaps consider other weapon characteristics that I might want to obfuscate so that it wasn't obvious that the child was actually just a weapon behind the scenes.

I do not want to do an escort mission!

I thought that, perhaps, the weapon would have to be set to "you can't switch away from this one" (easy enough to do) and, perhaps, running could be disabled while the weapon was readied. Not sure how to do that, but I guess it's possible and I can think of a couple of likely solutions.

I do not want to do an escort mission!

However, the player would not want to be completely vulnerable and stuck with this undroppable bundle for the rest of the map. So there would have to be some way of putting the child down again, but leaving her in the world as an item that could be picked up once you have dealt with whatever threat has presented itself. I guess something in the fire state of the weapon could spawn a new pickup (though somehow it would have to be set to not be accidentally picked up again) and to then change away from/remove the weapon from the inventory.

I do not want to do an escort mission!

So, anyone able to contribute ideas, suggestions, better alternatives, maybe identify maps/mods where something similar might already have been done so I could just steal, erm, borrow the idea etc etc?

Hmmm... Just a thought: maybe an escort mission would work instead? :lol:
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Carrying a person? Not an escort mission.

Postby Enjay » Tue Jun 14, 2022 1:44 pm

In addition, and tangentially related, is there any way to get a freshly collected inventory item to automatically come into focus in your inventory (Hexen or Heretic style) when you pick it up?

What I mean is, if you have a few things in your inventory, one of them will be "in focus" (i.e. selected and visible in the status bar). If you pick up something new, it gets put into your inventory, but it isn't brought into focus. i.e. whatever was in focus before you picked up the new item will still be in focus and the new thing is buried deep in your inventory.

Most of the time that is what you want - you don't want new items moving potentially important things like flechettes out of focus during combat or whatever. However, for some mission critical items (e.g. the child mentioned in version 1 of my example above, or an important puzzle item) it's actually useful to have them drawn to the players attention by appearing in the selected box of the status bar.

So, can such a thing be forced for certain items somehow?
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Carrying a person? Not an escort mission.

Postby Kzer-Za » Tue Jun 14, 2022 2:41 pm

Regarding the first question I immediately thought of Berserk and how you switch to the fist when you pick it up. I think its Pickup state contains the answer to that question: https://zdoom.org/wiki/Classes:Berserk
Kzer-Za
 
Joined: 20 Aug 2017
Operating System: Other Linux 64-bit
Graphics Processor: nVidia (Modern GZDoom)

Re: Carrying a person? Not an escort mission.

Postby Lagi » Tue Jun 14, 2022 3:24 pm

I use zscript code to carry barrels in heretic around. You pick up barrel sprite on map, and carry it around with you, then drop.

Spoiler:




User avatar
Lagi
 
Joined: 23 Jun 2018
Location: Thou shalt alter thy beliefs with new evidence

Re: Carrying a person? Not an escort mission.

Postby Enjay » Tue Jun 14, 2022 3:40 pm

@Kzer-Za Now that I see it, I already knew that existed too - and I've used it before. Thanks for the memory jog.

@Lagi Oooh, yes, that's an alternative approach that I hadn't even considered. Good idea. Thanks.

[edit] I don't suppose that you have a working example do you? The code alone references a few non-existent classes, so doesn't run. If not, no matter. I can pick through it and adapt it anyway. I think most of the missing things are related specifically to barrel behaviour and therefore not something that I would need anyway.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Carrying a person? Not an escort mission.

Postby RKD » Tue Jun 14, 2022 6:09 pm

UW TC by Sir Robin also has something similar. As far as I understand, you can pick up torches, weapons, food, etc.from the world and use/attack/consume or drop them back into said world. There's a download link in the last page.
User avatar
RKD
 
Joined: 19 Mar 2022
Location: Argentina
Operating System: Windows 10/8.1/8/201x 64-bit

Re: Carrying a person? Not an escort mission.

Postby Jarewill » Wed Jun 15, 2022 2:57 am

Enjay wrote:[edit] I don't suppose that you have a working example do you? The code alone references a few non-existent classes, so doesn't run. If not, no matter. I can pick through it and adapt it anyway. I think most of the missing things are related specifically to barrel behaviour and therefore not something that I would need anyway.

I just happened to have remembered the thread with the code in question.
Hope it helps.
Jarewill
 
Joined: 21 Jul 2019

Re: Carrying a person? Not an escort mission.

Postby Caligari87 » Wed Jun 15, 2022 11:14 am

Enjay wrote:In addition, and tangentially related, is there any way to get a freshly collected inventory item to automatically come into focus in your inventory (Hexen or Heretic style) when you pick it up?

What I mean is, if you have a few things in your inventory, one of them will be "in focus" (i.e. selected and visible in the status bar). If you pick up something new, it gets put into your inventory, but it isn't brought into focus. i.e. whatever was in focus before you picked up the new item will still be in focus and the new thing is buried deep in your inventory.

Most of the time that is what you want - you don't want new items moving potentially important things like flechettes out of focus during combat or whatever. However, for some mission critical items (e.g. the child mentioned in version 1 of my example above, or an important puzzle item) it's actually useful to have them drawn to the players attention by appearing in the selected box of the status bar.

So, can such a thing be forced for certain items somehow?


This would likely have to be done with a custom statusbar / HUD which prioritizes the item, because I believe the "focus" item is not synched to the playsim or network. All the gamesim gets is "player used ItemX", but cycling and picking the item in the inventory is a client-side function.

(or something like that)

8-)
User avatar
Caligari87
User Accounts Assistant
 
Joined: 26 Feb 2004
Discord: Caligari87#3089
Github ID: caligari87

Re: Carrying a person? Not an escort mission.

Postby Lagi » Wed Jun 15, 2022 2:01 pm

Enjay wrote: I don't suppose that you have a working example do you? The code alone references a few non-existent classes, so doesn't run. If not, no matter.

you can download Bitter Heretic (where i use it in zscript/barrel.zs and pod.zs) and butcher the pk3 with slade. Sorry, but its been a while since i was doing any modding, i forgot how it works.
User avatar
Lagi
 
Joined: 23 Jun 2018
Location: Thou shalt alter thy beliefs with new evidence

Re: Carrying a person? Not an escort mission.

Postby Enjay » Wed Jun 15, 2022 3:05 pm

As ever, thanks for all the input. Real Life has been exceptionally busy today, so I haven't been able to check things further yet (I will), but I really appreciate the help.

@Caligari87, I didn't know the technical details of why that might be the case but, ultimately, I suspected something along those lines might be the situation. Thanks for confirming and explaining.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Carrying a person? Not an escort mission.

Postby Sir Robin » Sat Jun 18, 2022 11:43 pm

RKD wrote:UW TC by Sir Robin also has something similar. As far as I understand, you can pick up torches, weapons, food, etc.from the world and use/attack/consume or drop them back into said world. There's a download link in the last page.

Wow, yeah, as I was reading this I was thinking that this sounds a lot like the stuff I've been working on.

So I was trying to come up with an inventory system where I could pick up items, then examine them, activate them, deactivate them, use them on other items in inventory, use them on items in the world, and drop them back into the world. At first I considered an inventory bar like heretic/hexen/duek3d/etc but then I wrote code to drag items around in 3d space and liked that a lot better. Think of games like MineCraft where when you select an item you see it in 3d space in front of you instead of just a 2d icon on the interface. It just feels a lot more "real" to see the object out there in the 3d world instead of just on the interface.

My first approach was like you mentioned, I wanted to make every item a weapon so it could be wielded. My early attempts at that are here: https://forum.zdoom.org/viewtopic.php?f=122&t=74430

I went away from that style and instead added a pickup and drop feature to my fist weapon, so it can carry any carriable object without needing to create a weapon for each one. You can see an example of that in my tutorial: https://forum.zdoom.org/viewtopic.php?f=42&t=74220&p=1219490#p1219490

About having it so that if you are carrying something then either you can't switch away or if you do switch away you drop the item, that's also something I'm working on for my mod. See this post or this thread
User avatar
Sir Robin
 
Joined: 22 Dec 2021
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: Intel (Modern GZDoom)

Re: Carrying a person? Not an escort mission.

Postby Enjay » Sun Jun 19, 2022 5:30 am

Wow! It's been a while since I checked what you are doing with that mod. It looks amazing and the mechanics are really coming along - very solid. There is a boat load of very real progress since I last looked at it.

The picking up/carrying works very well (though the tutorial told me to pick up a piece of wood but every time I tried, I was told that I cannot pick up a piece of wood - though I was able to pick up the flask of oil beside it). Your further ideas sound intriguing too so I'll be interested to see where you take it.

As for the initial question, I've had to put what I was doing on (I hope temporary) hold for the moment due to IRL commitments. So I've just gone with shoving the person into the player's inventory as a placeholder. I'll re-visit the more advanced methods and suggested solutions when I get back to looking at the mod in more detail again. So, any and all suggestions are still welcome.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland


Return to Scripting

Who is online

Users browsing this forum: No registered users and 1 guest