Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - ninekorn

#106
discontinued 2023 july 29th . by ninekorn
#107
discontinued 2023 july 29th . by ninekorn
#108
Another boring night on TWITCH.TV. I finally found pretty much all of the lines of code I need to script a better AI but man, it is soooo confusing to have to control the rotLeft/rotRight/GoForward/GoBackward/strafeLeft/StrafeRight of the NPC... I'm having a hard time focusing here ;)
#109
Currently Streaming but it's gonna be a boring 3 hours of recoding the AI for the combat drones or any follower drones for that matter. Feel free to watch if you're interested. You might have a chance to see the full interior station MOD in action, building turrets from the station Terminal INSIDE of the station or accessing the Ship OnBoard computer to spawn combat/mining/repair drones or even accessing the galaxy Market from within the player ship. It's pretty cool but things need to be polished on the AI for the drones as I am tired of seeing some jerky movements and whatever when I see the drones in Combat crashing into each other and crashing on me.

Feel free to log in Twitch.TV to have a quick look, just feel free to ask me and I will show you INGame the things mentioned above. Otherwise Im gonna be working on the drone AI.

EDIT: Beware - you will be bored to death as I have not been coding the AI for weeks litterally... So I've got to dive back in and re-learn my dusty scripts.

EDIT: Wow... what a wasted night on Twitch because of me... 3 hours wasted trying to dive back in my old scripts to build a better AI for my mods. I know i can do it. I just need to remember and re-understand whatever I coded way back when. Sorry for wasting your time. I might stream tomorrow too.

EDIT: finally found what i was looking for. Those are lines of codes that I DO understand or remember what theyre actually outputting ... I'm gonna work on them tonight with the new drone movement AI that I want to build as I am unsatisfied with the current one.


         
     
    //NPC SHIP ROTATION AND DIRECTION
    var angler = ship.GetRotation(SHIP_ID);
    var radToDegrer = angler * (180.0 / Math.PI);
    var npcPointX00 = (1 * Math.cos(radToDegrer * Math.PI / 180)) + currentNpcCoord.x;
    var npcPointY00 = (1 * Math.sin(radToDegrer * Math.PI / 180)) + currentNpcCoord.y;
    var dirX00 = npcPointX00 - currentNpcCoord.x;
    var dirY00 = npcPointY00 - currentNpcCoord.y;
    var forwardNPC = { x: dirX00, y: dirY00 };
    var rightNPC = { x: dirY00, y: -dirX00 };
    //--------------------------------

    //PLAYER SHIP ROTATION AND DIRECTION
    var currentCoordsPlayer = ship.GetCoordinates(player_id);
    var anglerOfPlayer = ship.GetRotation(player_id);
    var radToDegrerOfPlayer = anglerOfPlayer * (180.0 / Math.PI);
    var pointXOfPlayer = (1 * Math.cos(radToDegrerOfPlayer * Math.PI / 180)) + currentCoordsPlayer.x;
    var pointYOfPlayer = (1 * Math.sin(radToDegrerOfPlayer * Math.PI / 180)) + currentCoordsPlayer.y;
    var dirXOfPlayer = pointXOfPlayer - currentCoordsPlayer.x;
    var dirYOfPlayer = pointYOfPlayer - currentCoordsPlayer.y;
    var forwardOfPlayer = { x: dirXOfPlayer, y: dirYOfPlayer };
    var rightOfPlayer = { x: dirYOfPlayer, y: -dirXOfPlayer };
    //--------------------------------

    if (npc.CountObjectives(nextCommandToDispatch.id) > 0)
    {
        var currentObjective = npc.GetCurrentObjective(nextCommandToDispatch.id);

        if (currentObjective.id == nextCommandToDispatch.id)
        {
            var currentFormationWaypoint = goToFormationWaypoint(nextCommandToDispatch);

            var distToWaypoint = Math.sqrt(((currentFormationWaypoint.x - currentNpcCoord.x) * (currentFormationWaypoint.x - currentNpcCoord.x)) + ((currentFormationWaypoint.y - currentNpcCoord.y) * (currentFormationWaypoint.y - currentNpcCoord.y)));
            var distToPlayer = Math.sqrt(((currentFormationWaypoint.x - currentCoordsPlayer.x) * (currentFormationWaypoint.x - currentCoordsPlayer.x)) + ((currentFormationWaypoint.y - currentCoordsPlayer.y) * (currentFormationWaypoint.y - currentCoordsPlayer.y)));
            var distPlayerToDrone = Math.sqrt(((currentNpcCoord.x - currentCoordsPlayer.x) * (currentNpcCoord.x - currentCoordsPlayer.x)) + ((currentNpcCoord.y - currentCoordsPlayer.y) * (currentNpcCoord.y - currentCoordsPlayer.y)));

            var dirToWaypointX = (currentFormationWaypoint.x - currentNpcCoord.x) / distToWaypoint;
            var dirToWaypointY = (currentFormationWaypoint.y - currentNpcCoord.y) / distToWaypoint;
            var dirToWaypoint = { x: dirToWaypointX, y: dirToWaypointY };

            var dirPlayerToWaypointX = (currentFormationWaypoint.x - currentCoordsPlayer.x) / distToPlayer;
            var dirPlayerToWaypointY = (currentFormationWaypoint.y - currentCoordsPlayer.y) / distToPlayer;
            var dirPlayerToWaypoint = { x: dirPlayerToWaypointX, y: dirPlayerToWaypointY };

            var dirPlayerToDroneX = (currentNpcCoord.x - currentCoordsPlayer.x) / distPlayerToDrone;
            var dirPlayerToDroneY = (currentNpcCoord.y - currentCoordsPlayer.y) / distPlayerToDrone;
            var dirPlayerToDrone = { x: dirPlayerToDroneX, y: dirPlayerToDroneY };

            var alignedDirectionForwardDOT = Dot(forwardNPC.x, forwardNPC.y, dirToWaypointX, dirToWaypointY);
            var alignedDirectionLRDOT = Dot(rightNPC.x, rightNPC.y, dirToWaypointX, dirToWaypointY);

            var pointInFrontOfWaypointX = currentFormationWaypoint.x + forwardOfPlayer.x;
            var pointInFrontOfWaypointY = currentFormationWaypoint.y + forwardOfPlayer.y;

            var pointInFrontOfWaypoint = { x: pointInFrontOfWaypointX, y: pointInFrontOfWaypointY};

            var isFrontOrBack = NSEWDIST(currentCoordsPlayer, currentFormationWaypoint, currentNpcCoord);
            var isLeftOrRight = NSEWDIST(currentFormationWaypoint, pointInFrontOfWaypoint, currentNpcCoord);

         }
   }


I will save and put on Youtube the streams that are not junk... yesterday was junk so no youtube lol.
#110
Mods / Re: Drone/Follower mod // in-progress
May 04, 2019, 12:55:23 AM
discontinued 2023 july 29th . by ninekorn
#111
Hi,

Here is the image of the current bug I am facing. Is it due to too many colliders on the same object?

#112
discontinued 2023 july 29th . by ninekorn
#113
discontinued 2023 july 29th . by ninekorn
#114
Help section / Re: static NPC?
May 02, 2019, 03:41:38 PM
discontinued 2023 july 29th . by ninekorn
#115
Help section / Re: player spawning question?
May 01, 2019, 08:24:16 PM
discontinued 2023 july 29th . by ninekorn
#116
discontinued 2023 july 29th . by ninekorn
#117
Mods / Re: Drone/Follower mod // in-progress
May 01, 2019, 12:08:16 AM
discontinued 2023 july 29th . by ninekorn
#118
discontinued 2023 july 29th . by ninekorn
#119
ok ill find the posts that i need moving and ask for them to be moved after if thats okay.
nine
#120
discontinued 2023 july 29th . by ninekorn