You're probably looking for this:
Code:public override void Update(ref float gravity, ref float maxFallSpeed) { Lighting.AddLight(item.position, Microsoft.Xna.Framework.Color.AliceBlue.ToVector3()); }
That is working, but not the color that we chose. The lighting is simply white. Doesn't matter if I change colors on the Color method either
public override void Update(ref float gravity, ref float maxFallSpeed)
{
Lighting.AddLight(item.position, 2, 3, 7);
}
In that case, try this:
The color there is more blue than Color.AliceBlue, but it also shouldn't be too bright to discern the color.Code:public override void Update(ref float gravity, ref float maxFallSpeed) { Lighting.AddLight(item.position, 2, 3, 7); }
That does work, but it is far too bright (this whole spot is supposed to be pretty dark)
public override void Update(ref float gravity, ref float maxFallSpeed)
{
Lighting.AddLight(item.position, 0.5f, 0.33f, 1f);
}
In that case, just tune down the color values.
For example:
Code:public override void Update(ref float gravity, ref float maxFallSpeed) { Lighting.AddLight(item.position, 0.5f, 0.33f, 1f); }
If that means when you build a mod it saves as a single file, iether A: dont do that, for those who might want to edit it if its too balanced/unbalanced for them-Make mods build as a single .tmod file that include image resources
If that means when you build a mod it saves as a single file, iether A: dont do that, for those who might want to edit it if its too balanced/unbalanced for them
B: make a "unbuild" or an ingame editor to edit it, this is just if its to balanced/unbalanced for people, or people like me, who like to edit stuff xD
Yeah I figured that.
Do you maybe have any clue how to use
public bool Shoot(Player player, Vector2 position, float speedX, float speedY, int type, int damage, float knockBack)
? My MVS is tripping, lol
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
if(Main.rand.Next(10)==0)
{
//spawn some other projectile
Terraria.Projectile.NewProjectile(position.X, position.Y, speedX, speedY, Terraria.ID.ProjectileID.MoonlordArrow, damage, knockBack, item.owner);
//return false to prevent the weapon from firing it's normal projectile
return false;
}else
if (Main.rand.Next(3) == 0)
{
//modify damage and knockback
damage *= 2;
knockBack *= 2;
//fire an extra arrow
Terraria.Projectile.NewProjectile(position.X, position.Y, speedX + Main.rand.NextFloat()-0.5f, speedY + Main.rand.NextFloat()-0.5f, item.shoot, damage, knockBack, item.owner);
}
//randomize the velocity a bit
speedX *= (1f + Main.rand.NextFloat());
speedY *= (1f + Main.rand.NextFloat());
return true;
}
After some testing, here's an example of what you can do.
Code:public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { if(Main.rand.Next(10)==0) { //spawn some other projectile Terraria.Projectile.NewProjectile(position.X, position.Y, speedX, speedY, Terraria.ID.ProjectileID.MoonlordArrow, damage, knockBack, item.owner); //return false to prevent the weapon from firing it's normal projectile return false; }else if (Main.rand.Next(3) == 0) { //modify damage and knockback damage *= 2; knockBack *= 2; //fire an extra arrow Terraria.Projectile.NewProjectile(position.X, position.Y, speedX + Main.rand.NextFloat()-0.5f, speedY + Main.rand.NextFloat()-0.5f, item.shoot, damage, knockBack, item.owner); } //randomize the velocity a bit speedX *= (1f + Main.rand.NextFloat()); speedY *= (1f + Main.rand.NextFloat()); return true; }
oh, ok, but uh, why does all of the armour sets have a troll set bonus? i knew that ahead of time by trying to check where to craft it and how, i saw "What do you mean? You will keep mod sources as it is, but people can now steal your image files in 'Mods' . If it's all in the tmod file they can't.
oh, ok, but uh, why does all of the armour sets have a troll set bonus? i knew that ahead of time by trying to check where to craft it and how, i saw "
player.setBonus = "trollface.jpg";
player.meleeDamage *= 0.8f;
player.thrownDamage *= 0.8f;
player.rangedDamage *= 0.8f;
player.magicDamage *= 0.8f;
player.minionDamage *= 0.8f;
}"
so yeah, how do i remove this?
i cant get how to remove it, am i just ment to NOT use a helmet? if its an example how do i edit it? if i increase the number my items go to like -453464356 damage and its annoying, if it was a plus it would be more usefull for editors but that just gets annoying how its a trollIt is just an example..
It doesn't seem to work for my weapon (just a standard melee weapon with noMelee=true and it deals magic damage)
when I add item.shoot = 45 it does shoot, but stays in place forever..
Make sure item.shootSpeed is set, the demon sickle won't move otherwise.
You'll have to loop through Main.recipe and check for the IDs for the requiredItem and createItem fields and manually replace the recipes yourself.Is it possible to change recipes of vanilla items?
I might need to add another hook for that. I'll try to get that done next update.Hi, I have a question. I have two accessory how to do so would be wearing when one of them, the other can not wear it?
Hm, alterations to vanilla recipes should be repaired whenever the game reloads; I'll look into that.I made a script to look up the recipe that created the right item.
Built the mod and then checked the log file.
Code:public override void AddRecipes() { int i; for(i=0;i<Main.recipe.Length;i++) { if(Main.recipe[i]!=null&&Main.recipe[i].createItem.type==3601) { ErrorLogger.Log(Main.recipe[i].createItem.name); ErrorLogger.Log(""+i); } } }
Edit:
You can in fact 'remove' a vanilla recipe by replacing it with another and reducing the recipe count.
Code:Main.recipe[1799] = Main.recipe[Recipe.numRecipes - 1]; Recipe.numRecipes --;
A word of caution though, Any alterations to vanilla recipes will not revert upon disabling your mod. You will need to restart Terraria in order for the changes to revert.
Also, when using the above method for deleting recipes additional recipes will be deleted each time you reload the mod. (unless additional steps are taken to prevent it.)
What are you increasing it to? The player damage fields are multipliers, so if you set them too high there will probably be overflow or something. Try setting them to either *= 2f or += 1f.i cant get how to remove it, am i just ment to NOT use a helmet? if its an example how do i edit it? if i increase the number my items go to like -453464356 damage and its annoying, if it was a plus it would be more usefull for editors but that just gets annoying how its a troll
oh ty, i was setting it to like player.meleeDamage *= 99999999999999999.8f; xDWhat are you increasing it to? The player damage fields are multipliers, so if you set them too high there will probably be overflow or something. Try setting them to either *= 2f or += 1f.
Make sure item.shootSpeed is set, the demon sickle won't move otherwise. (although at least some other projectiles do)
I made something like that for someone once but don't remember what it is. Basically what I did was use Main.rand.Next based on the number of possible directions I wanted, multiplied that by the angle increment in radians, then used Math.Cos and Mat.Sin to set the velocities; these could be done from the Shoot method.Do you know if you could also get random directions? (top right bottom left etc)