Re: New features by lunarrush

Ok, so where should I move the enable stuff that I put in player_action.c?  To player_movement.c?  Will that require a new object creator because the two that are in that file are different than the ones in player_action.c?  Which .h did I miss?  I want to learn to do this properly, and I think that working through this will help us both in the long run.
Also, where should I move the stuff that was in player.c, I don't specifically see an enable.c module, does it need to be created to follow that convention?  Also, I was unable to properly compile when that was named enable_player_roll rather than enable_player_roll_p, is this because it shared the name with the final decorator?

If I knew then what I know now I'd tell you that the story's true.  Cause whatever you do, it comes back to you.  -Slaughter, Burning Bridges

Re: New features by lunarrush

S32X wrote:

Hey Alex. How did you shake the camera in cutscene 1 of Open Surge?

please take a look at the scripts. smile

lunarrush wrote:

Ok, so where should I move the enable stuff that I put in player_action.c?  To player_movement.c?  Will that require a new object creator because the two that are in that file are different than the ones in player_action.c?  Which .h did I miss?  I want to learn to do this properly, and I think that working through this will help us both in the long run.
Also, where should I move the stuff that was in player.c, I don't specifically see an enable.c module, does it need to be created to follow that convention?  Also, I was unable to properly compile when that was named enable_player_roll rather than enable_player_roll_p, is this because it shared the name with the final decorator?

first of all, thank you for asking these questions. smile

- so where should I move the enable stuff that I put in player_action.c?  To player_movement.c?
You can leave the enable roll script-thing in player_action.c, but what I was telling you was about player.c / player.h. That's the player module: it has nothing to do with scripting.

- Will that require a new object creator because the two that are in that file are different than the ones in player_action.c?
What do you mean exactly by "new object creator" ?

- Which .h did I miss?
I think you haven't declared "enable_player_roll_p" in player.h (it doesn't show up in here), but I was also criticizing the name of the function. It must be called player_something (player_enable_roll, for example): all other functions in player.h are called this way. It's important to maintain the internal consistency.

- I want to learn to do this properly, and I think that working through this will help us both in the long run.
Good. smile

- Also, where should I move the stuff that was in player.c, I don't specifically see an enable.c module, does it need to be created to follow that convention?
I don't understand the question, nor what "stuff" means.

- Also, I was unable to properly compile when that was named enable_player_roll rather than enable_player_roll_p, is this because it shared the name with the final decorator?
I have no idea, but the error messages from the compiler can probably tell you the cause of the problem. What I'm telling you, right now, is to follow the conventions. Keep the code consistent. It's important. Compiling isn't enough. Having a new feature isn't enough. The code must be of good quality. If the discipline is not kept, things quickly becomes a mess, and adding new features becomes a pain.

Re: New features by lunarrush

@Alex

Where in the script is it?

Re: New features by lunarrush

Ok, the same link has an updated file set that follows these conventions and an updated .exe.  Please take a look at it when you get a moment.  Also:
When I said stuff  I meant the functions I renamed in the latest version, so that problem is solved.

Thanks Alex,
-lunar

If I knew then what I know now I'd tell you that the story's true.  Cause whatever you do, it comes back to you.  -Slaughter, Burning Bridges

Re: New features by lunarrush

@lunar

I'm trying to keep SGO to use the latest bleeding-edge. Do I need to download the new link?

Re: New features by lunarrush

@S32X: This is literally the bleeding edge at the moment, but all that really changed was the name of 2 internal functions and the routine of two internal functions.  It will not make any major difference to update right now, the next feature will of course require an update.

If I knew then what I know now I'd tell you that the story's true.  Cause whatever you do, it comes back to you.  -Slaughter, Burning Bridges

Re: New features by lunarrush

Okay. Is the next update "give_player_shield"? Cause I wasn't specific with my request.

"give_player_shield" will be like this:

give_player_shield "<"shield">

"<shield>" will vary:

"shield"
"fireshield"
"watershield"
"thundershield"
"windshield"
"acidshield"
"invincibiliy"

Also, here's a new decorator idea: "give_player_speedshoes".

Re: New features by lunarrush

Is invincibility is a shield? Please don't put "invincibility" in give_shield. Nor speedshoes.

lunar wrote:

Ok, the same link has an updated file set that follows these conventions and an updated .exe.  Please take a look at it when you get a moment.

I will take a deep look as soon as possible, but after looking briefly, the conventions are looking all good. Thanks, lunar. smile

Re: New features by lunarrush

I didn't say speedshoes was in give player shield. How's this

give_player_shield "<shield>"
give_player_invincibility
give_player_speedshoes

Re: New features by lunarrush

Isn't give_player_invincibility essentially the same as strong_player? Or is there the factor of danger/fire objects I'm not paying attention to?

Your teacher asks you. What to answer? Say this:
"I thought the teacher is supposed to know."

Re: New features by lunarrush

SurgeChris wrote:

Isn't give_player_invincibility essentially the same as strong_player? Or is there the factor of danger/fire objects I'm not paying attention to?

Strong player basically just makes you act like you are in ball mode even when you are not. It doesn't protect from damage unless you count enemy collision.

Re: New features by lunarrush

Note:
Hi there everyone,
I'm going out of town for the next week or so, during that time I may be on the forum from time to time but I will not be doing any programming whatsoever.  I'll see you guys next week, when I will pick up on what I was doing before.
-lunarrush

If I knew then what I know now I'd tell you that the story's true.  Cause whatever you do, it comes back to you.  -Slaughter, Burning Bridges

Re: New features by lunarrush

Oh that just great-- I mean, have a nice vacation! smile

Re: New features by lunarrush

Have a nice time there. smile I'll be merging your modifications to the svn.

Re: New features by lunarrush

@Alex

do you think you can take over for lunar while he's gone?

Re: New features by lunarrush

I work on opensurge whenever I have free time, as I always have been doing.

Re: New features by lunarrush

the changes have been merged to the svn. smile I looked deeply into the modifications, and there are a couple of observations i'd like to do:

- you put comments "edits by Dalton ..." in the header. That's fine, but which edits are these? I specified these edits before uploading to the repository. Maybe we can keep this policy for now?

I think that in the medium-long run, as we gain more contributors, we'll need to establish some kind of policy regarding those things (maybe creating a Changelog of some sort). It's worth studying how Allegro developers manage those things (haven't had the time to look it closely, but it seems they do it through changelogs rather than comments in the code)

- the code looks fine in terms of functionality, but as I said earlier, it's very important to follow the conventions. When working with boolean variables (player->disable_roll), rather than comparing/setting them to 0 or 1, set them to TRUE or FALSE (these are constants defined in the code). Instead of checking if(var == 1), check if(var). Instead of if(var == 0), try if(!var).

Please remember to svn up before continuing your work. smile Thanks for the contribution.