Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

'Small NPC'


CoonHunter
 Share

Recommended Posts

Just use the 32 x 32 option but make the actual sprite smaller, make the area around it transparent. I wouldn't see why you would need it much smaller then that. There is a few small sprites floating around that use that system and it works fine.
Link to comment
Share on other sites

@Marsh:

> Just use the 32 x 32 option but make the actual sprite smaller, make the area around it transparent. I wouldn't see why you would need it much smaller then that. There is a few small sprites floating around that use that system and it works fine.

I mean adding a new image-set. Not loading from one that already exists. Would it already load it? I have not done allot of research on this, as I am still looking in the source to learn it.

What im wanting to do: Add a new button, under the "Big NPC" button, that will load a different NPC image-set, my question, will these work, without any more edits than on the edit NPC panel. Im thinking, yes, alot more than that, but thats just a simple statement.
Link to comment
Share on other sites

Ah i get what you mean now, yes it would most likely require more edits because you have to tell the game to show this new sprite sheet as well when viewing the map and not just dealing with the editor. As for how to do it i cannot tell you as i do not program in vb6\. I would simply look at the big npc code and basically duplicate it with a few small changes.
Link to comment
Share on other sites

Considering that Eclipse uses a 32x32 grid, the 32x32 sprites are 1 square unit. That's the smallest you _can_ get.

@CoonHunter:

> I mean adding a new image-set. Not loading from one that already exists. Would it already load it? I have not done allot of research on this, as I am still looking in the source to learn it.
>
> What im wanting to do: Add a new button, under the "Big NPC" button, that will load a different NPC image-set, my question, will these work, without any more edits than on the edit NPC panel. Im thinking, yes, alot more than that, but thats just a simple statement.

The reason we have "Big" NPCs is because they wouldn't fit in the small grid. A "small" NPC _would_ fit in that grid. If your NPC, for example, is 16x16 pixels, it will fit in a 32x32 box.

You don't need another image set to accomplish this. Just format your sprite to fit on your sheet.
Link to comment
Share on other sites

@Ballie:

> Considering that Eclipse uses a 32x32 grid, the 32x32 sprites are 1 square unit. That's the smallest you _can_ get.
>
> @CoonHunter:
>
> > I mean adding a new image-set. Not loading from one that already exists. Would it already load it? I have not done allot of research on this, as I am still looking in the source to learn it.
> >
> > What im wanting to do: Add a new button, under the "Big NPC" button, that will load a different NPC image-set, my question, will these work, without any more edits than on the edit NPC panel. Im thinking, yes, alot more than that, but thats just a simple statement.
>
> The reason we have "Big" NPCs is because they wouldn't fit in the small grid. A "small" NPC _would_ fit in that grid. If your NPC, for example, is 16x16 pixels, it will fit in a 32x32 box.
>
> You don't need another image set to accomplish this. Just format your sprite to fit on your sheet.

I know this, your not quite getting what i am saying. I do not care about the grid-size at all. I know these npc's are within the 32x32 grid. I just do not wish to transfer these onto another sheet. I want to load this sheet as a 3rd possible NPC sheet.
Link to comment
Share on other sites

If you want to do that, I suppose you could. Here's a little bit to get you started.

```
    ' Init sprite ddsd type and load the bitmap
    DDSD_Sprite.lFlags = DDSD_CAPS
    DDSD_Sprite.ddsCaps.lCaps = DDSCAPS_SYSTEMMEMORY
    Set DD_SpriteSurf = DD.CreateSurfaceFromFile(App.Path & "\GFX\Sprites.bmp", DDSD_Sprite)
    SetMaskColorFromPixel DD_SpriteSurf, 0, 0
```
That's where the Sprite surface is loaded. You'll basically duplicate this, but rename the variables to SmallSprite instead of Sprite. From there, you'll want to search the whole project for "DD_SpriteSurf", and basically duplicate the code for "DD_SmallSpriteSurf". In all the places you'll have to edit, there will already be code there for 32x32 that you can use. You can probably get away with copying and pasting the whole code, making the change to say "SmallSprite" in the places it counts. The only places you really need to copy anything is in InitDirectX, DestroyDirectX, and BltNPCBody. That will get you the graphics part. The rest is just adding a button that changes the "SpriteSize" variable on the editor.
Link to comment
Share on other sites

@Ballie:

> If you want to do that, I suppose you could. Here's a little bit to get you started.
>
> ```
>     ' Init sprite ddsd type and load the bitmap
>     DDSD_Sprite.lFlags = DDSD_CAPS
>     DDSD_Sprite.ddsCaps.lCaps = DDSCAPS_SYSTEMMEMORY
>     Set DD_SpriteSurf = DD.CreateSurfaceFromFile(App.Path & "\GFX\Sprites.bmp", DDSD_Sprite)
>     SetMaskColorFromPixel DD_SpriteSurf, 0, 0
> ```
> That's where the Sprite surface is loaded. You'll basically duplicate this, but rename the variables to SmallSprite instead of Sprite. From there, you'll want to search the whole project for "DD_SpriteSurf", and basically duplicate the code for "DD_SmallSpriteSurf". In all the places you'll have to edit, there will already be code there for 32x32 that you can use. You can probably get away with copying and pasting the whole code, making the change to say "SmallSprite" in the places it counts. The only places you really need to copy anything is in InitDirectX, DestroyDirectX, and BltNPCBody. That will get you the graphics part. The rest is just adding a button that changes the "SpriteSize" variable on the editor.

Already have all of this done. I need to work out some bugs in the checkbox's, but its working decently. My only problem now, is differentiating the NPC sheet it uses after it saves. I have it loading it and stuff. When I click 'Save' it goes back to using "Sprites.bmp"

EDIT: Would I be able to use the SpriteSize long to differentiate between images?
Link to comment
Share on other sites

@Ballie:

> @CoonHunter:
>
> > EDIT: Would I be able to use the SpriteSize long to differentiate between images?
>
> Yeah. Just assign the new SpriteSize to 2, and add conditionals in the few areas needed.

I hate to ask this, since ive never had to do it before when trying to add something completely new to a client, but for the life of me i cant figure out whats going wrong.

If i upload the source, would you be willing to help me figure out why, i can get the NPC to load on NPCEditor menu. But, when i save it, and go back in to edit, it is back to using Sprites.bmp
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...