Giter Club home page Giter Club logo

Comments (4)

dbaldan avatar dbaldan commented on July 1, 2024

Added a suggestion about an extra option in camera type.

from openbor.

magggas avatar magggas commented on July 1, 2024

Actually you can do all this with script already anyway. Back in the day when i started my DD game i also asked about this feature and also other people too but i think they never added because it already can be done what you are asking.

Anyway, Bloodbane back then showed me this little trick he used on his contra game, which is to add a small anim script on idle that includes this: changelevelproperty("camerazoffset", -100 - y) or changelevelproperty("camerazoffset", -100 - base).

Here are the small functions i made for my game with it:

void camera()
{ // Spawn and bind other entity
void self = getlocalvar("self");
void P1 = getplayerproperty(0, "entity");
void P2 = getplayerproperty(1, "entity");
void vAniID1 = getentityproperty(P1,"animationID");
void vAniID2 = getentityproperty(P2,"animationID");
int Offset1 = getentityproperty(P1,"base");
int Offset2 = getentityproperty(P2,"base");
int Offset3 = getentityproperty(P1,"a");

if(P2){
changelevelproperty("camerazoffset", -100 - Offset2);
}

if(P1){
changelevelproperty("camerazoffset", -100 - Offset1);
}

if(P1 != NULL() && getentityproperty(P1,"exists") && P2 != NULL() && getentityproperty(P2,"exists") && vAniID1 == openborconstant("ANI_IDLE") || vAniID1 == openborconstant("ANI_JUMPLAND")){
changelevelproperty("camerazoffset", -100 - Offset1);
}else if(P1 != NULL() && getentityproperty(P1,"exists") && P2 != NULL() && getentityproperty(P2,"exists") && vAniID1 == openborconstant("ANI_FOLLOW22") || vAniID1 == openborconstant("ANI_FOLLOW23")){
changelevelproperty("camerazoffset", -100 - Offset3);
}
}

void camera2()
{ // Spawn and bind other entity
void P1 = getplayerproperty(0, "entity");
void P2 = getplayerproperty(1, "entity");
int Offset1 = getentityproperty(P1,"a");
int Offset2 = getentityproperty(P2,"a");

if(P2){
changelevelproperty("camerazoffset", -100 - Offset2);
}else if(P2 && P1 != NULL() && getentityproperty(P1,"exists")){
changelevelproperty("scrollspeed", 1);
}

if(P1){
changelevelproperty("camerazoffset", -100 - Offset1);
}else if(P1 && P2 != NULL() && getentityproperty(P2,"exists")){
changelevelproperty("camerazoffset", -100 - Offset1);
}
}

The "camera" function (first one) is checking the player's base, so it only moves on Z and not on Y when player jumps. And i only had to add it to idle and jumpland animation for my use. The second function "camera2 is checking player's Y and i was using it on my clibing animations so the camera follows up/down.
Now my scripts are a bit poorly made but ok for my purpose but the idea is with the changelevelproperty("camerazoffset", -100 - Y); or changelevelproperty("camerazoffset", -100 - base); you can do nice little functions or parts of a mainscript which will take care of the camera problem.
Also if you only need this for only just one spot in only one stage you can just place a blank entity on that spot with the script on it so that you will not need to having it on players all time.

from openbor.

dbaldan avatar dbaldan commented on July 1, 2024

@magggas thank you.

from openbor.

DCurrent avatar DCurrent commented on July 1, 2024

Closing since specific issue is resolved. Development code is opening all level properties, including camera switches.

from openbor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.