Proxymity's Forum Posts

  • So there is more then one player? And they call the same function ?

    Currently Im planning only 1 vs 1 combats (player vs. AI (PvE) and later Ill do an "arena-like" multiplayer (PvP)). Both players - or player and AI - will have access to the same "atack-process"; in other words there is only 1 routine for both. The "attack preparation" will be the same for both; the function called after "attack preparation" which shows the animations will have several if-clauses for identifying which player/AI got which hero and which animation (and set movement) has to be shown. Ild like to hold the source slim and compact, thats why.

    (The long version:)

    I thought, making a single "attack"-routine would be the easiest way to get this done, regarding that there will be several protagonists/anthagonists/whatever which will be doing exactly the same (regardeless of the animations, attackspeeds, etc. they got). The game will have its focus on stats/combats. I want to make it possible for (for example in PvP) a new player who doesnt really got good equipment to win against a player who already spend several hours in the game if he plays "better" (meaning: countering/bloking/studying the opponent). If you know the game (series) "Lost Souls"/"Dark Souls" - thats what I took as a "reference" in complexity and gameplay (yes, its nearly impossible to port such a milestone in gaming history into a mobile game, but Im not doing a clone - Im focussing on its complexity about what you can do with your hero/character).

    Magistross: just got home from work, tested it - and it works perfectly! Once again: thanks!

  • How sure are you that the function wil not get called again in the time that the wait action waits + the time that the delayed actions excute ?

    Up to 100% the "attack" process can only be active 1 time for each player; if cooldown=true (or "1".. no bools as global vars :/ ) then you wont be able to attack a second time. Cooldown will switch back to 0 (false) when the whole attacking process and returning to "starting position" is finished.

  • Hi Skvor,

    this may help you out: https://www.scirra.com/tutorials/4981/s ... den-player

    You have to change the z-ordering for your player. With that tutorial you may cover up all your questions; instead of showing the silhouette (if you dont want to), just leave that art blanc.

    This could also help you out: viewtopic.php?f=147&t=129745&p=969922&hilit=ordering+isometric#p969922 (ignore that its about isometrics; its z-ordering what you'll need).

    Have a great day,

    Proxy

  • Look at this.

    https://

    drive.google.com/open?id=0B1SSuCVV8v74OTB4V2Foc21KWW8

    Do you know what it wil do before you run it ?

    Thanks for your thoughts and example

    The LiteTween behavior does easings ( . But in my project its just a placeholder for the "real animations" that Im going to make when the backend (the important stuff) is done.

    The reason to have waits at the moment is: once an attack started, the attacking player "runs" to the attacked one (time needed for that should decrease with stats and increase with the equipment worn (platemail is heavy, this will have a high impact on your movement speed; cloth-armor will have no effect on your movement speed)), then the attack is done (damage will be modified if attacked player blocks on the right moment (different shields or different spells will give you a X,X seconds blocking"time", in which blocking is "true")).

    I planned to realize this with timers - at least the part with movement/attacking speed.

    Also thanks Magistross, your example is great. That should do the job!

    Wondering that no one else ran into this on the forums... is it a C2 issue or a JS problem in general? With some other scripting languages I never had issues with params in functions, even when infi-giving them through.

  • After a function (with params) calls an another function (handing over the params) which also calls another function (with handing over too), the params are getting lost somewhere:

    eCombatMath_Attack (at the bottom) returns Param0 as 0, Param1 as 0, Param2 as 0 - should be (0)=1,(1)=1,(2)=5 here... the local vars are from the last test I did. After the "OwnedBy=Param0" everything is getting lost - the animation stuff is shown correctly, but then its messed up.. someone knows what Im doing wrong?

    #Edit:

    Ok, the wait-action is messing it up (even when I set both timers to "SprProtagonist.LiteTween.Duration")... someone knows a workarround for that? Forum search didnt returned anything usable :/

  • It depends a lot on the scope of your system. Will it be used generically for a variable amount of entities or will it be more static ? If it's static, go ahead with arrays and vars. Otherwise, it'll be easier to propagate the arguments function to function.

    Thanks again for your answer Magistross!

    Hmm... on which point you could say "static"? The first function is called with ~3-4 params (which wont change during the whole process; containing the source (player-number), attacking type, attacking duration (influenced by stats and needed to calculate the duration of animations), etc..); all other informations are gathered through the family instancevariables (or name of animations of sprites or X and/or Y coordinates from objects). The whole functions-process can be called (max.) 2 times parallel (if both players attack the same time). Think Ill hand over the params from func to func.

    Have a great day,

    Proxy

  • Deferring function calls isn't really done that way. You would probably be better off using callback functions than return values. By the time line 4 of your second screenshot gets evaluated, the function isn't over, and it won't wait to evaluate, so "ReturnValue" will evaluate to "" (or the last returned value). Instead of line < Set return value to "Return" > in your last screenshot, call another function, like "eAni_DummyAttackFinished". This particular function will signal that the animation is done, and you can continue with the rest of your logic.

    Thanks Magistross!

    You just confirmed my thoughts about the way I "wrote" that. Then I think, Im going on plan B, making a few more functions for the process.

    may you can answer me the wiser way: calling the first function with all needed parameters for all following functions (like who attacks and what kind of attack is done) and handing them over from function to function untill the main process of attacking is done or putting them into vars (or storing them in an array)? Not quite sure what would result in a higher cpu-usage (even if its not worth mentioning those few bytes ).

    It is the first time that I deal with the logic for a dynamic combat system.. but Im optimistic, we'll be friends (somewhen ).

    Have a great day,

    Proxy

  • Hi guys,

    Im stuck here:

    When event is triggered (pressing the attack button, for example), the function "eCombatMath_Attack" is called. When this function is activated, it triggers an another function ("eAnimations_DummyAttack") which contains the "start attack" animations. After "start attack" is finished it returns a value to the "eCombatMath_Attack" function, so that the first function knows when to continue. If animation is over and ReturnValue is delivered, this function will check if event is true or false (for example: blocking) and then it will continue; after dealing the damage, it calls an 3th function ("eAnimations_DummyPositioning").

    In short:

    Press button > call calculation > show animation > if attacked player successfully blocks, then lower the maximum damage; if not, deal damage > show animation where player gets back to his starting position > idle

    My problem is:

    The function eigther doesnt return a value, or the first function doesnt wait for the ReturnValue of the second (wasnt able to debug that >.>).

    Background:

    Im trying to minimize the usage of variables (everything, whats possible at least, is contained in several arrays... 3x3D arrays are totally enough at this moment) and would like to only have multiusable functions (1 single function for combat attack maths for all kinds of attacks, 1 routine for all kind of player-/enemy-animations, unregarding which skin/individual animations they got, etc...). The aim is reaching a "lightweight" source and minimize CPU traffic.

    Is that even possible (returning something from a function to an earlier triggered function which continues running)?

    Bonus:

    Yes, multiple questions in one suck, but I dont want to make an another topic for this... - did someone of you already make such "combatsystem" and has tips for me? Or are my thoughts bullsh*t about how the system works | got an better solution for this/has a link/site/wiki for me where I could improove the whole process | encountered the same problem | has an idea how to make this code more "elegant"?

    Heres the code (sorry for not providing the *.capx, but I dont want to publish the whole source from this project ):

    (1) How the function is triggered (that you know where the params came from. (Arrays Y values: 9=current stamina; 11=cost for attack-type | checks if attack can be performed)

    (2) This is the "eCombatMath_Attack" function which triggers the animations (Math should be done here, Animations should be done there) and waits for the ReturnValue to continue

    (3) This is the "eAnimations_DummyAttack" function which is triggered from the previous function and should return value to the previous one after finishing

    The "eAnimations_DummyPositioning" function isnt implemented yet - first I need a solution for this question

    If anything is unclear, please ask... I really need a way to get this done :/

    Have a great day,

    Proxy

  • Kyatric

    Hi Kyatric,

    would you mind updating the plugin (once again)?

    Ive thrown an eye on this long ago - and now it comes to the point where hashs come in handy... and it doesnt work on the current C2 version :S

  • Try Construct 3

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

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

    getting this when opening:

    Edit:

    Got the EncDec.zip from http://290px.com/plugins/EncDec.zip

  • Hi Tinimations,

    accidentally deleting the localstorage is like accidentally eating your keys (for me, at least ).

    Is the app opened the whole time? If yes (and also no), may use the browser object; store your mailing list into an array and make two buttons for downloading that array locally on your device as file. Before opening the app, navigate into your filesystem, search the file, open as text and copy the whole thing; after opening the app, paste the clipboard into a textbox and import into array. May be a bit unhandy, but Ild describe this as 100% failsafe.

    Anyway, a localstorage should be totally enough. Since PAX doesnt go 3 weeks, I dont think that you have to worry about clearing the storage (- or you got an Crapple product and.. well... then dont use the localstorage ).

    Best regards and a nice monday,

    Proxy

  • Shouldnt this be the right demo: http://kingdomofnpc.x10.mx/app/nwelogin/ ? ;D

    Strange thing is, you can register the same username several times; but when logging in only the first registration is able to recieve a token. A check for an existing username in your table would be cool when trying to register the same name multiple times. For checking if you are the right one trying to log in, its needed to check token =/= "" in this case - but a nice work; will get it for the token stuff and implement it into my script <img src="{SMILIES_PATH}/icon_e_wink.gif" alt=";-)" title="Wink">

    Regards,

    Proxy

  • A demo would be cool

  • Hi guys,

    somehow I have problems with the syntax (I think ).

    As far as I read through the several tutorials and manuals, I couldnt figured out how to remotly run a function (in other words: noone said, it isnt possible - thats why Im asking).

    I got a host and x peers, when triggering event, I wanted to send a message to hostID with tag "Function1" and containing message:

    Function.Call("Read_Array", "Refresh_Database")[/code:17lxt3hu]
    Read_Array = name of function; "Refresh_Database" should be Param(0).
    
    Dont have the link where I got that, but is this even possible, directly running a function (with parameters) out of a sent message? Or do the host needs a
    [code:17lxt3hu]Multiplayer | On peer message "Tag"[/code:17lxt3hu]
    and it is not possible in any way to shorten/bypass that?
    
    Also, if it would be possible, doing so, what about callbacks?
    
    This would really shorten the source... Im making a database (documentation) app (host got all created/available arrays, clients are able to add/modify/delete rows of specified arrays (depending on their rw rights for each array)).
    
    Best regards,
    Proxy
  • korbaach Thanks (again)!

    I rather thought about a simple "quick and dirty" method... still cant believe, that theres no tabulator option for texts.

    I already found a great plugin: which does pretty much, what a Listbox should do.

    But your 2 *.capxs will help me out later in the project.

    Have a great weekend,

    Proxy