scidave's Forum Posts

  • I've always been interested in text-based games myself. I think you can make a good text-based game in Construct and I think a few folks here (maybe cow-trix) have made one already.

    IMO Construct doesn't have the best support for text related processing and you may find it easier to use Python to parse commands and interact with other characters.

    The main thing is to define the world and all of the rooms that the player can move through. Due to complexity the rooms should not be layouts but instead maybe groups or a state. The state machine plugin may be very handy in this type of game.

    Text games also heavily involve the use of items. You will need a good inventory system and a method to interact with the items using arrays or hashtables. You will need puzzles and a way for someone to use the items.

    So lots and lots of text parsing and processing.

  • What KrushBrother says is true, it should look just as good tiled.

    were still debating on what to do regarding this.

    There is really nothing to debate, it should be a no-brainer to go back and fix it. I have a strong suspicion that the large backgrounds ARE the source of the problem. So instead of wasting countless hours with bugs you can't reliably duplicate spend that time instead doing the game right.

    Another option is to reduce the resolution on the game and graphics and see what that buys you.

    At the very least your game will have a significantly smaller disk and memory footprint and if you still have bugs then people might be willing to help ( I don't see many people willing to wait through the long load times to troubleshoot the game as-is).

    Other than the backgrounds, I didn't see anything glaringly wrong in your events. It seems like it will be a cool game!

  • Isn't there a bug in accessing the Z dimension for the array object?

    As far as examples for arrays go. I use arrays in several places in Part 4 and Part 5 in the adventure tutorial. It shows how to loop through and read and write from X, and Y based on loopindex. I thought I ran into a bug when accessing Z, but maybe that was fixed.

  • I got a chance to look at the .cap file and it is quite a mess. It took nearly 3 mins before it would start in the debugger! At this pace it isn't even practical for me to try to troubleshoot. However, here are some things you can do to drastically reduce the size of your game (on disk and in memory):

    1. Don't make the backgrounds paintings!! You should instead have smaller sprites or tiled background objects for different parts of the background. This alone will reduce the size of the game dramatically.

    2. I don't know if you are doing this, but don't import the same graphic twice. Once you import it once then copy it into the other layouts where it may be needed.

    The game isn't nearly big enough or complex enough to warrant a 15MB .cap. Once you fix your backgrounds then your game should only be 1-2 MB and perhaps your problems will go away as well!

  • Nope, you're not missing anything. It would be a nice feature to have.

    It's not really a nuisance, to me at least, since I now keep a couple of empty events on hand for things like these. You only have to do it once and then you don't need to make dummy conditions anymore for the rest of your project.

  • Ok, I figured it out.

    The keycode is the index into the keyTable[] array on the following page:

    https://construct.svn.sourceforge.net/s ... d/Main.cpp

    So:

    ControlTableEntry keyTable[] = {

    {VK_LBUTTON, "Left mouse button"},

    {VK_MBUTTON, "Middle mouse button"},

    {VK_RBUTTON, "Right mouse button"},

    {VK_TAB, "Tab"},

    {VK_RETURN, "Enter"},

    {VK_SHIFT, "Shift"},

    {VK_LSHIFT, "Shift (left)"},

    {VK_RSHIFT, "Shift (right)"},

    {VK_CONTROL, "Control"},

    {VK_LCONTROL, "Control (left)"},

    {VK_RCONTROL, "Control (right)"},

    {VK_MENU, "Alt"},

    {VK_LMENU, "Alt (left)"},

    {VK_RMENU, "Alt (right)"},

    {VK_PAUSE, "Pause"},

    {VK_ESCAPE, "Escape"},

    {VK_SPACE, "Space"},

    {VK_HOME, "Home"},

    {VK_END, "End"},

    {VK_UP, "Up arrow"},

    {VK_DOWN, "Down arrow"},

    {VK_LEFT, "Left arrow"},

    {VK_RIGHT, "Right arrow"},

    {VK_INSERT, "Insert"},

    {VK_DELETE, "Delete"},

    So if you wanted the space key you would do a:

    if MouseKeyboard.KeyDown(16):

    do your stuff

    For readability, you will probably want to just statically define the mapping in a start of layout event.

    Cheers!

  • Another Python user!

    You may have discovered a bug in the Python support for this feature:

    I've been looking at this for the past 30 mins and haven't quite figured out what is wrong but have some ideas:

    The implementation of the MouseKeyBoard plugin is here:

    https://construct.svn.sourceforge.net/s ... d/Main.cpp

    If you look at the actual functions when you normally add an event:

    ADDPARAMCOMBO("Key", "Key to check if down.", keysCombo);
    	ADDCND("Key is down?", "Keyboard", "%o Key %0 is down", &ExtObject::cKeyDown, "KeyDown", 0);
    [/code:10k3mnnh]
    
    That registers this callback function:
    [code:10k3mnnh]long ExtObject::cKeyDown(LPVAL params)
    {
    	return KeyIsDown(keyTable[params[0].GetInt()].vk);
    }
    [/code:10k3mnnh]
    
    This returns the value for the virtual keys:
    [url=http://www.kbdedit.com/manual/low_level_vk_list.html]http://www.kbdedit.com/manual/low_level_vk_list.html[/url]
    
    So it appears that all you should have to do is feed in the key name which would be "Left arrow".  That of course, doesn't work and feeding in key codes doesn't make sense since it won't be found in the lookup table.
    
    So I guess we need to find the Python implementation code and see what is going wrong.  I don't know where it is so maybe Ashley or ROjohound may have some ideas.
  • i WANT to create an action that says on collision between BULLET and MONSTER add 1 to kill count.

    There is a system action that allows you to modify global variables.

  • Welcome to the forum!!

    if monster private variable "hit count" is greater or equal to 5, than destroy monster and go to next layout. However, it goes to the next layout after destroying one monster.

    It sounds like your events are working exactly how you programmed them based on your first sentence! If you want to make it go to the next layout after killing all monsters then use a global variable or a player private variable to keep track of how many monsters killed (killCount). If you have 5 total monsters then have an event:

    Event: global('killCount') >= 5:

    Action: goto next layout

    also is 3D possible with construct?

    If you want a full blown 3D game you should try something other than Construct. However, you can have 3D elements in your game such as 3D box and look at some of the Mode7 examples on the forum.

  • The video was encoded in Mpeg-4.

    You may run into issues with Python since the AAC (Mpeg-4) codec is not supported well. For example, your best bets are Pyglet, Pymedia, or Pygame. However, what what I can tell they do not support Mpeg-4. http://www.pyglet.org/doc/programming_g ... types.html

    If you go the Python route, you would have to convert the video to a different supported type. The other issue is that you can't display the video to Construct's window, it would be the Pygame or Pyglet surface/window. You could work around this by setting the Python surface to that of Construct and making it borderless. Then with Python you would destroy the surface you created once the video is done.

    So this isn't a simple process.

  • So but now to my questions:

    Thanks for the feedback and finding bugs in the docs. Once I get some more free time I plan on going through all of the tuts and fixing bugs and typos. I'll make sure to add your stuff to the list!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • i'd love to upload the .cap but i dont see any way to do it and its pretty big(15MB)

    Get a dropbox or box.net account, both are free and you can upload there.

    Also, have you tried your .cap in Construct .99.84 to see if it works any better.

  • It isn't clear that your example could achieve similar results. For example, how would you do something like this?

    Assume you have 100 instances of Sprite each representing a networked client's player. Each player gets a global variable "myNumber". Assume that for one player, his myNumber = 88.

    In Python, to set his sprite to a new position:

    Sprite[System.globalvar('myNumber')].SetPosition(x,y)

    Your method in events has to directly access the right sprite instance, you can't loop through instances up to 88 or pick based on private variable. If you can, then many people including myself would be very interested!!

  • So that makes me wonder how many people here already have a server ready to test things on?

    This is not a big deal since any player can host a game. Unless we are talking about large persistent worlds then a player can host any online multiplayer game by doing:

    1. Enable NAT passthrough on their router. This is really easy to setup. You then run the "server" on an internal IP on your home network and the router forwards traffic from a particular port to your system.

    2. Use a free networking tool like Hamachi. https://secure.logmein.com/products/hamachi2/ Now everybody is on a virtual LAN and you host the server on your Hamachi IP address. Added benefit of this is you get lower lantency and more reliable connections.

    I DO recall that someone was working on a networking plugin.

    Dataflashbot mentioned a few weeks ago that he was, but he didn't want anybody to hold him to it so I'm not sure if he will end up making one or not.

    but this can cause issues with players behind routers

    This will only be an issue for all players if the plugin is a peer-to-peer type. Even in that case the best solution is to have everybody use Hamachi or as secondary solution all players would have to enable NAT passthrough. An alternative is to have the online plugin itself use NAT punch-through like what Raknet uses.

    Edit: If someone starts making a plugin definitely DON'T write from scratch using sockets. Like Ashley mentioned there are libraries out there. For example, Sun99 pointed out the Zig library which wraps HawkNL. Take a look at this thread before starting out on making a plugin.

    http://www.gamedevid.org/forum/archive/ ... -3577.html Some of the libraries are old and haven't been updated but it's better than starting from scratch!

  • Thanks everyone! I really hope this will get more people to try Python and Construct.

    sooo ... when is this going to become a plug in? =P

    I recognize the humor. This functionality would make for a sweet plugin. As crazy as it sounds Python is actually BETTER than a plugin (assuming the PV and behavior access is fixed in Python). The reason is that Construct does not have access to sprite indexing (the ability to reference a sprite instance by index), but Python does. For example, sprite[0].X would access the first instance's X location. If you can't do that then multiplayer games are impractical for anything more than a 2-4 person game. If someone writes an online plugin, they also need to add support for sprite indexing.

    It is Python. It cannot be made into a plugin like this.

    Technically, you could make a plugin based on this library by using Python embedded in C++. Now, would someone actually want to do that? Probably not, they would just write it all in C.