Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Level Design (https://forums.graalonline.com/forums/forumdisplay.php?f=6)
-   -   Nw2png2.0 (https://forums.graalonline.com/forums/showthread.php?t=134265086)

Draenin 11-26-2011 02:37 AM

Will this work on terrain maps?

cbk1994 11-26-2011 02:41 AM

Quote:

Originally Posted by Draenin (Post 1675410)
Will this work on terrain maps?

Nope.

DustyPorViva 11-26-2011 03:13 AM

Quote:

Originally Posted by Draenin (Post 1675410)
Will this work on terrain maps?

Stefan uses some special licensed generator to render 3D terrain, something I would never be able to emulate. Also, the terrain gmaps don't store level data.

At least because of the nature of 3D terrains using the GraalEditor's mapping function the maps don't end up looking too bad.

DustyPorViva 11-26-2011 04:40 AM

1 Attachment(s)
New update, and I think as far as features go I'm done. I can't think of much more to add.

New Features
> The choice to disable or enable rendering and parsing(meaning quicker generation) of NPCs. It will still scan for addtiledefs.
> Saving of checkbox options as well now.
> Addition of error logging, you can find the logs in errorLog.txt if anything goes wrong. It will write a stack trace under the level it encountered the error in, and attempt to narrow it down to a specific function.
> Definitions for join classes. You can now assign images, and even ganis, to join classes. When the parser encounters a join command it will scan ClassImages.txt for the appropriate information to render the NPC. Check the text file for more information.
> Fixed more bugs pertaining to parsing. If you were having problems with it hanging on specific levels this should help. Before it was trying to parse specific variables(this.dir = 2) but was also detecting modifiers like this.dir += 2; and encountering parsing problems, causing it to hang. Fixed it by only allowing = and no operation characters to the left or right.

Edit: Okay, finally got it all sorted(I hope). I think that makes all features complete, and only debugging left to do, and hopefully I've gotten rid of a lot. When most of the bugs are fixed I'll have Crono update the original post with explanations and such and the latest files.

ffcmike 11-26-2011 01:14 PM

1 Attachment(s)
Everything appears to be running fairly smoothly now, class assigning works aswell.

One new problem which might only apply to me is that a lot of characters are facing the wrong direction, it seems to be because I also have these NPCs using a variable of "this.dirturn = true;".

Another noticable error is where I was using a specific frame of a gani:
Quote:

Warning : Couldn't render the gani classic_player_walk_01[3].gani
Something else I can't figure out though is where candle.mng is rendering as what appears to be some type of head, which is a bit odd because MNGs aren't supported and this head image isn't used anywhere else on the map:

http://img191.imageshack.us/img191/8762/error1i.gif

This could well be the result of setimgpart: this.setimgpart("candle.mng",0,0,32,16);

A couple of things which might be useful, is the detection of a custom variable within an NPC specifically to avoid being rendered within this program, and the ability to set a different sprites.png as some servers may use a custom one, in my case the only difference is semi-transparent shadows. Being able to assign ganis to classes would be cool too.

I've attached the error log incase there's anything of interest.

DustyPorViva 11-26-2011 03:13 PM

Quote:

Originally Posted by ffcmike (Post 1675451)
One new problem which might only apply to me is that a lot of characters are facing the wrong direction, it seems to be because I also have these NPCs using a variable of "this.dirturn = true;"

Hmm, I don't think that would be parsed into the direction, but I'll take a look into it.

Quote:

Originally Posted by ffcmike (Post 1675451)
Another noticable error is where I was using a specific frame of a gani:

I anticipated that, but I didn't think many people used that so I didn't bother, I guess I'll implement it :) However, my gani parsing only parses the first frame so I won't be able to make it parse the specified frame, sorry!


Quote:

Originally Posted by ffcmike (Post 1675451)
Something else I can't figure out though is where candle.mng is rendering as what appears to be some type of head, which is a bit odd because MNGs aren't supported and this head image isn't used anywhere else on the map:

http://img191.imageshack.us/img191/8762/error1i.gif

This could well be the result of setimgpart: this.setimgpart("candle.mng",0,0,32,16);

MNG's aren't supported so I'm not sure what's going on. Hopefully just ignoring images that are MNG will fix this.

Quote:

Originally Posted by ffcmike (Post 1675451)
A couple of things which might be useful, is the detection of a custom variable within an NPC specifically to avoid being rendered within this program,

hide and hide() maybe? However if I use hide chances are it'll get parsed when it's not supposed to, such as
PHP Code:

function onPlayertouchsme() {
  
hide();
  
sleep(3);
  
show();


Would probably get hidden, and I can't think of another way to fix this other than doing some complex script parsing. If you'd like a custom variable like this.maprender = false; I could easily do that.
Quote:

Originally Posted by ffcmike (Post 1675451)
and the ability to set a different sprites.png as some servers may use a custom one, in my case the only difference is semi-transparent shadows.

I also anticipated this, but I figured the only thing it affected were shadows. Do you consider this very important?

Quote:

Originally Posted by ffcmike (Post 1675451)
Being able to assign ganis to classes would be cool too.

You can already do so :) Check the file, it should have an example and instructions on assigning a gani to a join class.

ffcmike 11-26-2011 03:23 PM

Quote:

Originally Posted by DustyPorViva (Post 1675456)
If you'd like a custom variable like this.maprender = false; I could easily do that.

Yeah that would be useful.

Quote:

Originally Posted by DustyPorViva (Post 1675456)
I also anticipated this, but I figured the only thing it affected were shadows. Do you consider this very important?

Not really no, I'd actually prefer to prevent showcharacter()'s from being rendered anyway.

Quote:

Originally Posted by DustyPorViva (Post 1675456)
You can already do so :) Check the file, it should have an example and instructions on assigning a gani to a join class.

That's good to know, I didn't notice it as I was only extracting the .jar file for each new version.

Edit:
I've tried the assigning of classes to ganis now, strangely this worked as expected:

Quote:

quest_baddy_bird=gani:classic_baddy_bird_idle,para m1:classic_baddy_bird_red.png
But these only rendered the shadow and no image as specified by attr[1]:

Quote:

quest_baddy_chicken=gani:classic_baddy_chicken_idl e,attr1:classic_baddy_chicken_sprites.png

quest_baddy_chick=gani:classic_baddy_chicken_idle, attr1:classic_baddy_chicken_chick.png

quest_baddy_rooster=gani:classic_baddy_chicken_idl e,attr1:classic_baddy_chicken_rooster.png
And:

Quote:

quest_baddy_butterfly=gani:classic_baddy_butterfly _01
Simply produced an error of:

Quote:

Warning : Couldn't find the image gani:classic_baddy_butterfly_01
(I don't know why these quotes have a random space in them, they aren't contained within the text I've entered)

DustyPorViva 11-26-2011 05:16 PM

1 Attachment(s)
Quote:

Originally Posted by ffcmike (Post 1675457)
Not really no, I'd actually prefer to prevent showcharacter()'s from being rendered anyway.

The problem I'm having with this is actually being able to tell the difference between an actual character gani, and a prop gani like a tree or such. Not everyone uses showcharacter() reliably. The option is there for now, but I don't know if I commented out the functionality or not.

Quote:

Originally Posted by ffcmike (Post 1675457)
Edit:
I've tried the assigning of classes to ganis now, strangely this worked as expected:

I've fixed this.

> I've also fixed the MNG issue
> added the ability to ignore the rendering of NPCs if you use this.ignorerender = true; in the script of an NPC. However, it's a bit unreliable now, and won't apply to NPC's that aren't setimgpart or ganis, because of the way NPCs are processed(on the fly).
> Fixed the setCharani(gani[frame],null) issue
> I fixed the issue with this.dirturn and so on. Now only applies if the variable is this.dir.

Deas_Voice 11-26-2011 09:10 PM

nice =)

you might want to get someone to edit the first post for you, and include the github link.
you might as well clean the first post up a bit with bullet list of what you have added, it's hard to read what you have added, but im sure it's all awesome things (=

i havent been on graal for a while, so i probably wont use it, but from what the posts in this thread can tell me, you have dont a great amount of work!

ill forward the thread to Alex (born2kill) when i see him online, I'm sure he will be surprised!

DustyPorViva 11-26-2011 09:11 PM

Quote:

Originally Posted by Deas_Voice (Post 1675480)
nice =)

you might want to get someone to edit the first post for you, and include the github link.
you might as well clean the first post up a bit with bullet list of what you have added, it's hard to read what you have added, but im sure it's all awesome things (=

i havent been on graal for a while, so i probably wont use it, but from what the posts in this thread can tell me, you have dont a great amount of work!

ill forward the thread to Alex (born2kill) when i see him online, I'm sure he will be surprised!

I'm waiting for it to be completed before I have the original post updated. I don't want to bother Crono every time I make a minor update.

DustyPorViva 11-27-2011 02:14 AM

1 Attachment(s)
Fixed some more parsing errors.

edit: Updated

DustyPorViva 11-27-2011 08:00 AM

1 Attachment(s)
Alright, this is nearing completion, though Chris Vimes is also contributing and looking into solving the memory issues.

I've squashed a lot of bugs, and I sat and talked with Thor as he rendered his maps, sorting out various bugs and he eventually ended up with a rendered map and no issues. However, this update is for some more major feature updates:

> NPCs and Ganis are now stored differently, but together. This makes things a little simpler in the code, but more importantly it allows me to sort them before I render them. Now they're sorted via their Y position, meaning NPCs should now no longer draw oddly over each other. However, because of the way ganis and such are rendered, there were slight complications. If a gani was in front of a door for example, but one tile below it, it was still being rendered under the door because of the way gani offsets are handled. So to compensate this I gave ganis a "handicap" so that if their Y matches a non-character Y, they would get draw over priority. However, because I've added this, it will also allow me to eventually parse for drawoverplayer() and so on and add that into the calculations when sorting.
> Render Characters toggle now works. Though, it only works if a character is deemed a character via showcharacter. If you're simply setting a gani like setcharani idle,null; then it will still be drawn.
> Fixed loads and loads of parsing bugs

So unless people have some major bugs will this, I'll probably sort out a nice write up about it and have Crono update the original post.

edit: Catching nullpointervalues now so it shouldn't hang when it encounters those problems, and should notify you via errorlog.

GoDoT 08-15-2012 12:52 PM

This does not show any NPC's at all for me:
http://i.imgur.com/VOivU.png

ffcmike 11-04-2012 10:06 PM

It seems the recent changes to file cache'ing in V6 prevents images from being found by this tool, which is a massive shame.

DustyPorViva 11-04-2012 10:23 PM

Ah that's a pity... if someone wants to make up a quick fix the source is still up. If I ever get back into this I'd probably redo a lot of things from scratch(like script parsing), and I haven't the time for that right now.


All times are GMT +2. The time now is 09:37 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.