Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Work in progress Flawless' thread of inspiration
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#1
Flawless' thread of inspiration

Hi.


Sometimes I get a rush of inspiration, but never really finish anything.
Then I have a prototype going to waste.

I figured I'd like to share whatever I come up with.

You're allowed to use my concepts in any mod you make as long as you credit me

Parkour
Preview
Wallrunning and high jumping

Frictional Science
Preview
Inspired by the Portal series.

Confusion
Preview
Things change when the magic door closes.

Moving an entity with scripting [Animated] VERY EXPERIMENTAL
Here, I made a script on how to move a static entity with the SetEntityPos scriptline.
WARNING: Move only 1 object at a time. Can cause lag.
Spoiler below!

This has to be in your scriptfile:
PHP Code: (Select All)
void MoveEntityToEntity(string &in asEntitystring &in asDestEntityfloat afSpacefloat afFreq)
{
    if(
GetLocalVarInt("Moving"+asEntity) == 1)
    {
        
AddDebugMessage("Object already moving"false);
        return;
    }
    
    
SetLocalVarFloat("MoveFreq_"+asEntityafFreq);
    
    
SetLocalVarFloat("MoveSpace_"+asEntityafSpace);
    
    
float afAmountX GetEntityPosX(asDestEntity)-GetEntityPosX(asEntity);
    
SetLocalVarFloat("MoveAmountX_"+asEntityMathSqrt(MathPow(afAmountX2)));
    
SetLocalVarFloat("MoveSpaceX_"+asEntityafSpace);
    if(
afAmountX 0)
    {
        
SetLocalVarFloat("MoveSpaceX_"+asEntity, -afSpace);
    }
    
    
float afAmountY GetEntityPosY(asDestEntity)-GetEntityPosY(asEntity);
    
SetLocalVarFloat("MoveAmountY_"+asEntityMathSqrt(MathPow(afAmountY2)));
    
SetLocalVarFloat("MoveSpaceY_"+asEntityafSpace);
    if(
afAmountY 0)
    {
        
SetLocalVarFloat("MoveSpaceY_"+asEntity, -afSpace);
    }
    
    
float afAmountZ GetEntityPosZ(asDestEntity)-GetEntityPosZ(asEntity);
    
SetLocalVarFloat("MoveAmountZ_"+asEntityMathSqrt(MathPow(afAmountZ2)));
    
SetLocalVarFloat("MoveSpaceZ_"+asEntityafSpace);
    if(
afAmountZ 0)
    {
        
SetLocalVarFloat("MoveSpaceZ_"+asEntity, -afSpace);
    }
    
    
AddTimer(asEntity0.0f"MoveObjectTimer");
}

void MoveEntityOnAxis(string &in asEntityfloat afAmountXfloat afAmountYfloat afAmountZfloat afTime)
{
    if(
GetLocalVarInt("Moving"+asEntity) == 1)
    {
        
AddDebugMessage("Object already moving"false);
        return;
    }

    
SetLocalVarFloat("MoveSpace_"+asEntity0.01);
    if(
afAmountX != 0)
    
SetLocalVarFloat("MoveFreqX_"+asEntity, (afTime/afAmountX)*GetLocalVarFloat("MoveSpace_"+asEntity));
    if(
afAmountY != 0)
    
SetLocalVarFloat("MoveFreqY_"+asEntity, (afTime/afAmountY)*GetLocalVarFloat("MoveSpace_"+asEntity));
    if(
afAmountZ != 0)
    
SetLocalVarFloat("MoveFreqZ_"+asEntity, (afTime/afAmountZ)*GetLocalVarFloat("MoveSpace_"+asEntity));
    
    
AddDebugMessage("X = "+GetLocalVarFloat("MoveFreqX_"+asEntity), false);
    
AddDebugMessage("Y = "+GetLocalVarFloat("MoveFreqY_"+asEntity), false);
    
AddDebugMessage("Z = "+GetLocalVarFloat("MoveFreqZ_"+asEntity), false);
    
    if(
afAmountX != 0)
    {
        
SetLocalVarFloat("MoveAmountX_"+asEntityMathSqrt(MathPow(afAmountX2)));
        
SetLocalVarFloat("MoveSpaceX_"+asEntity0.01);
        if(
afAmountX 0)
        {
            
SetLocalVarFloat("MoveSpaceX_"+asEntity, -0.01);
            
AddDebugMessage("MoveX = "+GetLocalVarFloat("MoveSpace_"+asEntity), false);
        }
    }
    
    if(
afAmountY != 0)
    {
        
SetLocalVarFloat("MoveAmountY_"+asEntityMathSqrt(MathPow(afAmountY2)));
        
SetLocalVarFloat("MoveSpaceY_"+asEntity0.01);
        if(
afAmountY 0)
        {
            
SetLocalVarFloat("MoveSpaceY_"+asEntity, -0.01);
        }
    }
    
    if(
afAmountZ != 0)
    {
        
SetLocalVarFloat("MoveAmountZ_"+asEntityMathSqrt(MathPow(afAmountZ2)));
        
SetLocalVarFloat("MoveSpaceZ_"+asEntity0.01);
        if(
afAmountZ 0)
        {
            
SetLocalVarFloat("MoveSpaceZ_"+asEntity, -0.01);
        }
    }
    
    
AddTimer(asEntity0.0f"MoveObjectTimerX");
    
AddTimer(asEntity0.0f"MoveObjectTimerY");
    
AddTimer(asEntity0.0f"MoveObjectTimerZ");
}

void MoveObjectTimerX(string &in asTimer)
{
    
SetLocalVarInt("Moving"+asTimer1);

    if(
GetLocalVarFloat("MoveAmountX_"+asTimer) != 0)
    {
        
SetEntityPos(asTimerGetEntityPosX(asTimer)+GetLocalVarFloat("MoveSpaceX_"+asTimer), GetEntityPosY(asTimer), GetEntityPosZ(asTimer));
        
AddLocalVarFloat("MoveAmountX_"+asTimer, -GetLocalVarFloat("MoveSpace_"+asTimer));
        if(
GetLocalVarFloat("MoveAmountX_"+asTimer) < 0)
        {
            
SetLocalVarFloat("MoveAmountX_"+asTimer0);
            return;
        }
    }
    
AddTimer(asTimerGetLocalVarFloat("MoveFreqX_"+asTimer), "MoveObjectTimerX");
}

void MoveObjectTimerY(string &in asTimer)
{
    
SetLocalVarInt("Moving"+asTimer1);
    
    if(
GetLocalVarFloat("MoveAmountY_"+asTimer) != 0)
    {
        
SetEntityPos(asTimerGetEntityPosX(asTimer), GetEntityPosY(asTimer)+GetLocalVarFloat("MoveSpaceY_"+asTimer), GetEntityPosZ(asTimer));
        
AddLocalVarFloat("MoveAmountY_"+asTimer, -GetLocalVarFloat("MoveSpace_"+asTimer));
        if(
GetLocalVarFloat("MoveAmountY_"+asTimer) < 0)
        {
            
SetLocalVarFloat("MoveAmountY_"+asTimer0);
            return;
        }
    }
    
AddTimer(asTimerGetLocalVarFloat("MoveFreqY_"+asTimer), "MoveObjectTimerY");
}

void MoveObjectTimerZ(string &in asTimer)
{
    
SetLocalVarInt("Moving"+asTimer1);
    
    if(
GetLocalVarFloat("MoveAmountZ_"+asTimer) != 0)
    {
        
SetEntityPos(asTimerGetEntityPosX(asTimer), GetEntityPosY(asTimer), GetEntityPosZ(asTimer)+GetLocalVarFloat("MoveSpaceZ_"+asTimer));
        
AddLocalVarFloat("MoveAmountZ_"+asTimer, -GetLocalVarFloat("MoveSpace_"+asTimer));
        if(
GetLocalVarFloat("MoveAmountZ_"+asTimer) < 0)
        {
            
SetLocalVarFloat("MoveAmountZ_"+asTimer0);
            return;
        }
    }
    
AddTimer(asTimerGetLocalVarFloat("MoveFreqZ_"+asTimer), "MoveObjectTimerZ");
    
    
MoveObjectCheck(asTimer);
}

void MoveObjectCheck(string &in asEntity)
{
    if(
GetLocalVarFloat("MoveAmountX_"+asEntity) == && GetLocalVarFloat("MoveAmountY_"+asEntity) == && GetLocalVarFloat("MoveAmountZ_"+asEntity) == 0)
    {
        
SetLocalVarInt("Moving"+asEntity0);
        
OnArrival(asEntity);
        return;
    }
}

void OnArrival(string &in asEntity)
{
    


To make an entity move to a specific entity, write:
PHP Code: (Select All)
MoveEntityToEntity(string &in asEntitystring &in asDestEntityfloat afSpacefloat afFreq

asEntity = The entity to move.

asDestEntity = The entity to move towards.

afAmountX = The amount to move on the X-axis
Can be both positive and negative.

afAmountY = The amount to move on the Y-axis
Can be both positive and negative.

afAmountZ = The amount to move on the Z-axis
Can be both positive and negative.

afSpace = The amount of space the object moves with, per frequence.
Must be above 0.
If used with a frequence at 0.01f:
0.01f is kinda slow.
0.02f is quicker.

afFreq = How often the object moves.
Must be above 0.
0.01f looks really smooth.

To make an entity move a specific amount, write:
PHP Code: (Select All)
MoveEntityOnAxis(string &in asEntityfloat afAmountXfloat afAmountYfloat afAmountZfloat afTime); 

asEntity = The entity to move.

afAmountX = The amount to move on the X-axis
Can be both positive and negative.

afAmountY = The amount to move on the Y-axis
Can be both positive and negative.

afAmountZ = The amount to move on the Z-axis
Can be both positive and negative.

afTime = Duration of animation in seconds.

When the entity has moved, the function OnArrival(string &in asEntity) calls.
PHP Code: (Select All)
void OnArrival(string &in asEntity

asEntity = The entity that moved.

Variables used in this script:
float "MoveFreq_"+asObject
float "MoveAmountX_"+asObject
float "MoveAmountY_"+asObject
float "MoveAmountZ_"+asObject
float "MoveSpaceX_"+asObject
float "MoveSpaceY_"+asObject
float "MoveSpaceZ_"+asObject
int "Moving"+asObject


Scary heartbeat screen effects
A heartbeat script, that uses both screen effects and the heartbeat sound.
Spoiler below!

PHP Code: (Select All)
//////////////
//HEART BEAT//

//To start heartbeat effect, add both of these lines
//SetLocalVarInt("Heartbeat", 1);
//AddTimer("HeartBeat_1", 2, "HeartBeat");
//
//To stop hearbeat use the following line
//SetLocalVarInt("Heartbeat", 0);

void HeartBeat(string &in asTimer)
{
    if(
GetLocalVarInt("Heartbeat") == 1)
    {
        if(
asTimer == "HeartBeat_1")
        {
            
PlaySoundAtEntity("heartbeat""sanity_heartbeat.snt""Player"0.0ffalse);
            
AddTimer("Beat"0.05f"HeartBeat");
            
AddTimer("Beat"0.35f"HeartBeat");
            
AddDebugMessage("EXECUTE TIMER"false);
            
AddTimer("HeartBeat_1"2"HeartBeat");
        }
        
        if(
asTimer == "Beat")
        {
            
FadePlayerAspectMulTo(1.25f20);
            
FadeRadialBlurTo(0.05f20);
            
FadePlayerFOVMulTo(0.8f30);
            
AddTimer("Beat_end"0.05f"HeartBeat");
        }
        
        if(
asTimer == "Beat_end")
        {
            
FadePlayerAspectMulTo(1.0f1);
            
FadePlayerFOVMulTo(1.0f0.75f);
            
FadeRadialBlurTo(0.0f1);
        }
    }
}

//HEART BEAT END//
////////////////// 


Trying is the first step to success.
(This post was last modified: 06-14-2015, 04:56 PM by FlawlessHappiness.)
04-22-2015, 12:31 AM
Find
MrBehemoth Offline
Senior Member

Posts: 408
Threads: 19
Joined: Feb 2014
Reputation: 40
#2
RE: Flawless' thread of inspiration

Cool work! I like to see experimental modding. Got me thinking about portals and how they could be used. I have an idea for shooting a portal anywhere, instead of on set points... But I've got too much to do already. Smile

04-22-2015, 10:14 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#3
RE: Flawless' thread of inspiration

(04-22-2015, 10:14 PM)MrBehemoth Wrote: Cool work! I like to see experimental modding. Got me thinking about portals and how they could be used. I have an idea for shooting a portal anywhere, instead of on set points... But I've got too much to do already. Smile

Sounds cool! Something about creating entities I guess...

Trying is the first step to success.
04-22-2015, 10:17 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#4
RE: Flawless' thread of inspiration

New thing out.





I did not make a second level :/

Trying is the first step to success.
(This post was last modified: 04-23-2015, 08:22 PM by FlawlessHappiness.)
04-23-2015, 08:21 PM
Find
Streetboat Offline
Posting Freak

Posts: 1,099
Threads: 40
Joined: Mar 2011
Reputation: 56
#5
RE: Flawless' thread of inspiration

little did alexander know, daniel can always get away from his servants with a sick wall-run into a backflip move.

[Image: signature-2.png]
04-23-2015, 08:52 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#6
RE: Flawless' thread of inspiration

(04-23-2015, 08:52 PM)Streetboat Wrote: little did alexander know, daniel can always get away from his servants with a sick wall-run into a backflip move.

And thus Daniel Lantern-ran his way through the halls of Brennenburg.

Trying is the first step to success.
04-23-2015, 10:59 PM
Find
Slanderous Offline
Posting Freak

Posts: 1,606
Threads: 78
Joined: Dec 2012
Reputation: 63
#7
RE: Flawless' thread of inspiration

Nice dude! That looks awesome.
04-24-2015, 03:04 PM
Find
HumiliatioN Offline
Posting Freak

Posts: 1,179
Threads: 64
Joined: Dec 2010
Reputation: 18
#8
RE: Flawless' thread of inspiration

Wow, really original ideas you got there, keep up the great work! Smile

“Life is a game, play it”
04-24-2015, 04:56 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#9
RE: Flawless' thread of inspiration

New script!

Moving an entity to another entity, or just a specific distance.

Is there anything you'd like to see in this script?

Trying is the first step to success.
05-04-2015, 04:59 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#10
RE: Flawless' thread of inspiration

Doesn't
PHP Code: (Select All)
void PlaceEntityAtEntity(string &in asNamestring &in asTargetEntitystring &in asTargetBodyNamebool abUseRotation); 
do the same? Or does this actually animate the entity moving towards another entity?

05-04-2015, 05:41 PM
Find




Users browsing this thread: 1 Guest(s)