python – Character Picture Grid

Sorry, I’m new and not confident. This is right, yes? It seems to work but, again, other people’s answers seem more complicated:

grid = (
    ('.', '.', '.', '.', '.', '.'),
    ('.', 'O', 'O', '.', '.', '.'),
    ('O', 'O', 'O', 'O', '.', '.'),
    ('O', 'O', 'O', 'O', 'O', '.'),
    ('.', 'O', 'O', 'O', 'O', 'O'),
    ('O', 'O', 'O', 'O', 'O', '.'),
    ('O', 'O', 'O', 'O', '.', '.'),
    ('.', 'O', 'O', '.', '.', '.'),
    ('.', '.', '.', '.', '.', '.')
)

row = 0
for entry in grid:
    for subentry in grid(row):
        print(subentry, end = "")
    print("n")
    row = row + 1

ai – Method to make character roam map isn’t working

I’m an absolute beginner in Unreal Engine, so sorry for any strange mistakes, formatting, etc. I’m trying to make a game for a project where an enemy chases the player through a maze when it spots the player, but when there’s no player it roams around the maze. I have the following blueprint:

roamMethodSnip

Every time I run it, it has varying outcomes. Sometimes the enemy will move around a few times, then randomly stop. It won’t return a fail message or move. Other times, it will send a single fail message as soon as the program is run, then not return anything else. And other times, it won’t send anything at all or move and just stand there. It’ll also sometimes simply turn ~95 degrees to the left then stop.

There’s also the issue that the enemy takes the same path every trial, even though it’s supposed to choose a random point and move to it.

The enemy easily chases the player through the maze and won’t get stuck anywhere, but for some reason the enemy stops moving when it’s executing the roam method.

I tried adjusting the radius in the GetRandomPointInNavigableRadius part, but that didn’t affect anything. I also tried making the character smaller in case it was getting stuck on certain turns, but that also didn’t affect it. Removing the delay made it work a few times, but then it went back to not working after a few trials.

Here’s the rest of the code for reference:

fullProgramSnip

and a picture of the maze:

mazeSnip

and the enemy’s width relative to the maze path:

charWidthSnip

Thank you for any help!

dnd 5e – Best background for 5e character who is secretly a dragon?

The Charlatan background comes to mind as likely your character would have had to create an identity from scratch to blend in with society.

** Trait – False Identity

You have created a second identity that includes documentation, established acquaintances, and disguises that allow you to assume that persona. Additionally, you can forge documents including official papers and personal letters in a specific person’s handwriting, as long as you have seen an example of the kind of document you are trying to copy. **

illegal character  quando tento compilar um codigo java

Hoje tentei compilar um codigo de ‘ola mundo’ em java, que foi escrito no Bloco de notas do windows, porém me deparei com esse erro

´╗┐public class Programa{
public static void main(Strings() args){
System.out.println(“ola mundo”);
}
}

illegal character: 191


descobri que o problema era o bloco de notas , copiei para o notepad online: https://www.rapidtables.com/tools/notepad.html

e deu tudo certo!

sql server – conversion failed when converting datetime from character string while inserting and updating to database

I’m trying to insert time and date separately and calculate if it is late to the set time and then insert it to database…

here’s my try code for update

string Date = DateTime.Now.ToString(“dd-MM-yyyy”);
string Time = DateTime.Now.ToString(“h:mm:ss tt”);
SqlCommand comm2 = conn.CreateCommand();
comm2.CommandText = “Update Time_Logs SET Time_Out = ‘” + Time + “‘ where Emp_Id = ‘” + EmpId.Text + “‘ and Date = ‘” + Date + “‘”;
try
{
conn.Open();
comm2.ExecuteNonQuery();
MessageBox.Show(“Time_Out…”);
conn.Close();
TimeCompute();
}
catch (Exception x)
{
MessageBox.Show(x.Message);
conn.Close();
}

and here is the code for inserting

string Date = DateTime.Now.ToString(“dd-MM-yyyy”);
string Time = DateTime.Now.ToString(“h:mm:ss tt”);

        SqlCommand comm = conn.CreateCommand();
        comm.CommandText = "INSERT INTO Time_Logs (Emp_Id, Date, Time_In) VALUES('" + EmpId.Text + "','" + Date + "','" + Time + "')";
        try
        {
            conn.Open();
            comm.ExecuteNonQuery();
            MessageBox.Show("Time_In...");
            conn.Close();
            DateTime time = DateTime.Parse(Time);
            DateTime inDate = DateTime.Parse("8:00:00 AM");
            TimeSpan ts1 = inDate.TimeOfDay;
            TimeSpan ts = time - inDate;
            if (ts < ts1)
            {
                SqlCommand comm2 = conn.CreateCommand();
                comm2.CommandText = "Update Time_Logs SET Late = '" + ts + "' where Emp_Id = '" + EmpId.Text + "' and Date = '" + Date + "'";
                conn.Open();
                comm2.ExecuteNonQuery();
                conn.Close();
            }
            else
            {
                SqlCommand comm2 = conn.CreateCommand();
                comm2.CommandText = "Update Time_Logs SET Late = '" + ts + "' where Emp_Id = '" + EmpId.Text + "' and Date = '00:00:00'";
                conn.Open();
                comm2.ExecuteNonQuery();
                conn.Close();
            }
        }
        catch (Exception x)
        {
            MessageBox.Show(x.Message);
            conn.Close();
        }

character set – Change phpMyAdmin charset

I need to change the server charset on PhpMyAdmin – not the database charset. I’ve not seen much on how to do it. I’m on Windows and I use WAMP. Currently, it is set to cp1252 West European (latin1) and I want it to be on UTF-8 Unicode. I’ve seen and tried this but it changed nothing for me.
Thanks for your help

dnd 5e – Does healing an unconscious, dying player character restore only up to 1 hp unless they have been stabilised?

No such rule exists.

There is simply no rule that says healing only counts as 1 hit point. The rules do say this:

The best way to save a creature with 0 hit points is to heal it.

A creature receives full healing from any healing spell while unconscious and at 0 hit points, and they immediately become conscious again:

This unconsciousness ends if you regain any hit points.

These quotes are from the rules for Dropping to 0 Hit Points.

Further, the rules for healing state:

When a creature receives healing of any kind, hit points regained are added to its current hit points.

If your current hit points are 0, and you receive 13 points from a cure wounds, the rules say you have 13 hit points.

A Grave Cleric feature explicitly confirms that you roll dice for healing a creature at 0 hit points.

The Grave Cleric’s Circle of Mortality feature states:

When you would normally roll one or more dice to restore hit points with a spell to a creature at 0 hit points, you instead use the highest number possible for each die.

If it were the case that healing an unconscious creature always only restored one hit point, this feature would be entirely useless: it would never trigger because you would never be rolling one or more dice to restore hit points.

path finding – Java Game: A* Algorithm (searching only cells in front of character)

Game Type: grid tile map that is turned based

Directions allowed: Left, Forward, Right
(to reverse directions you must either use two lefts or two rights) – both left and right moves diagonal but change the face of the ship depending on original face)

Slots: Depending on ship size there are a certain number of slots for that particular ship for user to enter to allow the ship to move that many spots per turn (ie. 3 slots == 3 moves per turn)

Example:

Start Position: 2,2

Start face: North

Move Placed: Left

End Result: Position: 1,3 ; Face: West


Problem: algorithm uses all 8 tiles for path finding; but should only look for the tiles that are in front (depends on ship face)

Pathfinding calculation:

    private Comparator<Node> nodeSorter = new Comparator<Node>() {

        @Override
        public int compare(Node n0, Node n1) {
            if(n1.fCost < n0.fCost) return 1;
            if(n1.fCost > n0.fCost) return -1;
            return 0;
        }
        
    };

    public List<Node> findPath(Position start, Position goal){
        List<Node> openList = new ArrayList<Node>();
        List<Node> closedList = new ArrayList<Node>();
        Node current = new Node(start, null, 0, start.distance(goal));
        openList.add(current);
        while(openList.size() > 0) {
            Collections.sort(openList, nodeSorter);
            current = openList.get(0);
            if(current.position.equals(goal)) {
                List<Node> path = new ArrayList<Node>();
                while(current.parent != null) {
                    path.add(current);
                    current = current.parent;
                }
                openList.clear();
                closedList.clear();
                return path;
            }
            openList.remove(current);
            closedList.add(current);
            for(int i = 0; i < 9; i++) {
                if (i == 4)continue;
                int x = current.position.getX();
                int y = current.position.getY();
                int xi = (i % 3) - 1;
                int yi = (i / 3) - 1;
                int at = context.getMap().getTile(x + xi, y + yi);
                if(at == 1 || at == 2) continue; // ignore rocks
                Position a = new Position(x + xi, y + yi);
                double gCost = current.gCost + current.position.distance(a);
                double hCost = a.distance(goal);
                Node node = new Node(a, current, gCost, hCost);
                if(positionInList(closedList, a) && gCost >= node.gCost) continue;
                if(!positionInList(openList, a) || gCost < node.gCost) openList.add(node);
            }
        }
        closedList.clear();
        return null;
    }
    
    private boolean positionInList(List<Node> list, Position position) {
        for(Node n : list) {
            if(n.position.equals(position)) return true;
        }
        return false;
    }

Implementation:

@Override
    public void calculateRoute() {
        Position destination = new Position(3,3); // replace with cluster
        if(this.equals(destination)) {
            return;
        }based 
        path = context.getPlayerManager().findPath(this, destination);
        VesselFace face = getFace();
        if(path != null) {
            if(path.size() > 0) {
                int numberOfMoves = getVessel().has3Moves() ? 3 : 4;
                Position currentPosition = this.copy();
                for(int slot = 0; slot <= numberOfMoves; slot++) { //moves to enter
                    int positionIndex = (path.size() - 1) - (slot); //subtract slot to allow multiple moves
                    if(positionIndex < 0 || path.size() < slot) { // make sure it doesn't count too far
                        return;
                    }
                    Position pos = path.get(positionIndex).position;
                    Position left = MoveType.LEFT.getFinalPosition(currentPosition, face);
                    Position right = MoveType.RIGHT.getFinalPosition(currentPosition, face);
                    Position forward = MoveType.FORWARD.getFinalPosition(currentPosition, face);
                    if(left.equals(pos)) {
                        currentPosition.add(left.getX() - getX(), left.getY() - getY());
                        getMoves().setMove(slot, MoveType.LEFT);
                        switch(face) {
                            case NORTH:
                                face = VesselFace.WEST;
                                break;
                            case SOUTH:
                                face = VesselFace.EAST;
                                break;
                            case WEST:
                                face = VesselFace.SOUTH;
                                break;
                            case EAST:
                                face = VesselFace.NORTH;
                                break;
                        }
                    }else if(right.equals(pos)) {
                        currentPosition.add(right.getX() - getX(), right.getY() - getY());
                        getMoves().setMove(slot, MoveType.RIGHT);
                        switch(face) {
                            case NORTH:
                                face = VesselFace.EAST;
                                break;
                            case SOUTH:
                                face = VesselFace.WEST;
                                break;
                            case WEST:
                                face = VesselFace.NORTH;
                                break;
                            case EAST:
                                face = VesselFace.SOUTH;
                                break;
                        }
                    }else if(forward.equals(pos)){
                        currentPosition.add(forward.getX() - getX(), forward.getY() - getY());
                        getMoves().setMove(slot, MoveType.FORWARD);
                        switch(face) {
                            case NORTH:
                                face = VesselFace.NORTH;
                                break;
                            case SOUTH:
                                face = VesselFace.SOUTH;
                                break;
                            case WEST:
                                face = VesselFace.WEST;
                                break;
                            case EAST:
                                face = VesselFace.EAST;
                                break;
                        }
                    }
                }
            }
        }
    }

I use the switch statement and currentPosition.add() method so that when you place 3 moves for that particular turn; it knows where it should end up. Probably not best practice.

Statement that adds a move to the particular slot

getMoves().setMove(slot, MoveType.FORWARD);

Tiles that should be checked every turn based on ship face:

enter image description here

Unity3d- Are there any ways to make Hair physics so realistic that your character can hang upside-down and have their hair fall accordingly?

Everything I’ve been finding so far has decent physics upright, but turns stiff and unnatural when dealing with hanging-upsidedown animations.

What would be the recommended approach for achieving 360degree realistic hair physics movement?

dnd 5e – Can you create a catlike humanoid player character?

I’m returning to D&D after a VERY long time, and will predominantly be playing solo.

Can you create a character that is an animal? I’m thinking of a cat who is a wizard, possibly because of a spell that went wrong. I’ve started reading the D&D basic rules from 2018 , and can only see four races? The character is/was human, but is stuck in a feline form after a spell that was above their level backfired.

Okay… I played D&D back in the 80s, and got interested again after an artist I dig shared his love of the game. Given the U.K. is going back into lockdown, I wondered if you could do solo adventures. Cats are my favourite animals, and a lot of my own characters (I’m a professional artist) are cat like creatures. A cat like wizard just really appealed to me! So, basically, a cat like human, around 5 feet tall, not a domestic cat. I like the idea of him being grumpy and a bit distracted, like cats can be. He would have good agility and balance, as cats do. Basically thinking it’d be FUN. Another add on is that he could be on a quest to return to human form…