el3um4s's Forum Posts

  • Nice work, a true classic.

    Mikal Thank you!

    How was it integrating the JS into C3, any special tips or tricks along the way?

    I used JS to manage the math part of the game. I left the graphic part to C3.

    For example, to check that the insertion of values ​​is consistent I used js

    To show the screen writing I used c3

    A useful trick, even if fairly trivial, was to use a global object to pass some values ​​between C3 and Js.

    To pass the values ​​I used two JS functions: getValoreVariabile, to get the value.

    function getValoreVariabile(runtime, nomeOggetto, nomeVariabile, position = "first") {
    	if (position == "first") {
    		const obj = runtime.objects[nomeOggetto].getFirstInstance();
    		return obj.instVars[nomeVariabile];
    	} else {
    		const obj = runtime.objects[nomeOggetto].getFirstPickedInstance();
    		return obj.instVars[nomeVariabile];
    	}
    }

    And setValoreVariabile, to set the value.

    function setValoreVariabile(runtime, nomeOggetto, nomeVariabile, value, position = "first") {
    	if (position == "first") {
    		runtime.objects[nomeOggetto].getFirstInstance().instVars[nomeVariabile] = value;	
    	} else {
    		const array = runtime.objects[nomeOggetto].getPickedInstances();
    		array.forEach(function(obj) { obj.instVars[nomeVariabile] = value; });
    	}
    }

    For example, to print the player's statistics, I first calculate everything to JS

    const value = hamurabi.ReportPlayer();

    Then I pass the value to an object c3

    setValoreVariabile(runtime, "HAMURABI_PERSISTENT_MEMORY", "HAMURABI_log", value);

    And finally I leave to C3 the task of writing on screen.

    -> txtLog: Typewriter text HAMURABI_PERSISTENT_MEMORY.Log over 3 seconds

  • wow, this is very impressive!

    When do you plan to release a playable beta?

  • Thank you alvarop. That's just a little more than an exercise but it was useful to test Javascript and C3.

    The link you showed me is really well done. The ministers add difficulty and interest to the game.

  • https://el3um4s.itch.io/hamurabi

    Hamurabi is a text-based strategy video game of land and resource management. It was first developed under the name The Sumer Game by Doug Dyment in 1968 at Digital Equipment Corporation as a computer game for fellow employee Richard Merrill's newly invented FOCAL programming language.

    The game consists of ten rounds wherein the player, as the ancient Babylonian king Hammurabi, manages how much of their grain to spend on crops for the next round, feeding their people, and purchasing additional land, while dealing with random variations in crop yields and plagues.

    Credits

    • Original Author (1968) : Doug Dyment
    • BASIC Port (1973) : David Ahl (printed in BASIC Computer Games, 1973)
    • CPP Port (2015): Khlle

    Link

    Screenshot

    Link: https://el3um4s.itch.io/hamurabi

  • A different dice game. Each throw calls for a new decision. From an idea by Sid Sackson.

    LINK

    Rules

    Two Combinations and One Reject

    The 5 dice are thrown and the player the divides the 5 numbers into two "combinations" of two dice each and one "reject". The two combinations are marked in the top columns and the rejects is marked in the bottom.

    For example

    The player throws a 1, 1, 2, 4 and 5.

    One of the many ways in which can be divided is by combining a 1 and the 2 to make a total of 3, combining the 4 and the 5 to make a total of 9 and leaving a 1 as the reject.

    Only 3 Rejects

    The player continuing in this manner, throwing the 5 dice and dividing them as he choose. He, however, is limited to 3 different reject numbers, and the player must divide the dice so as to have one of those 3 numbers as the reject.

    If, after the reject numbers have been set, the player make a throw containing none of the three numbers, he gets a "free ride". He can choose any two combinations he wishes and ignore the fifth die.

    For example

    1,2 and 5 have been marked as the rejects. A throw made 1, 4, 4, 4 and 6. The player has no choice but to divide the dice 4 and 4, 4 and 6, with 1 as the reject.

    The Game Over

    The player continues throwing the dice until one of the three reject numbers has 8 marks placed next to it. Play is then completed and the game is scored.

    TO DO

    • Credits page
    • Sound (and background music?)
    • In game help
    • Classic mode?
    • Desktop or mobile version?

    SCREENSHOTS

  • Working on my new project (maybe I'll finish it😅). It is a simple version of solitaire dice game.

  • Thank you Ashley

  • I made a whole new plugin.

    Construct Random Color Plugin (versione David Merfield)

    A tiny plugin for generating attractive colors in Construct 3

    Link

    - Link to c3addon

    - Link to the online demo

    - Link to c3p demo

    Short Description

    This plugin is a port from randomColor by David Merfield.

    ACEs

    ONE COLOR

    • Generate a random color
    • getRandomColor
    • getLastColor

    COLOR ARRAY

    • Generate an array of random colors
    • getRandomColorArray
    • getLastRandomColorArray
    • getColorFromLastArray
    • getLengthArrayRandomColor

    SET PROPERTIES

    • Set hue to {0}
    • Set count to {0}
    • Set luminosity to {0}
    • Set seed to {0}
    • Set alpha to {0}
    • Set format to {0}
    • Set properties to hue = {0}, luminosity = {1}, count = {2}, seed = {3}, format = {4}, alpha = {5}
    • Set properties to hue = {0}, luminosity = {1}, count = {2}, seed = {3}, format = {4}, alpha = {5}
    • Set the luminosity to {0}
    • Set the format to {0}

    C3 ARRAY

    • Copy random colors to {0}

    C3 SPRITE

    • Apply last random color to {0} (alpha = {1})
    • Apply color to {0} (Alpha = {1}) from index {2} (last array)

    GET PROPERTIES

    • getPropertyHue
    • getPropertyLuminosity
    • getPropertyCount
    • getPropertySeed
    • getPropertyFormat
    • getPropertyAlpha
  • Added Theme support in c3ide https://piranha305.itch.io/c3ide

    Thank you!

  • piranha305 Avast reports virus: IDP.Generic

    Threat blocked

    We've blocked the threat c3IDE.exe from harming your computer

    Threat name: IDP.Generic

    Process: ...\c3IDE.exe

    Detected by: Behavior Shield

    https://github.com/armandoalonso/c3IDE/issues/34

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • luckyrawatlucky

    Personally I suggest you to use C3IDE. I'm trying it out these days and it makes it very easy to create an addon.

    Just remember to compile the addon before refresh C3. I use Compile on save.

  • Fengist Thank you to have referenced me :)

    nagyv

    I created the two plugins to test my knowledge of javascript. It is for this reason that the examples are related to FreeCodeCamp.

    I created them a while ago. To say, the documentation for SDKDOMInstanceBase was not yet available. As soon as I have some time I plan to update them.

    Given amazing tools like React and Preact, I would prefer to generate my non-canvas related UI code with these tools, have some messaging feature between the DOM and canvas / plugins, and run the (strictly speaking) game with Construct.

    I think that to do this you need a completely different plugin.

  • Flood fill for Tilemaps

    Link:

    Construct 3 Addons

    GitHub

    Actions

    Forest Fire: replace {2} with {3} from ({0},{1})