colinavvv
Terrarian
I am trying to figure out how to make a bouncing projectile. I figured some of it out thanks to the example mod, but how do I get the projectile to bounce only once, and does not penetrate enemies?
chavis54
Terrarian
Yes. The forum rules prevent me from distributing mod executables that remove the Steam checks, so the only way I can distribute a GOG version would be through a diff patch. However, creating a diff patch requires that I have the vanilla GOG version myself, which requires me to buy it.
oh man, well I guess that's that. Thanks for letting me know
Starblaster11
Golem
Oh cool, hooks for hooks!sneak peak of something from v0.7:
View attachment 84788
Same as a buff, except "Main.debuff[this.type] = true"how do I make a debuff??
Try something like: Setdefaults set ai[0] to 1, ontilecollide bounce if ai[0]>0 and set ai[0] to 0, else explode. Leave penetrate to 1.I am trying to figure out how to make a bouncing projectile. I figured some of it out thanks to the example mod, but how do I get the projectile to bounce only once, and does not penetrate enemies?
OnTileCOllide velocity *= 0.How can I get a projectile to stick to a block, like how a sticky bomb or glowstick would work.
Trekko727
Terrarian
I'm sure you didnt open Internet Explorer right?My mod browser isn't showing anything, and it was working a few days ago, what happened?
LordVGames
Skeletron Prime
Which version of tModLoader is compatible with Terraria 1.3.0.5?
colinavvv
Terrarian
Code:
if (projectile.ai[0] <= 1)
{
if (projectile.velocity.X != oldVelocity.X)
{
projectile.velocity.X = -oldVelocity.X;
}
if (projectile.velocity.Y != oldVelocity.Y)
{
projectile.velocity.Y = -oldVelocity.Y;
}
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10);
projectile.ai[0] = 0;
}
else
{
projectile.Kill();
}
return false;
}
}
}
Having Problems. Only bounces if I aim it directly at the ground
Is ai[0] being used for other things? Is it being set in a shoot method? Did you write all the AI code, or is this based off something else? You might have to use a different approach if all the ai floats are already used by the ai. You could also just have the onhitnpc method kill the projectile and forget about ai[0].Having Problems. Only bounces if I aim it directly at the ground
None specifically, but from the changelogs, I don't think any new items were added since then. Just try it with the latest. Anyway....why don't you just upgrade? Bug fixes are good.Which version of tModLoader is compatible with Terraria 1.3.0.5?
colinavvv
Terrarian
Sounds easy enough.You could also just have the onhitnpc method kill the projectile and forget about ai[0].
And it works! Thank you!
Last edited:
Looking through the version history, it looks like v0.1.1 is compatible with Terraria 1.3.0.5. I... really, really, really would not recommend using that version though. The only things that exist in that version are custom recipes and ModItem.SetDefaults. Like jopojelly said above, I'd recommend just using the latest versions for everything.Which version of tModLoader is compatible with Terraria 1.3.0.5?
dinidini4000
Skeletron Prime
c:\Users\dinidini\Documents\My Games\Terraria\ModLoader\Mod Sources\ExampleMod v0.6\Mod Sources\DependentMod\Items\DependentModItem.cs (6,7): error CS0246: The type or namespace name 'BadUtils' was not found (lacking a 'using' Directive or assemblyreference?)
any idea as i been looking all over no videos on how to make a mod no info on what the dll file are for or where to put it all i did was move the ExampleMod v0.6 from the
Zip file over to mod sources and it gave me that error
if the ExampleMod does not work whats the point for it as i can download mods from the ingame menu but cant edit em as they are in tmod files no idea how to open them
so i get no info on how to make a mod from start
any idea as i been looking all over no videos on how to make a mod no info on what the dll file are for or where to put it all i did was move the ExampleMod v0.6 from the
Zip file over to mod sources and it gave me that error
if the ExampleMod does not work whats the point for it as i can download mods from the ingame menu but cant edit em as they are in tmod files no idea how to open them
so i get no info on how to make a mod from start
The point is that it works, you just did things wrong.c:\Users\dinidini\Documents\My Games\Terraria\ModLoader\Mod Sources\ExampleMod v0.6\Mod Sources\DependentMod\Items\DependentModItem.cs (6,7): error CS0246: The type or namespace name 'BadUtils' was not found (lacking a 'using' Directive or assemblyreference?)
any idea as i been looking all over no videos on how to make a mod no info on what the dll file are for or where to put it all i did was move the ExampleMod v0.6 from the
Zip file over to mod sources and it gave me that error
if the ExampleMod does not work whats the point for it as i can download mods from the ingame menu but cant edit em as they are in tmod files no idea how to open them
so i get no info on how to make a mod from start
You're supposed to copy everything in the donwload's Mod Sources folder into your own Mod Sources folder, and everything in the download's dllReferences folder into your own dllReferences folder. Your own folders should be found inside the ModLoader folder, which is inside the Terraria folder.
dinidini4000
Skeletron Prime
The point is that it works, you just did things wrong.
You're supposed to copy everything in the donwload's Mod Sources folder into your own Mod Sources folder, and everything in the download's dllReferences folder into your own dllReferences folder. Your own folders should be found inside the ModLoader folder, which is inside the Terraria folder.
this is why its nice to get some video help on it or some text help to where these files are put
Trekko727
Terrarian
I'm gonna start simple with my mod so I'll make a throwing / slashing knife instead.
what references in VS should I add? (theres no terraria tmodloader)
EDIT:
is this part of code ok?
I just wanted to -8 defense from total defense. (not accumulative)
EDIT: I build and reloaded the mod. I cant seem to craft it even with the necessary materials (Dirt Block) and tiles (Work Bench)
what references in VS should I add? (theres no terraria tmodloader)
EDIT:
is this part of code ok?
Code:
public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
{
target.defense -= 8;
}
EDIT: I build and reloaded the mod. I cant seem to craft it even with the necessary materials (Dirt Block) and tiles (Work Bench)
Last edited:
dinidini4000
Skeletron Prime
i been trying to read the drop file where it drops the exampleitem from all mobs but is there a way to change it to only drop at like a 10% chance and not 100% all the time
Eldrazi
Eater of Worlds
Yeah, you just have to do a check first. Something that looks a bit like this:i been trying to read the drop file where it drops the exampleitem from all mobs but is there a way to change it to only drop at like a 10% chance and not 100% all the time
Code:
if(Main.rand.Next(0, 10) == 0)
{
Item.NewItem(bladiebla); // The rest of your drop function.
}
Charon
Spazmatism
I am very annoyed by something that keeps happening to me. An error that says the system is out of memory as an exception happens every time I reload+build my mod for a second time while the program is open.
Marc40k
Terrarian
Thanks for reporting. We'll remove it, and since we have the Steam names for everyone who uploads mods we'll try to see if we can stop that user from uploading that mod.
@jopojelly
What about the mods that didn't get updated in the forums but they did in the mod browser?
dinidini4000
Skeletron Prime
Yeah, you just have to do a check first. Something that looks a bit like this:
This 'if' statement will take a random value ranging from 0 to 9 (I know it says 10, but that number is not taken into account) and checks it against 0. So this will have a 1 out of 10 change to return true, thus allowing the code inside the if statement to execute.Code:if(Main.rand.Next(0, 10) == 0) { Item.NewItem(bladiebla); // The rest of your drop function. }
i found that code in one of the sample mobs but how do i add that with the code that was there to start with as without it the items drop from animals and bosses to
Eldrazi
Eater of Worlds
Uhm... I'm not quite sure what your goal is here, could you explain in more detail?i found that code in one of the sample mobs but how do i add that with the code that was there to start with as without it the items drop from animals and bosses to
Similar threads
- Replies
- 40
- Views
- 23K
- Replies
- 5
- Views
- 1K
- Replies
- 893
- Views
- 891K
- Replies
- 0
- Views
- 480
- Sticky
- Replies
- 270
- Views
- 263K
-
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.