Platformer Spikes - Monster Hand moving Up and Down

Topics regarding Scripting with Reality Factory
Post Reply
Veleran
Posts: 875
Joined: Mon Aug 22, 2005 10:22 am
Location: Greece

Platformer Spikes - Monster Hand moving Up and Down

Post by Veleran » Mon Jan 15, 2018 5:48 pm

I have so far made a working spikes trap of 64x64x12 units and another one32x32x12,that moves up and down like in classic platformers,using 4 entities for just one spike and wanted to ask if you can replace the 4 with one scripted Pawn entity.
You can get a good idea of a similar spike system if you search for videos of the "game 1001 spikes".
Right now i use:
1 bsp world model box 64x64x12 units flagged as empty and faced checked as transparent value 1
2.The movingPlatform entity that moves the frames
3.ModelStateModifier for the damage done by collision.
4 Staticmesh actor for displaying the spikes that is attached on the platform world model.

I will re flag the model from emoty to clip whether i like it or not because the transparency creates a visual hole in the ground when it touches it.
Otherwise it works perfectly but if i want to keep the editor groups small as possible i guess i have to avoid placing many spikes one next to the other,but still i wanted to ask how you would do this bt scripting.

I have created frames that move the polygons up and down to try changing the bounding box height in high level and wonder what method is faster,high or low level.

If you try it using the command "move",i imagine that the pawn will not move down through the ground world geometry, can it?
I make some tests using various boxheight values and i will post the script i have done so far after some more tests.
Last edited by Veleran on Mon Jan 29, 2018 4:41 pm, edited 3 times in total.

User avatar
Grok
Posts: 127
Joined: Sat May 27, 2017 9:20 pm

Re: Platformer Spikes moving Up and Down

Post by Grok » Wed Jan 17, 2018 7:43 pm

This code would take the pawn up and down and going through floor and ceiling.
Run as a low level script.

In this setting the up movement is started with key 1.
Key 2 stops any movement and key 3 starts movement down.

Code: Select all

UPDOWN    [2]
cdY       [-273] 
SPEED        [6] 

-----------------------------------

if(IsKeyDown(1))	
		{
		UPDOWN=1;
		}	
			
		if(IsKeyDown(2))	
		   { 
			UPDOWN=2;
			}		
			
		if(IsKeyDown(3))	
		   {
			UPDOWN=3;
			}	


          if(UPDOWN=1) 
		  {
			 cdY=cdY+SPEED;  
			SetEntityPosition("CD3", -5939, cdY, -1340);  
		  }


                if(UPDOWN=3) 
		  {
			 cdY=cdY-SPEED;  
			SetEntityPosition("CD3", -5939, cdY, -1340);  
		  }

Veleran
Posts: 875
Joined: Mon Aug 22, 2005 10:22 am
Location: Greece

Re: Platformer Monster Hand moving Up and Down

Post by Veleran » Fri Jan 19, 2018 6:33 am

I thought about it and i can not move in the ground the pawn automatically and do not want a terrain hole there.
I changed the subject to the hand pawn type ,the general idea came from it and is more suitable for getting out of an opening.

I do not study scripting with that complicated commands because i spend much time in modelling ,textures and the rest.
I setup a small sample stage to test the hand to upload it so you can take a look if i can not script it correctly.

This is what i have so far,i can destroy it but it does not harm the payer as it should.Also,the hand has trouble getting out of the opening if you stand close above it,and sometimes moves further above its starting position as if get bounced or something,trying to avoid collision with the player.

{
Spawn[ ()
{
Console(true);
BoxHeight(56);
BoxWidth(12);
AttributeOrder("enemy_health", 8, "Destroyed");
NewOrder("Attack");
} ]

Attack[ ()
{
Move("Idle", 64, 48, 90, 0, 0,"");
PlayAnimation("Attack_Grab", true, "");
BlendToAnimation("Attack_Static", 0.5, true, "");
LoopAnimation("Attack_Static", 1, "");
FireProjectile("SKULL3", "BONE FINGER2 KNUCKLE 1", 0, 0, 16, "health", "");
BlendToAnimation("Idle", 0.5, true, "");
Move("Idle", 64, 48, -90,0,0,"");
LoopAnimation("Idle", 2, "");
AddCollisionOrder("DamagePlayer");
RestartOrder();
} ]

Destroyed[ ()
{
SetNoCollision();
BlendToAnimation("Dead_Still", 0.5, true, "");
AddExplosion("BulletExplosion", "BONE FINGER2 KNUCKLE 1", 0, 0, 0);
Remove(true);
} ]

DamagePlayer[ ()
{
ModifyAttribute("health", -10);
AddExplosion("BulletExplosion", "BONE FINGER2 KNUCKLE 1", 0, 0, 0);
NewOrder("Attack");
} ]
}

User avatar
Grok
Posts: 127
Joined: Sat May 27, 2017 9:20 pm

Re: Platformer Monster Hand moving Up and Down

Post by Grok » Tue Jan 23, 2018 8:13 pm

Veleran wrote:
---
DamagePlayer[ ()
{
ModifyAttribute("health", -10);
AddExplosion("BulletExplosion", "BONE FINGER2 KNUCKLE 1", 0, 0, 0);
NewOrder("Attack");
} ]
}

Should it not be

ModifyAttribute("health", -10, "Player");

?

Post Reply