Hacking and door

CRxTRDude

Member
Is there a possibility of a hacking panel and a door that can be opened with attack or something?

What I thought of a panel would be like this: The panel would sit on the top, if the player is right on bottom of it, it will then show an animation where the player tinkers the thing at the same time a bar indicator above the panel will show progress (which can be edited) then it will enable a boolean which can be used for anything such as doors, lights and enemy spawning or something like that. The catch though, when enemies come and attack the player, it will reset, so he needs to clear or be quicker.

The progress can be either slow or quick depending on characters. If the player knows how to hack, progress is quicker. The opposite on hotwiring the panel. This gives a little challenge and twist for different characters.
 
For sure is possible. The panel, in fact, would be a NPC or enemy so you can attack it (there is a way to use it as a panel and using script to interact with it, but it would be harder to do).

Define "tinkers the thing". What you mean with "manipulate" the thing?
 
O Ilusionista said:
For sure is possible. The panel, in fact, would be a NPC or enemy so you can attack it (there is a way to use it as a panel and using script to interact with it, but it would be harder to do).

Define "tinkers the thing". What you mean with "manipulate" the thing?

Yeah, i didn't mean it to interact as in there is a mini game, interact as in making the player stall for a moment, change its animation to 'interacting' to the panel, the panel would have a bar on top that shows progress and that stuff.

I press the attack button when the character's on the bottom and the process starts. They are open for enemies to attack them, so the character needs to be on the clear to hack the panel or else he/she would be attacked.
 
ah, so its just a normal enemy (so the other enemies won't attack it). To do the bar thing, you will need script (check the Wiki about drawbox)
 
So, I only make an enemy type entity that doesn't move and doesn't attack? That means that I need to hit it from the side to activate it, right? Can it be done on another entity class?
 
I only make an enemy type entity that doesn't move and doesn't attack? That means that I need to hit it from the side to activate it, right? Can it be done on another entity class?

I've discovered a way to use other entity types for this purpose. To do this, a script which checks all active entities within certain range is run in character's ATTACK1 animation. The script is looking for entity with correct alias, for instance, doors should use "Door" as alias while switches use "Switch". If one is found, animation is changed to desired animation such door opening or switch pressing

Why ATTACK1? that's because it's animation character plays when attack button is pressed. If you want to use other button to interact, then declare the script in animation played when that button is pressed

What exactly character will do when door opening or switch pressing animation is played will be discussed later :)
 
I've had doors and switches in doom mod for ages, they are just enemy types like O Ilusionista said.  It's not a big problem because you have to exit each stage through a door anyway.  (The door spawns endlevel entity).  Thou it all works fine, I'm sure would be a better way to do this all with script.  Also I wanted some doors to require keys, so obviously that will need script.


@Bloodbane - Cool, so this would let you create doors as type none?  One issue in Doom is I have key assigned for opening doors.  The problem is you can use it to hit normal enemies, it does no damage, but it looks stupid like this, and players can abuse it.  Could the script be modified so this attack can only be performed if there is a Door nearby?

 
Bloodbane said:
I only make an enemy type entity that doesn't move and doesn't attack? That means that I need to hit it from the side to activate it, right? Can it be done on another entity class?

I've discovered a way to use other entity types for this purpose. To do this, a script which checks all active entities within certain range is run in character's ATTACK1 animation. The script is looking for entity with correct alias, for instance, doors should use "Door" as alias while switches use "Switch". If one is found, animation is changed to desired animation such door opening or switch pressing

Why ATTACK1? that's because it's animation character plays when attack button is pressed. If you want to use other button to interact, then declare the script in animation played when that button is pressed

What exactly character will do when door opening or switch pressing animation is played will be discussed later :)

That's a great idea. The button pressing animation (or in my case typing on the console) is needed slightly. I might use drawbox also for a indicator delay or something so that the player is stalled a bit.

BeasTie said:
I've had doors and switches in doom mod for ages, they are just enemy types like O Ilusionista said.  It's not a big problem because you have to exit each stage through a door anyway.  (The door spawns endlevel entity).  Thou it all works fine, I'm sure would be a better way to do this all with script.  Also I wanted some doors to require keys, so obviously that will need script.

The game i'm planning for one doesn't need keys, just opening of doors or triggering obstacles or something like that.
 
oh, BB's idea is pretty cool if you need a real interaction. I use something like this on my mod (if you press attack closer to a drum, box, crate, etc you will pick it up, without any extra weapon model).

  The problem is you can use it to hit normal enemies, it does no damage, but it looks stupid like this
no, you can't. As BB said, the script will check if the alias of whatever is nearby is valid. For example, you will check if a entity called "doorbell" is nearby. It won't trigger in any other entity.

Unless someone is stupid enough to give the alias "doorbell" to, say, a normal enemy. That person should not be alive, lol.
 
Cool, this will really help.

@Bloodbane - can please you post example when you get time?

@CRxTRDude - The progress bar is a good idea.  You could have other stuff like terminals/computers to trigger doors too.

You spawn the doors 1-2 pixels off the z axis of your stage, then they appear to be part of the background panel, but you can still attack it.

dooranim.gif


Combining the switches with the door sprites saves any extra work.  Thou I guess you could have them separate and use script to control the door.  In original doom thou you can open some doors by pressing the switch or the door, so this is fine for me.

Let me know if you guys have any other ideas how to improve them ;)
 
I've trial n errored yesterday and got this working script:
Code:
anim attack1
@script
    void self = getlocalvar("self");
    float x = getentityproperty(self, "x");
    float z = getentityproperty(self, "z");

    void vEntity;                                       //Target entity placeholder.
    int  iEntity;                                       //Entity enumeration holder.
    int  iName;                                         //Entity name.
    int  iMax      = openborvariant("ent_max");         //Entity count.

    float Tx;
    float Tz;
    float Disx;
    float Disz;

    if(frame == 0){
      //Enumerate and loop through entity collection.
      for(iEntity=0; iEntity<iMax; iEntity++){
        vEntity = getentity(iEntity);                 //Get target entity from current loop.
        iName   = getentityproperty(vEntity, "name"); //Get target name

        //Sign?
        if(iName == "Sign" && vEntity!=self){
          Tx = getentityproperty(vEntity, "x");
	  Tz = getentityproperty(vEntity, "z");
          Disx = Tx - x;
          Disz = Tz - z;

          if(Disx >= -12 && Disx <= 12 && Disz >= -25 && Disz <= -15)
          {
            performattack(self, openborconstant("ANI_FOLLOW1"));
          }
        }
      }
    }
@end_script
...(the rest of attack1 animation)

As you can see, this script is declared in ATTACK1 animation
What this script does is to find any entity behind player (you can see the range) with "Sign" as alias. If it finds one, player is changed to FOLLOW1 animation

The script is still crude, I still need to add some lines so the script stores entity with "Sign" alias in an entity variable so it can be manipulated in FOLLOW1 animation later
Also I'm going to change this script to function form so it can be used by other characters :)

BTW I'm using alias as checked value cause it's the most logical value to be checked. We can use entity's health or aggression if we want to
 
I'll definitely try this for later and see if it goes on smoothly.

So in this case, when follow1 is triggered, it can do the drawbox progress bar and stuff right?

@BeasTie, that's what I got in mind, a terminal that the player can do stuff, but as i said, this doesn't spawn a mini game or something. This is where the progressbar comes in.

And I play Doom myself, both switch and door works for me too. ;)
 
BTW you mean you will hold down the key, and while you hold it the progress bar fills?  And if you release before it fills you have to start over?  I remember some games having doors like this, I tihnk Jedi Knight Academy or something.
 
Yeah, similar to that. When you're either let go of the button or being attacked, you have to do it all over again.

I intended that the smart character has faster progress than the brawler or the flexible character, so they have their own advantage and disadvantage.
 
CRxTRDude said:
So in this case, when follow1 is triggered, it can do the drawbox progress bar and stuff right?

Yep, FOLLOW1 animation is totally seperate animation from ATTACK1 so aside of carrying 'entity', you can do anything from hacking, pressing or scratching head in confusion  ;D

Progress bar..... hmmm... reminds me of old game by name of Impossible Mission in which player must search and examine all objects in each room
 
Can the follow1 animation (once activated) can be canceled once the player is under attack, right? That way enemies can cancel the progress of the hacking, which now I figure to put the progressbar script on the follow1 animation.
 
Back
Top Bottom