![]() |
How to shoot? (Formerly "Learning.")
Hey,
I kind of know the really basic stuff but still, I'm new to scripting and I want to learn. I'm trying to script a simple weapon that throw anything. I first try to just throw an arrow, but the only thing I have is a shadow flying forward. If anyone can help me, I'd really like to know how exactly the functions work and where to put what in the parameters. Let's say I want my character to throw shuriken.png? I have few mores questions after this one is solve, I'll just post them after that one. Thanks by the way for the help! |
Not sure what you're asking for, but I think you're trying to use shoot(), which is described here: http://wiki.graal.us/shoot
You can change the projectile's image in the last parameter: PHP Code:
|
Thanks, that's working.
Now, I did a new projectile called val_shuriken.png and a new gani called temp_shuri.gani. I've replaced "arrow" and "barrow0.png" but I guess I'm doing something wrong because now there's nothing shooting at all. NPC Code://#CLIENTSIDE |
post the gani please :)
|
2 Attachment(s)
I just made all those thing kind of fast just to test the script.
The Shuriken: Attachment 50548 The Gani : Attachment 50547 |
Quote:
Let me try to explain shoot a little bit better: level.shoot(start x, start y, start z, direction of shot, z-angle, strength, gani, gani params); By editing strength, you can specify strength based on the gravity settings for your server/client, increasing strength increases speed of the shot. By changing z-angle you can make your shot arch in the air using some trigonometric math. If you want to change your gravity, you can simply do gavity=5 (for example), which is a global variable. If you change it on the clientside, it will only affect that person's gravity, but if you change it serverside, it will affect the whole server. If you change your gravity high enough, shots will fly over walls, etc. Quote:
|
Thanks, I really appreciate your explanations. But, when I use the weapon, nothing is shooting. The player freeze and play the ani "shoot" but there no projectile. I don't understand why it doesn't just shoot that shuriken lol.
|
Quote:
PHP Code:
|
Yes it's working. But when I put my custom gani and image, it doesn't. Probably something with the gani I did wrong.
|
Quote:
|
1 Attachment(s)
I updated the gani with the PARAM1 thing, but not sure I did it well. Here's the new one.
Attachment 50549 Maybe with the upload... I've put the .gani in levels/ganis/, is that ok? Or it has to be in another specific folder? |
1 Attachment(s)
Quote:
If you're unsure, you can still check the folder configuration Attachment 50550 You should have things like this: file *.gani and file ganis/*.gani |
Quote:
|
Thanks for your help! I made an error when writing the rights, so it wasn't able to detect the gani. So now, it throw the "shuriken" but after like half a second, the shuriken disappears and there's only the shadow left. When I tried with the "arrow.gani" the arrow was there all the time, and my gani is exactly the same, except it's single direction. Is there something I have to do with the gani to keep it visible when throwing it?
EDIT: Sorry, found my mistake. ;) It just worked all fine. Thanks a lot for all your help. It really helped me understand all that stuff lol. :) |
| All times are GMT +2. The time now is 01:36 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.