The "How do I..." Thread

Archive of the old editing forum
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.
Locked
User avatar
TheDoomGuy
Posts: 260
Joined: Thu Dec 14, 2006 4:08 am

Re: The "How do I..." Thread

Post by TheDoomGuy »

Fixed, nevermind.
Last edited by TheDoomGuy on Thu Oct 14, 2010 11:06 pm, edited 1 time in total.
User avatar
Salad Viking
Posts: 752
Joined: Tue Apr 20, 2010 8:58 pm
Location: In high orbit

Re: The "How do I..." Thread

Post by Salad Viking »

Why are you using cluster 5? Try redefining cluster 1 and using that (it shouldn't make a difference, though).
Dave_B
Posts: 54
Joined: Tue Jun 08, 2010 8:20 am

Re: Hubs and ACS math

Post by Dave_B »

b00mstick wrote:
Dave_B wrote:At the moment I'm creating a hub based wad that utilizes Doom 3 and Quake 4 style 'objectives' messages that can reviewed with the press of a key. This seems to be working ok within the same map, but if i leave the map nothing appears until i return to the map in which the it was activated. I am using an external script which is included by each map's own script for the necessary scripting to try and make it 'global'. Also, I have had the same problem using the switch counting function. How do I fix this?
Did you compile the included script as a [wiki]library[/wiki], and used correct [wiki]scope[/wiki] for data types? Make sure you're using #import for libraries, as noted in wiki.
Yes, I followed the wiki's directions and created the .o file with the A_START and A_END file headers and inserted them into the wad. I appended the map scripts to import the library file, but Doom Builder's ACS script compiler simply comes up with, "Invalid Declarator."
User avatar
Ceeb
Posts: 5125
Joined: Wed Jun 11, 2008 4:07 pm
Location: Castle Wut

Re: The "How do I..." Thread

Post by Ceeb »

Can you show me the code? PM it to me if you'd like. I'll figure it out for you.
User avatar
Demolisher
Posts: 1749
Joined: Mon Aug 11, 2008 12:59 pm
Graphics Processor: nVidia with Vulkan support
Location: Winchester, VA
Contact:

Re: The "How do I..." Thread

Post by Demolisher »

I could never get #import to work either. I just gave up and used global variables and redefined functions.
Dave_B
Posts: 54
Joined: Tue Jun 08, 2010 8:20 am

Re: Hubs and ACS math

Post by Dave_B »

Dave_B wrote:
b00mstick wrote:
Dave_B wrote:At the moment I'm creating a hub based wad that utilizes Doom 3 and Quake 4 style 'objectives' messages that can reviewed with the press of a key. This seems to be working ok within the same map, but if i leave the map nothing appears until i return to the map in which the it was activated. I am using an external script which is included by each map's own script for the necessary scripting to try and make it 'global'. Also, I have had the same problem using the switch counting function. How do I fix this?
Did you compile the included script as a [wiki]library[/wiki], and used correct [wiki]scope[/wiki] for data types? Make sure you're using #import for libraries, as noted in wiki.
Yes, I followed the wiki's directions and created the .o file with the A_START and A_END file headers and inserted them into the wad. I appended the map scripts to import the library file, but Doom Builder's ACS script compiler simply comes up with, "Invalid Declarator."
Problem has been fixed, thanks anyway.
Dave_B
Posts: 54
Joined: Tue Jun 08, 2010 8:20 am

Re: The "How do I..." Thread

Post by Dave_B »

Would anyone know how to create a forcefield effect where the field is invisible by default but briefly fades into visibility and out again when shot or bumped repeatedly, if this is at all possible? I've tried a rudimentary effect that does this, but only for each odd number it gets shot (i.e. 1st, 3rd, 5th times etc.).
User avatar
Ceeb
Posts: 5125
Joined: Wed Jun 11, 2008 4:07 pm
Location: Castle Wut

Re: The "How do I..." Thread

Post by Ceeb »

You could do that pretty simply. Set up an invisible line with your forcefield, make it "block everything". Set it's activation to "player bumps" and "projectile hits", and "monster bumps" if you wish. Create a script like this. Make sure you give the line the spcial 226, [wiki]ACS_ExecuteAlways[/wiki] and not plain [wiki]ACS_Execute[/wiki] or it will wait each time for the script to run it's course.

Code: Select all

script 5 (int f)
{
int a;

    for(a = 0; a < 60; a +=3)
    {
        translucentline(f,a);
        delay(1);
    }
    
    for(a = 60; a > 0; a -=3)
    {
        translucentline(f,a);
        delay(1);
    }
}
Dave_B
Posts: 54
Joined: Tue Jun 08, 2010 8:20 am

Re: The "How do I..." Thread

Post by Dave_B »

Thanks for that, works great ;)
User avatar
juizzysquirt
Posts: 126
Joined: Sun Jan 04, 2009 3:29 pm
Location: Knee-Deep in L.A. Meltdown

Re: The "How do I..." Thread

Post by juizzysquirt »

Here's the deal: I've made a PDA for player as a weapon, I have custom key that starts the ACS-script that uses SetWeapon to bring it up and set up inner workings. The script has a suspend; -command, but I'm having trouble selecting back the previous weapon.

Is there a function that returns the class name of currently selected weapon as a string? That could be used in beginning of the script for that purpose. I'd like this to work with any weapons mod, so setting up an array of predefined strings won't do. I don't want the PDA to be accessible by browsing through weapons either...

Doesn't the flashlight in some D3-mod work this way?
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: The "How do I..." Thread

Post by NeuralStunner »

b00mstick wrote:Is there a function that returns the class name of currently selected weapon as a string?
Not really. There's [wiki]CheckWeapon[/wiki], but that returns a True or False on the class name you give it. There's really no other way around it I'm afraid, you're dealing with a technical limitation of ACS.
User avatar
juizzysquirt
Posts: 126
Joined: Sun Jan 04, 2009 3:29 pm
Location: Knee-Deep in L.A. Meltdown

Re: The "How do I..." Thread

Post by juizzysquirt »

NeuralStunner wrote:
b00mstick wrote:Is there a function that returns the class name of currently selected weapon as a string?
Not really. There's [wiki]CheckWeapon[/wiki], but that returns a True or False on the class name you give it. There's really no other way around it I'm afraid, you're dealing with a technical limitation of ACS.
Too bad...

Wait, wouldn't it be possible to replace the base Weapon-class and add there custom states for raising and lowering pda? That would be inherited automatically to every custom weapon? :wink:
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: The "How do I..." Thread

Post by NeuralStunner »

b00mstick wrote:Wait, wouldn't it be possible to replace the base Weapon-class and add there custom states for raising and lowering pda?
No. It doesn't work that way.
User avatar
juizzysquirt
Posts: 126
Joined: Sun Jan 04, 2009 3:29 pm
Location: Knee-Deep in L.A. Meltdown

Re: The "How do I..." Thread

Post by juizzysquirt »

Uups, I forgot SetActorState doesn't work for weapons, and there really isn't way to replace base class. Well, maybe it would be selected just like normal weapon then...
User avatar
Demolisher
Posts: 1749
Joined: Mon Aug 11, 2008 12:59 pm
Graphics Processor: nVidia with Vulkan support
Location: Winchester, VA
Contact:

Re: The "How do I..." Thread

Post by Demolisher »

Not a How Do I..., but what is the limit on user variable arrays?
Locked

Return to “Editing (Archive)”