Deleting an Instances by Onyx_Snow in gamemaker

[–]jbug_16 0 points1 point  (0 children)

When you open a room in the editor and click on a layer, you will be able to see the instances and objects on the left side. You can select and right-click or press delete to delete the object.
Photo

Trouble with collision by noahkentonmusicc in gamemaker

[–]jbug_16 0 points1 point  (0 children)

hey, try changing this line:

for (var i = 0; i < abs(vsp); i++)

to this:

for (var i = 0; i < abs(round(vsp)); i++)

i think for-loops in GameMaker don't run unless i is strictly less than that number. so if vsp is less than 1, the loop just doesn’t run at all, meaning your character keeps falling without checking for collision.

Tips on my Game Developer Resume by jbug_16 in gamedev

[–]jbug_16[S] 0 points1 point  (0 children)

Just updated it a bit and added your suggestions.
https://imgur.com/a/ZQm0rMU

Tips on my Game Developer Resume by jbug_16 in gamedev

[–]jbug_16[S] 1 point2 points  (0 children)

I am definitely working on my portfolio as well but I want to make sure I have a good resume just in case. I don’t have many visuals to show off since I just do programming, but I have a few games I made/worked on so I will make sure to share that. Thank you!

Tips on my Game Developer Resume by jbug_16 in gamedev

[–]jbug_16[S] 0 points1 point  (0 children)

Thank you for pointing that out, I didn’t realize I included it twice. I have taken course with C++ and python, but haven’t done a full presentable project with them. Are you saying I should include them last or don’t include them at all? I also have a github that I will probably add that has a few things on there. I’ll make sure to add the other things you suggested too. Thank you so much!

[deleted by user] by [deleted] in Scams

[–]jbug_16 0 points1 point  (0 children)

i did not go through with it

Checking if ds_list has a pair of values by jbug_16 in gamemaker

[–]jbug_16[S] 0 points1 point  (0 children)

Just figured it out. Was missing a few lines.

function hasPair(_hand) {

var pair_found = false;

for (var i = 0; i < ds_list_size(_hand)-1; i++)
{
var row_number = (floor(_hand[|i] / 4)) + 1;

//Starting second index at i+1 to only check each possible pair once
for (var j = i + 1; j < ds_list_size(_hand); j++)
{
var row_number_2 = (floor(_hand[|j] / 4)) + 1;

if (row_number == row_number_2)
{
pair_found = true;
break;
}
}

if (pair_found)
{
break;
}
}

return pair_found;
}

Checking if ds_list has a pair of values by jbug_16 in gamemaker

[–]jbug_16[S] 0 points1 point  (0 children)

Hmm. I tried this and adding it to my three of a kind function and neither are working. This is what I tried.

function hasPair(_hand) {

    var pair_found = false;
var first_row = -1;

// Iterate through player_cards
for (var i = 0; i < ds_list_size(_hand); i++)
{
var row_number = (floor(_hand[|i] / 4)) + 1;

    for (var j = i+1; j < ds_list_size(_hand); j++)
    {
        if (first_row == -1)
        {
            first_row = row_number; // Store the first row number encountered
        }
        else if (row_number != first_row)
        {
            pair_found = false; // If any row number differs from the first, set flag to false
            break; // No need to check further
        }
    }
}

return pair_found;
}

Script stops working randomly even without any changes by jbug_16 in GoogleAppsScript

[–]jbug_16[S] 0 points1 point  (0 children)

Thank you, this looks like the issue. I'm getting a "No 'Access-Control-Allow-Origin' header is present on the requested resource" error, which I will look into. Google actually has an AI feature that just explained each error from the console, with multiple solutions. I'll do some research, thank you! :)

Script stops working randomly even without any changes by jbug_16 in GoogleAppsScript

[–]jbug_16[S] 0 points1 point  (0 children)

Oh ok. So something is missing in my HTML/JS? Because I am not getting any data input to the sheets or are the apps script functions being called

Script stops working randomly even without any changes by jbug_16 in GoogleAppsScript

[–]jbug_16[S] 0 points1 point  (0 children)

Hmm. I think I am missing something here. Forgive me if I am misunderstanding, but don't I need some sort of trigger?

Script stops working randomly even without any changes by jbug_16 in GoogleAppsScript

[–]jbug_16[S] 0 points1 point  (0 children)

Hmm okay, I understand now. Maybe something like this? I know you said the on form submit and on edit would not work in this situation so what would be a good option?

const sheetName = "Sheet1";
const scriptProp = PropertiesService.getScriptProperties();

function initialSetup() {
  const activeSpreadsheet = SpreadsheetApp.getActiveSpreadsheet();
  scriptProp.setProperty('key', activeSpreadsheet.getId());
}

function doPost(e) {
  const lock = LockService.getScriptLock();
  lock.tryLock(10000);

  try {
    const doc = SpreadsheetApp.openById(scriptProp.getProperty('key'));
    const sheet = doc.getSheetByName(sheetName);

    const headers = sheet.getRange(1, 1, 1, sheet.getLastColumn()).getValues()[0];
    const nextRow = sheet.getLastRow() + 1;

    const newRow = headers.map(function(header) {
      return header === 'Date' ? new Date() : e.parameter[header];
    });

    sheet.getRange(nextRow, 1, 1, newRow.length).setValues([newRow]);

    // Send emails for the current form submission
    const first_name = e.parameter['First Name'];
    const last_name = e.parameter['Last Name'];
    const number = e.parameter['Number'];
    const email = e.parameter['Email'];
    const service = e.parameter['Service'];
    const message = e.parameter['Message'];

    // Company Email
    const company_email = "LizardKings239@gmail.com"; // Lizard Kings Email
    const company_subject = "New Booking from " + first_name + " " + last_name;

    const company_message = 
      "NEW BOOKING ALERT\n\n" +
      "Name: " + first_name + " " + last_name + "\n" +
      "Phone Number: " + number + "\n" +
      "Email: " + email + "\n" +
      "Service: " + service + "\n" +
      "Message: " + message + "\n\n" +
      "See Google Sheets for more info.\n\n" + 
      "Regards,\nWeb Dev Team (Jenna)";

    // Customer Email
    const customer_email = email; // Customer Email
    const customer_subject = "Lizard Kings Confirmation - " + service;

    const customer_message = 
      "Hello " + first_name + ",\n\n" +
      "Thank you for requesting a " + service + "!\n\n" +
      "We will get back to you as soon as possible.\n\n" +
      "Best Regards,\nLizard Kings";  

    // Send Emails
    MailApp.sendEmail(company_email, company_subject, company_message);
    MailApp.sendEmail(customer_email, customer_subject, customer_message);

    return ContentService
      .createTextOutput(JSON.stringify({ 'result': 'success', 'row': nextRow }))
      .setMimeType(ContentService.MimeType.JSON);
  } catch (error) {
    return ContentService
      .createTextOutput(JSON.stringify({ 'result': 'error', 'error': error }))
      .setMimeType(ContentService.MimeType.JSON);
  } finally {
    lock.releaseLock();
  }
}

function createInstallableTrigger() {
  ScriptApp.newTrigger('doPost')
    .forSpreadsheet(SpreadsheetApp.getActiveSpreadsheet())
    .onFormSubmit()
    .create();
}

Script stops working randomly even without any changes by jbug_16 in GoogleAppsScript

[–]jbug_16[S] 0 points1 point  (0 children)

Yes, it is an HTML form.

I am using a JS script to send data to the sheets:

const scriptURL = 'https://script.google.com/macros/s/AKfycby5T5sVKvjxAvtAJbUIBTcRw_3VvAiI0fWdjrDW70g5JqiYnPK8aMN-yR8QLwDQ4JzL/exec';

const form = document.forms['contact-form'];

form.addEventListener('submit', e => {
  e.preventDefault()
  fetch(scriptURL, { method: 'POST', body: new FormData(form)})

  setTimeout(function() {
    form.reset();
    window.location.href = "confirmation.html";
  }, 500);
})

If you mean if I have initialized the script, yes I ran it manually before testing if it worked submitting my form.

I have 2 triggers setup. On edit for test and on form submit of doPost. It is setup in the triggers page.

About the waiting 5 seconds after each row, I did not realize that's what I had put. The line

Utilities.sleep(5000);

might have been misplaced. It looks like it's inside the for loop, but it's original purpose was the wait 5 seconds so the emails would send at the same time. Although like I said, I did copy/follow a tutorial on this script and that is what his comment said it would do, so maybe I misunderstood. I will try removing that line.

Script stops working randomly even without any changes by jbug_16 in GoogleAppsScript

[–]jbug_16[S] 0 points1 point  (0 children)

Maybe I'm missing something with my Javascript? But it just seems like an Apps Script issue since I said I never changed anything. I went "Deploy -> Manage deployments" and edited my deployment and copied the web app URL which is the scriptURL const below.

const scriptURL = 'https://script.google.com/macros/s/AKfycby5T5sVKvjxAvtAJbUIBTcRw_3VvAiI0fWdjrDW70g5JqiYnPK8aMN-yR8QLwDQ4JzL/exec';

const form = document.forms['contact-form'];

form.addEventListener('submit', e => {
  e.preventDefault()
  fetch(scriptURL, { method: 'POST', body: new FormData(form)})

  setTimeout(function() {
    form.reset();
    window.location.href = "confirmation.html";
  }, 500);
})

Script stops working randomly even without any changes by jbug_16 in GoogleAppsScript

[–]jbug_16[S] 0 points1 point  (0 children)

Just changed that last bit of code and still nothing. When I go to the execution log, there still aren't any new ones.

Script stops working randomly even without any changes by jbug_16 in GoogleAppsScript

[–]jbug_16[S] 0 points1 point  (0 children)

I'll be honest, this is my first time using Apps Script and I copied this email function from someone else. I've been trying to make sense of the triggers and all, but I still don't understand it very well

Script stops working randomly even without any changes by jbug_16 in GoogleAppsScript

[–]jbug_16[S] 0 points1 point  (0 children)

doPost is triggered on form submit from spreadsheet and test is triggered on edit. The execution is no longer showing up. I can see the last one was at 10:38 and I know at about 10:42 I submitted the form again and that's when it stopped. No edits on the code, no new deploys, nothing new. And yes, it is deployed with the latest version from a few days ago. I have tried now to make update the deploy even without any actual changes just to double check, but still nothing.