PhlAi's Recent Forum Activity

  • Ok now i understand - so, it would work if i set my text in function1 and set its size in function2? Firing another function would represent a tick i guess... !?

  • It's not a problem updating fast or slow its size... As I call a function to handle the tooltip behaviour and nothing else is working in the background things should update just in time.

    But, for now, it works. I solved the problem! I added the max amount of affixes into my array as a pre-given information, stored this into a local variable and reused this in a multiplication to determine my tooltips size...

    Pics:

    Zero-Information

    directupload.net/file/d/3973/as8m2b9v_png.htm

    One Information

    directupload.net/file/d/3973/ulqupdb4_png.htm

    Two Informations

    directupload.net/file/d/3973/nnyzlhjg_png.htm

    So my Tooltip will adjust its size depending on its content. Looks ugly but this will be improved later

    Thanks to all!

  • Sure this is a possible way I used in other projects but seems to take double time in work to get the same result for visuals. IF my idea would work, it would be a very lightweight piece of code in comparsion to use instance variables, adress each and ask each instance variable which kind of content it has aslong as I do not know how to loop through instance variables. Even an instance variable can only have one information while an array gives the possibility to store more than one information while using "Z" properly.

    So this is what I got so far:

    directupload.net/file/d/3973/yoxf2zjh_png.htm

    Here u can see the problem:

    directupload.net/file/d/3973/5tz9ne9n_png.htm

    The Textbox should adjust its size according to its content but I can't get this working properly ^^ Everything else works fine.

  • Hey,

    yeah i guess i did it the way u wrote. ...

    Each X represents its Itemslot in my Inventory. Each Y contains different informations for this item. Actually there are 27 different informations like name, icon, type, infotext, affix1, affix2, affix3 ...

    What I actually wanted to do is, for example, give my items some unique and non unique effects (Affix). For example, I have a sword which should have some kind of damage, attackspeed and probably mainstat. So, these informations are stored into an array at Y=Affix1, Affix2, Affix3 - to determine its range, for each Affix, i have to use "Z" because I will give the player the ability to change an items affix. This means Y=Affix1 can be, f.e., "Damage" but it could also be "Attackspeed" or "Melee Range" or even nothing at all. BUT - this is not the problem. The issue I have is, I wanna show the player an items affix within only one textbox and only want to use one tooltip for each item. This means, my tooltip script and its visual content should update and adjust itself on its own.

    Another Example:

    1. There is a Sword - my Mousecourse is overlapping this sword - my tooltip appears - it shows name, type, damage, affixes and some text.

    2. Then I drag my cursor over another item which is a "Key"

    3. So now I wanna use the same script for my tooltip which figures out: "Oh hell yeah, there are no affixes on this item, just name and type.

    4. Now, my scripts should look up Y=Affix1, Y=Affix2 (...) and recognize: "Ok really, all is "0", I dont need to append its content"

    5. This finally should end up in scaling up and down my tooltips content from zero to a perfect fitting size and automatically "exclude" all unnecessary information I do not need.

    So, finally, the problem is - u see my screenshot and my code - I ask for each possible affix: " ainventory.at( X=InventorySlot, Y=AffixLocation0-2, Z=0) NOT EQUAL 0 ". If it isn't Zero, I add 1 to a variable which should sum up the total affixes the item has. But always I get a total of 3 affixes my script sums up even if my comparison IS EQUAL 0, he adds 1 to my variable. And I use this variable to determine my textbox height. 0 Affixes should end up textbox.facesize*Variable=0...

    Here is a screenshot of my non scripted tooltip: directupload.net/file/d/3973/aituctbr_png.htm

    Here one of a screenshot while playing: directupload.net/file/d/3973/gh954gda_png.htm

    You can see, there is Attack, Attackspeed, 3, 4, 5, ... , but u should only see Attack, Attackspeed...

    ----

    Ok, you are right, its really confusing not having the code and reading this stuff but hope never dies i guess

  • Thanks for ur quick reply - so, im going to figure out whats going wrong on my own unless my capx contains unique graphics im not allowed to share due to copyrights...

  • Hey Dudes,

    need some help for dev a tooltip script equal to tooltips in games like diablo, poe or other rpgs.

    First some details.

    I store my Items in an array called "ainventory"

    Each Item data like affix, values, name (...) is stored in this array as "y", the index is "x"

    the item affix values like min. dmg or max. dmg is stored into its affix "y" as "z1", "z2", ...

    Now I want to show the items affix as a tooltip in a self adjusting textbox.

    So I created a function to:

    1. ask how many affix my item has (max_affix)

    2. loop at the correct "x", "y + curY", "z0-2"

    3. while looping append ainventory.curvalue into my textbox

    4. set textbox.height ---> textbox.facesize*max_affix

    pic-upload.de/view-26856468/tooltip.png.html

    So, it works very well but i can not determin the correct value how many affix my item has. It can have 3 but has only zero to 2 but i always get a max_affix result of 3. So my Textbox wont self adjust its size correctly, which means its size wont be zero if it isn't needed at all. If someone has an idea to fix my script i would be glad And sorry for my bad english =)

  • Hi there,

    I Just try to create Items by reading an array, put all possible items into another array and pick randomly one of these items to generate a sprite which inherits all necessary informations.

    Actually, I can't figure out how to copy whole and specific rows/columns from one array to another.

    • I use excel to create my tables
    • Convert to csv (rex excel2csv)
    • Import with "rex csv2array" (Rows:Y / Cols:X)
    • Call a function "fnParam1=ceil(random(0,101))"
    • Start Loop "For Each XY"
    • Compare X=1, Y=Current, Value=fnParam(0)
    • Push Front current.Y into new array on y-axis

    Some Pictures to understand more clear...

    All I actually got is nothing more than being confused ... ^^

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Oh yeah u are right ... I missed this to change - but due to testing I took two other enemies with kinda more complex events... Whatever

    Things seem to work - somehow ... Some things do work, some do not - for example - I cant assigne State Effects like being Freezed to every Enemy - almost instance#0 wont take advantage of this while other instances are freezed. And, if those instances aren't freezed anymore I can freeze #0 but now, an instance other than #0 wont take effect of its state being changed. But the whole movement and shooting and whatever works properly, as far as I can debug right now.

    But still - after this rework, I gonna pick correct instances I guess. Now I gonna figure out what the state change problem is - as I can exclude my freakin' instance picking as an option of being terribly wrong... like my english haha

    If someone has an idea why I got this problem assigning several state effects to enemies ... you are welcome?

    But - so far - thanks a lot for ur help

  • Thank you for ur fast reply

    I changed some things due to ur hint. ... I also added 2 more Enemies inside the event for testing purposes just the way I added the "Jumper".

    Seems to work but I didn't test it for long nor in depth.

    Am I using those "For each" correctly as a upper level event and seperate each enemy by name in a subevent without any following "ForEach"... ? Is this a common way to call AI and adress to the correct foe? Isn't it easier or maybe more stable to pick each Enemy by its own UID ? And if - do I have to pick by comparsion comparing the UID I insert while "Enemies - OnCreated" or is there a more common way?

  • Hi there,

    I have some issues creating multiple enemies of same type reacting different for each...

    I read the forum topics for days and hours - same thing happend to the manual but i couldn't really find an answer for my problem. At least - it's all about the "ForEach" Condition, isn't it?

    I wanna explain short.

    Each enemy is a sprite. Each enemy sprite is assigned to the Family "Enemies". The Family "Enemies" has different Variables and Behaviors set. Each Enemy, as a child of Family "Enemies", will earn these Var. and Behaviors. Each Enemy within the Family is triggered by different AI Code in the same way I attached to this post.

    For now, every Enemy will move independently and Health will be calculated correctly, as far as I can see... But, for example, I have some effects assigned to the Family "Enemies" which are triggered on collision with my players bullet which almost works too but sometimes the enemies wont react correctly. Almost the Enemys Instance #0 doesn't react properly. Although, I have 4 Types of the same Enemy on screen - 3 of them die - 1 stays alive but won't react in any way.

    For sure I tested a thousand ways last days and watched each Enemys reaction due to each change I made within my coding stuff... Now, I'm really really confused about what to pick, when to pick, where to pick - nick ... Pls tell me, if someone know - what am I doing right - where are things going to be wrong...

    Cheas

  • So ... I tried out this Vector X Y thing. It works great for me - thanks again. Further adjustments but still fits perfectly.

    --- Attachment ---

    Often I used to look for such things - I found a lot of questions - less answers. So I attached my solution in case somebody will find it helpful.

    As u will see - I took a boolean var. "Timer_OnHit" as a condition and to reset Player Platform Movement. This is not really necessary - like the "Stat_Freeze" boolean (which I use to make my enemies feel real cold...) or the "Physics_PlayerOnCollision". I use this to toggle physic simulation independently for each enemy. But - u have to reset ur Platform Movement.

    -

    If u keep it the way it is --> add:

    Player ---> On Timer "OnHit" ---> Set Player.BooleanVar.Timer_OnHit ---> False

    If u wanna remove unnecessary things ---> add:

    Player ---> On Timer "OnHit" ---> Set Player.Platform ---> Stop Ignoring Input

    Cheas

  • This is exactly what I ment ... But now I know things won't work as expected. Thanks for this little wake up call (and sorry for my bad english )

    I not really need the physics - I just thought it would be an easy to use and ready to use feature to polish my (maybe ur) gameing experience... Never worked with those Vector Motion Things - i gonna figure out which method fits best for my programming skills and feels the way I imagine.

    Thanks a lot Dude

PhlAi's avatar

PhlAi

Member since 27 Nov, 2014

None one is following PhlAi yet!

Trophy Case

  • 9-Year Club
  • Email Verified

Progress

10/44
How to earn trophies