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

Events and warping troubles


Clarkos
 Share

Recommended Posts

Hi, I am new to Eclipse and although I am getting the hang of it, I have one problem that I just can't seem to fix! 

I have made a simple warping event which allows me to go through doors.

However my problem is that once I go through the event,  my player appears in another part of my city for like a milli second.

Coordinates are set to just outside of the prison, so I do not know why this keeps happening.

Here is a link to a youtube clip of my problem. 

http://www.youtube.com/watch?v=iN4MnKtBDSM

If you can help it would be much appreciated!

Thanks :)
Link to comment
Share on other sites

A lot goes on in the engine at once. What is happening is that your player's map is being updated, then the screen drawn, then the player's x,y coordinates updated. So for a frame (maybe not all the time, maybe 2 frames sometimes), your character appears in their original x,y location on the new map - which is wrong.

In my opinion this problem occurs because your engine uses split-second screen transitions between maps, instead of a short fade out and in (which, although not especially complicated to add, is perhaps outside the scope of a Q&A. You can find many example sources from other games online).

A quick fix is to add a boolean trigger to not render the game until after both pieces of information is sent, although this is adding an if statement that would trigger the same amount of times as your FPS, which isn't a big deal, but it is a slight performance nerf. For example:

```
'put this in modGeneral
Public PauseRender As Boolean

Sub WarpCode

'dimmed variables
PauseRender = True
'code 
PauseRender = False

End Sub

Sub Render_Graphics

'variables
If PauseRender = True then exit sub
'code

End Sub

```
Link to comment
Share on other sites

Thanks for your reply i'm glad you understand my problem! I searched for modGeneral within SRC

and had to use notepad to open the file. Within the file I copied and pasted this code. Unfortunately this did not change anything.

Unless you can edit modGeneral like you can mapeditor? I'm not sure what is the best way to edit the modGeneral so i'm guessing I have definitely done this incorrectly! 

As you can tell this is 100% new to me and i'm not quite certain how to edit the game engine as of yet.
Link to comment
Share on other sites

> Thanks for your reply i'm glad you understand my problem! I searched for modGeneral within SRC
>
> and had to use notepad to open the file. Within the file I copied and pasted this code. Unfortunately this did not change anything.
>
>  
>
> Unless you can edit modGeneral like you can mapeditor? I'm not sure what is the best way to edit the modGeneral so i'm guessing I have definitely done this incorrectly! 
>
>  
>
> As you can tell this is 100% new to me and i'm not quite certain how to edit the game engine as of yet.

You cannot open .bas, .vbp, .cls or .frm files with notepad or any other text editor. Get yourself a copy of VB6 IDE Enterprise edition.
Link to comment
Share on other sites

Ahbi is right. You will need the Visual Basic 6.0 IDE to edit this, as it involves altering the source code. I recommend searching outside of this forum for how to obtain a copy. In my experiences, a free, trial, or portable version will only lead to more problems.

If the engine you're using is still being updated and supported, you should bring this thread to the attention of the engine's developer as a bug report.
Link to comment
Share on other sites

Oh Okay thanks, that makes sense why I couldn't do it lol. Okay i've been looking around but I only see a few torrents nothing amazing. Unfortunately nothing on the IDE Enterprise Edition.

Do you by any chance know of anywhere I can get this?

I literally only need to fix this one issue to finish my project at University.
Link to comment
Share on other sites

> Oh Okay thanks, that makes sense why I couldn't do it lol. Okay i've been looking around but I only see a few torrents nothing amazing. Unfortunately nothing on the IDE Enterprise Edition.
>
>  
>
> Do you by any chance know of anywhere I can get this?
>
>  
>
> I literally only need to fix this one issue to finish my project at University.

Googling VB6 torrents gives you with a link. Not sure if TPB is censored over there, but it is the first link on Google.
Link to comment
Share on other sites

Ah okay cool thanks! I have it now :).

Okay this is a picture of what it looks like within VB6 within the ModGeneral. Is this correct or have I inputted this completely wrong.

Never coded in my life, so if I miss something completely obvious, i'm sorry lol!
Link to comment
Share on other sites

You shouldn't feel bad or stupid because it's an honest beginner mistake, but you've taken my code way too literally… you gave me a good chuckle. 

Programmers often annotate their code using comments. Where I wrote 'variables and 'code were comments. I wrote it that way as a signal to you that the if statement should come between the variables and the code of your sub. You should not be erasing or replacing anything in your Render_Graphics sub, only placing that If -- Then after the Dims and before the rest of the code.

It made no sense to post an actual Render_Graphics sub since I don't even know which engine you're using, much less how it renders.

You will also need to add this anywhere in modGeneral: 

```

Public PauseRender As Boolean
```
Now for the hardest part, you need to actually turn that boolean switch on and off. To do this, you must find the place where your character's location is being set that causes this glitch. I'm not really sure offhand, and really it's impossible to say where you haven't told us which engine you're using, but it's probably in modHandleData. Try doing a search for SetPlayerMap of your entire project within the VB6 IDE.
Link to comment
Share on other sites

Okay okay! lol. So any variable I would have should go before the if statement, and coding afterwards. I hav not used any variables that I am aware of. Code, would that be the <@ Warp Player to map.. etc?

I am currently using Eclipse Event system 2.3.

SetPlayerMap is mentioned within ModPlayer, ModHandleData and ModDatabase
Link to comment
Share on other sites

If you right click the "SetPlayerMap" and click Definition, it will take you to the ACTUAL sub/function.

Within this section is where it sets the player's X & Y co-ordinates.

Thats where you would need to change the variable as he has said above.

Just curious, your using this for your Uni project? In what context?
Link to comment
Share on other sites

Oooh I see, I may of found it, i'm not overly certain! But thanks! How do I switch the Boolean on and off?

Is the green writing within coding notes? Ignored by the system but helpful for the coder to keep track of each bit of code?

The only x, y that is mentioned within the sub of ModHandleData is this.. 

 Blood(i).x = 0

        Blood(i).y = 0

        Blood(i).Sprite = 0

        Blood(i).Timer = 0

The only time definition works is in ModPlayer.

But it talks mainly about Mapnums, although it has separate subs underneath displaying information about SetPlayerX & SetPlayerY..

I kept Public PauseRender As Boolean with ModGeneral 

But too the other parts that I added in ModGeneral Out…

Well i'm doing Game Design at Uni so my assignment was only to create a 2D level design city using eclipse.

I only needed to make like 3 houses accessible, and then this problem happens.

I'm probabaly frustrating you as much as myself, I really have no idea what i'm doing majority of the time -_- lol
Link to comment
Share on other sites

Yes, that's exactly what comments are. The compiler leaves them out when it creates the executable. 

Set the boolean to true above the lines where it sets your map, x, and y locations (SetPlayerMap(index, mapnum), and such). Set it to false below the lines, after they've been set.  The if statement in your sub Render_Graphics stops itself from continuing, thereby stopping frames from updating, before your position is completely set. This should stop the problem identified above.

If you run into any troubles, I'd say just switch engines. I know for example that Ecipse The Final Frontier uses GettingMap as a Boolean to do the same thing (but also uses it in far more places). It's probably a hand-me-down bugfix from Eclipse Mega or its predecessor.
Link to comment
Share on other sites

Okay cool! I think I know what I am to do, I have attempted a few times and have failed.. Can you by any chance show me a picture or something of how the map x and y locations codes would be shown(with other data surrounding, so I can see similarities to what my engine conveys).

I'm not to sure if I have inputted the data in the correct area.

Finally.. If I was to change engines, will my maps I have already made be lost to me, or can I retrieve them?

Thanks!
Link to comment
Share on other sites

To be honest, if this is just for an assignment I think it would be faster (maybe less stressful too) to just try your maps with another engine (I recommend EVB or Eclipse The Final Frontier as they tend to be stable). If it doesn't work, start your maps over. It's still quicker than fiddling with a programming language with which you're struggling. Redoing your maps could lead you to make slight improvements as well, improving your mark.

If the Eclipse engine was assigned, is anyone else having trouble with this? Maybe your instructor won't even care. I can't see you being tested on how well the engine was programmed so much as general design and aesthetics.
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...