Custom meditation - Printable Version +- SphereCommunity (https://forum.spherecommunity.net) +-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d) +--- Forum: Script Help (/Forum-Script-Help) +--- Thread: Custom meditation (/Thread-Custom-meditation) |
Custom meditation - Leonidas - 09-24-2013 06:14 PM Hello, I'm trying to make my meditation so it will instantly increase mana when the skill starts, instead of it gradually increasing. I have a little bit so far, I'm just stumped on how to make it so the higher the meditation skill, the more mana you get. Here's what I have so far, don't laugh Quote:[SKILL 46] RE: Custom meditation - XuN - 09-24-2013 06:28 PM <VAR.MEDITATION>, is that created in another place? You can try to change that line for this one: src.mana=<src.mana>+<src.f_GetManaFromMedit> and add this function above: Code: [Function f_GetManaFromMedit] Edit: You may also want to add this check after mana regeneration. Code: IF (<mana>><int>) RE: Custom meditation - Rattlehead - 09-24-2013 07:56 PM and, dont use VAR's, you have locals, u have tags, ctags, etc etc, dont use VAR's, not only are they a bit resource consuming, but they are global as well, which could interfere with someone else using meditation in the same time frame. RE: Custom meditation - RanXerox - 09-25-2013 09:00 AM To be clear, there is no difference between a VAR, a LOCAL, or CTAG, or a TAG when it comes to resources like memory etc. Here is an alternate version of your @Start trigger that checks a CTAG (Character TAG) to decide if enough time has passed instead of creating a new memory object with a ticking timer (which does consume quite a bit of resources unnecesarily.) I also fixed some other issues: * use two == in an IF statement, not just one = sign... in your case, just combine the greater than and the equals into one conditional test * put the successful result (the addition of extra mana) in the @Success trigger instead instantly granting it when the skill is first attempted Code: ON=@start Alternatively, instead of forcing it like this, you could instead temporarily alter the player's RATE of Mana regeneration (by adding/increasing TAG.OVERRIDE.REGEN_1 to them) or the AMOUNT of Mana regenerated (by adding/increasing TAG.OVERRIDE.REGENVAL_1 to them). RE: Custom meditation - Rattlehead - 09-25-2013 03:44 PM i was told back in the day that since a var is global its always loaded, where a tag on a char is only loaded when called. this is what makes them consume more resource than a tag. i may be mistaken but, the var is global, so if it changes for one, it changes for all, if 2+ ppl are meding at the same time and both are supposed to have a different rate, they will end up interfering with themselves giving the wrong character the other characters rate. should make a tag at creation, and it will be there for you to update with w/e trigger u need to, and read from w/e script you got. |