Zero-Exodus
Pixel Pirate
need to figure out a way to make projectiles penetrate for the duration of a buff, any help would be appreciated
It just sets jumpHeight and jumpSpeed to a hardcoded value in the UpdateJumpHeight method. Considering those are both private and don't have properties, I don't think there's any way of modifying them.
I'm home now an I figured something out:Dont worry, i have a better idea to replace it.
Player.jumpHeight += 5;
Player.jumpSpeed += 2.5F;
Yeah, but people asking here are more than likely to copy them directly, so might as well link to a working example. Not having the save portion would just mean they'll come back complaining later when the effects aren't permanent.Those were illustrative, they weren't meant to be copied directly (otherwise you could extend your max life to infinity).
I'm home now an I figured something out:
jumpHeight and jumpSpeed are both very much accessible, just not from a class instance, but by directly accessing it from the Player class (since they're static variables). Meaning the following works fine for me:
Code:Player.jumpHeight += 5; Player.jumpSpeed += 2.5F;
I just want to point out that for the purposes of tModLoader, statLifeMax should never be modified, and you could create a field in ModPlayer that updates statLifeMax2 every tick.There are two field used for max health modifications, namely statLifeMax and statLifeMax2. Be very sure to use the right one.
How the Life Crystal/Life Fruit works is hard coded, so you can't edit that, but you can make a similar item, which on use modifies statLifeMax.
- statLifeMax is used for permanent health bonuses and is never reset during gameplay, so any modifications are permanent. statLifeMax can (I believe) exceed 500, but will be reset to 500 whenever the player is loaded.
- statLifeMax2 is reset every frame, then set to statLifeMax, so can be used for temporary or conditional modifications (like the Life Force potion). statLifeMax2 can (I believe) be as high as you like, but eventually you should get UI problems.
Example (pseudo-code):
Code:public override bool UseItem(Item item, Player player) { player.statLifeMax += 20; return true; }
You can use an if statement to set limits, for instance statLifeMax < 500.
If you want to increase max HP, you'll have to use statLifeMax2.
Example (pseudo-code):
Code:public override void UpdateEquip(Item item, Player player) { // Don't do this, as it will conflict with Life Force potions or other max life modifications. player.statLifeMax2 = player.statLifeMax + 20; // Do this instead: player.statLifeMax2 = player.statLifeMax2 + 20; // Which is the same as: player.statLifeMax2 += 20; }
The error says it all, there is no NPC called Slime. You have to specifiy GreenSlime, BlueSlime, YellowSlime, etc.
Add && Main.hardMode to the condition.
As of the most recent version that is now public.I cant, because jumpHeight is a private static int, not a public one.
item.width
item.height
Yeah, I had that thought too!I thought private fields couldn't be accessed like that. Either that or I somehow missed a property.
As of the most recent version that is now public.
I tried with that but i get this:I'm home now an I figured something out:
jumpHeight and jumpSpeed are both very much accessible, just not from a class instance, but by directly accessing it from the Player class (since they're static variables). Meaning the following works fine for me:
Code:Player.jumpHeight += 5; Player.jumpSpeed += 2.5F;
The item.width an height only makes the hitbox of the item, npc, projectile....Sorry if this has been asked before, if it has I couldn't find the answer.
What, exactly, does
do?Code:item.width item.height
Copper Ore, as an item, has these values set to 12, while the PNG is (i think) 16 by 16 pixels?
What does the Logs file say?hey, anyone here know what i should do if tmodreader keeps crashing everytime i use it? and if it doesnt crash, it only makes a folder with the mods name
welp, says stuff like deciding to hide it so yeh. thanksWhat does the Logs file say?
The ExampleMod has a Sarcophagus that only spawns in the Desert at any time of day after you beat the Abomination... that doesn't sound like what's happening to you though. What mods do you have right now?Does anyone here knows what mod is there that has a sarcophagus? cause its an annoying monster, I only dealt 1 damage on it and it instant kills me just by touching the enemy and it only appears at night which will make a hard time for me to kill a boss.
If only there's a way for me to identify what mod it is
The ExampleMod has a Sarcophagus that only spawns in the Desert at any time of day after you beat the Abomination... that doesn't sound like what's happening to you though. What mods do you have right now?
OK, I grab it. So I may draw a conclusion that I can't make something like life crystal?There are two field used for max health modifications, namely statLifeMax and statLifeMax2. Be very sure to use the right one.
How the Life Crystal/Life Fruit works is hard coded, so you can't edit that, but you can make a similar item, which on use modifies statLifeMax.
- statLifeMax is used for permanent health bonuses and is never reset during gameplay, so any modifications are permanent. statLifeMax can (I believe) exceed 500, but will be reset to 500 whenever the player is loaded.
- statLifeMax2 is reset every frame, then set to statLifeMax, so can be used for temporary or conditional modifications (like the Life Force potion). statLifeMax2 can (I believe) be as high as you like, but eventually you should get UI problems.
You can still update statLifeMax2 based on a field that your third life crystal type increments.OK, I grab it. So I may draw a conclusion that I can't make something like life crystal?
Originally I'm kinda in the mood for increasing the max life of a player to 800 or something - by allowing players to eat more than just 15 life crystals, or like I'm tryna make, make something like life crystal that spawns over the world and can be gained through some means and can be eaten and increases max life over 500 but also have a limits like 800... basically behaving precisely the same as life crystal. Only it's third type of item that can enhance max life except life crystal and life fruit.
Since statLifeMax has a limit of 500, I think this is, for now, impossible to realize. But using statLifeMax2 is OK with equipment, which I think would be an alternative for my situation.
I still got some ideas in my mind. I'll just go screwing it up myself!
Anyways, appreciate for the detailed reply.
Well, but, isn't it something like buff?You can still update statLifeMax2 based on a field that your third life crystal type increments.
It's only temporary if you make it temporary. All you need to do is update statLifeMax2 in every tick (like in one of the Update hooks in ModPlayer).Well, but, isn't it something like buff?
I mean that I eat it, the effect won't last permanently, right?