Advertisement

FF7 Messages

Started by May 23, 2000 08:40 PM
39 comments, last by DarkMage139 24 years, 6 months ago
Since this topic seems to be dealing with scripting and control of NPC''s etc, I thought I''d voice the thoughts/ideas I intend to implement in my engine. (When I finally get to that point)

First some general info:
In my game the world map is made up of two general categories. Tiles and Entities. Tiles consist of mainly the basemap. Tiles can be animated, and they are multi-level to provide for 2nd, third floor''s etc. Entities consist of everything else in the game. Enemies, NPC''s, "That light pillar", and trigger fields are all entities. The major thing that sets Entites apart is that they can have a script attached to them.

Now the scripting points:
A script can basically be thought of as a function. This function has a few parameters passed to it by the game. First, a reference to the entity itself, second, the reason for the call, or the message, and lastly 2 optional parms. (Sounds alot like windows messaging, but hey, it works) By responding to the various messages the entity can react to various situations.

To make the entity do stuff, just respond to the messages. Every entity within process range of the player recieves a "Think" message every game clock cycle. By using the misc var''s attached to the entity object you can track things such as activity etc. to yawn use a rnd(1) command, if true SetFrame ("FarmerYawn"); If you want to initiate a conversation, respond to the message "PlayerUse", and initiate a conversation.

To process scripts I plan to use a bytecode method. Scripts are compiled down to asm commands my program understands. There is a stack, 4 object registers (1 initialy points to this ent), and 4 integer registers. There is no memory access, so scripts are limited to using registers and the stack, but that should be sufficient.

This is all theory that I have put down on pen and paper, but in my head it seems plausable. I also think that this system provides for alot of flexibility. I''m not going to list commands and events, but you can imagine what they would be.

I hope my ranting has provided some inspiration to others. Feel free to comment as i am always looking to improve upon my ideas.

-Zims

This topic is closed to new replies.

Advertisement