Help with generating NPCs (animals for farm sim) at coordinates using common events

Hello everyone. I'm trying to make a system for buying / generating livestock in my RPG maker VX Ace sci-fi farming sim. I've run into a few problems though on how to go about this. My current attempt to tackle this is to use a common event which makes new events (which would then hold the livestocks' data). However, I am struggling on how I am supposed to place a generated event. Here are photos and a walkthrough of what I'm currently doing...

1.png


3.png

The stuff in yellow is code for my graphics display (custom dialogue box and npc models, ect. Please ignore it). The green stuff is the livestock generation part. My alien creature is here called a "Yim."
4.png

I copied the event generation code from https://steamcommunity.com/app/220700/discussions/0/620703493332877219/, but unless I'm misreading, it does not seem it was ever determined by the original poster how it could be used to generate an in-game object. The displayed texts "1," "2," and "3" are for my own reference to see where the code messes up. I cannot get passed "1." When trying to set the ID, the following occurs:
2.png

What I am trying to do is get a creature to generate at a specific coordinate, as determined by a script (because I'll later want it to sometimes generate in a barn or elsewhere, ect...). I am mainly struggling with figuring out how to give the livestock / event generated by the common event a npc graphic and the ability to pop up at a certain coordinate. I've tried looking around, but to little luck. Other than the linked thread from steam, I have been trying to follow "https://forums.rpgmakerweb.com/inde...ns-npc-next-to-him-anywhere-on-the-map.66766/" but I'm not sure how I'm supposed to get the "Set Event" function to work using a common event; I know I need scripted code, but as a non-programmer, I'm not sure what that would look like.

How would I go about doing this?
your problem is on another front.
most likely your original source placed the script in the script editor, not in a script box.

because the event command "script" is sandboxed - all variables defined inside a script box are deleted when the box is closed.

what you need instead is a script for clone events. There were several such scripts freely available fifteen years ago, but some of the websites are down by now.
please search for a clone event script, and follow its instructions - manually creating an event by script commands is problematic even if you don't hit the sandbox wall, cloning existing events is much easier.

Original thread: https://forums.rpgmakerweb.com/threads/help-with-generating-npcs-animals-for-farm-sim-at-coordinates-using-common-events.148577/