KDIZD Action Locator (How To?)

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!)
Post Reply
strihon
Posts: 11
Joined: Sun Sep 04, 2022 3:09 pm
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)

KDIZD Action Locator (How To?)

Post by strihon »

Greetings.

I'd like to recreate those togglable action locators used in knee deep in zdoom.
I have studied the files from kdizd head to toe, but can't for the life of me figure out how to make them toggleable. Hide or show via menu option.
I know they should be spawned to a certain map spot, but I have no idea how to make them toggleable from menu.

Is there someone who could enlight me with this issue.

Thank you in advance! :)
User avatar
m8f
 
 
Posts: 1445
Joined: Fri Dec 29, 2017 4:15 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Manjaro Linux
Location: Siberia (UTC+7)
Contact:

Re: KDIZD Action Locator (How To?)

Post by m8f »

kdizd_12.pk3/keyconf.txt:

Code: Select all

addmenukey "Activate Locators" locate
alias locate "puke 807"
kdizd_12.pk3/intermap.acs:

Code: Select all

script 807 (void) net {
	if (locations == 1) {	
		Thing_Remove(31001);
		locations = 2;
		hudmessagebold(s:"Action indicators: OFF"; 1, 0, -1, 0.5, 0.5, 0.5, 0.5);
	} else {
		SpawnSpot("locator", 31000, 31001);
		locations = 1;
		hudmessagebold(s:"Action indicators: ON"; 1, 0, -1, 0.5, 0.5, 0.5, 0.5);
	}
}
Key activates the ACS script 807. The ACS script toggles `locations` variable between 1 and 2 to know the state, and depending on it, spawns locators with TID 31001 or destroys them.

To make it activatable via a menu, you'll have to either add a CVar and make the ACS script check this CVar in an infinite loop, or a command to execute `locate`.
strihon
Posts: 11
Joined: Sun Sep 04, 2022 3:09 pm
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)

Re: KDIZD Action Locator (How To?)

Post by strihon »

thanks :) can you use this script within a maps own internal acs without the external acs file?
User avatar
m8f
 
 
Posts: 1445
Joined: Fri Dec 29, 2017 4:15 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Manjaro Linux
Location: Siberia (UTC+7)
Contact:

Re: KDIZD Action Locator (How To?)

Post by m8f »

I think yes.
Post Reply

Return to “Scripting”