Page 1 of 1

At Last! The Good Part! Coding!

PostPosted: Fri Oct 20, 2006 1:22 am
by Pete Holland Jr.
Hey, everybody!

I appreciate the info everyone gave me about jumping. But my mind is also running. It's apparent that, if I want to do anything more complicated than a simple virtual pet, I need to get into the scripting.

Welcome to the stick shift of Game Editor.

I know C++, so I'm most of the way there already, but Game Editor uses C, so I need to slow down a little. Some of this is syntactical, as I kind of skimmed the C-specific portion of the studies (I admit it).

To help me get the basics, I'm going to ask a few more questions.

1) Global code. I'm figuring this to be the equivalent of scope resolution. Anything here, variables and the like, can be accessed by any actor control in the game. Likewise, any scripting done in the actor control cannot be accessed by the global code, right? If I add two numbers and assign them to a variable under the actor control only, the global code can't read it, right? Only scripting commands under that actor can?

2) I see there are variables for x, y, xvelocity, yvelocity, etc. Do I need to declare any othe variables I use like in C++ (int bunch = 20;), or can I simply assign variables like in BASIC (bunch = 20)?

3) Is there a way to disable certain things while an action is taken? Consider the following example--I take my little croc and create a path for a fixed-distance long jump (key down event, change path, etc.) I set it so that there is a specific animation for the long jump. But, each time I press the jump button, the path restarts from where I hit the button. And, if I press left or right, the animation will change to walking instead of the long jump animation, even if the path is not finished. Is there a way to set the actor controls so that no other input can be read or action taken until whatever action I want (follow a path or the completion of a specific script) is finished?

Dobre utka,
Pete Holland Jr.

PostPosted: Fri Oct 20, 2006 5:17 am
by DilloDude
1) Global code is the section of code that you would normally put at the beginning, where you define variables and functions. Also in any script editor window there is a variables button. With this you can create variables. While you don't have as many variables you can add here, you can make them Actor Variables (members of the Actor struct) and put them in save groups, allowing you to use the save/load vars functions. You cannot do these two things with variables defined in Global Code, but you can write your own variable saving script.

2) You do need to specify the variable type: int count, double ang, char *str etc.

3) To disable things either use the EventDisable/Enable events, (see the script reference) which only disable all of a specific event on a certain actor, or you can use a variable, eg. jumping, and test it when you want to do something else.

Hope that helps. If you have more questions, just post them here (after all, isn't that what the point of having a forum is, anyway).

PostPosted: Fri Oct 20, 2006 1:04 pm
by Pete Holland Jr.
Hey, DilloDude!

DilloDude wrote:Hope that helps. If you have more questions, just post them here (after all, isn't that what the point of having a forum is, anyway).


Actually, it's a huge help. One of the things I want to do is make my actor "act" a little. Kind of like a silent movie, I want his behaviors and actions to help advance things along. I compare it a couple of games that I have. I'm not sure if you've ever played "Diner Dash." I had never played DD, and was wondering if it was any good. I found and bought clone called "Coffee House Chaos". It was a quarter of the price for a full version of DD and was permanent, not a one hour trial. Had I not actually tried DD, I wouldn't have even considered the game. CHC is almost the exact same thing, but the layout is a little different, it's not as cleanly leveled as DD, and the "star" of the game doesn't have Flo's personality. From Flo's expressions to little actions like rocking on her feet while waiting, the game has a better sense of rhythm and is more intuitive and the characters come alive enough that it draws you in. I don't know if I explained my point in that, but I'm hoping I did.

I'm still feeling my way around. I'm just trying not to go overboard with the questions. Everyone here has been friendly, but I worry that, sooner or later, someone is going to go, "It's in the docs! Read the docs!"

The comments about scripting were wonderful, by the way. I'm on familiar turf with that.

Dobre utka,
Pete Holland Jr.