Hello everyone,
This is my first post to this particular forum, however, I used to frequent the mapping forums before my time was sucked away from me.
I have recently begun trying to teach myself uscript, and although I am learning, it is a much slower process than I had hoped for.
A former member of my team created code for an assault rifle for a tc/mod we are making, and I have been trying to fix the code for about the last week.
Thanks in great deal to Madnad, I have come extremely close to getting everything working. My only stopping point now is a fire mode.
The weapon in question has three fire modes, single shot, 5 round burst, and full auto. I have been unsuccessful in getting the burst mode to work properly. The closest I have come fires 5 bullets, but at such a high rate of speed that it is more like a shotgun than a automatic weapon. I believe this to be caused by the for loop in my ModeDoFire() function, but I have been unable to find a better way of doing it. I am currently trying to get a tick function to work, but I just don't know how to do what I am trying to do.
My current idea is to enable tick in ModeDoFire() and then fire the bullet in Tick() if deltatime is >= 0.15 (firerate), but I do not know how ot make the bullet fire there, and I'm not sure how MDF() and Tick() interact.
This weapon is supposed to fire 5 rounds per click, and i alreayd have bWaitForRelease = true.
If anyone can point me in the right direction, I would greatly appreciate it. I do not want anyone to write my code for me, but code examples of how to implement this would greatly help.
Thanks in advance to anyone who can help me.
Mike Winters
This is my first post to this particular forum, however, I used to frequent the mapping forums before my time was sucked away from me.
I have recently begun trying to teach myself uscript, and although I am learning, it is a much slower process than I had hoped for.
A former member of my team created code for an assault rifle for a tc/mod we are making, and I have been trying to fix the code for about the last week.
Thanks in great deal to Madnad, I have come extremely close to getting everything working. My only stopping point now is a fire mode.
The weapon in question has three fire modes, single shot, 5 round burst, and full auto. I have been unsuccessful in getting the burst mode to work properly. The closest I have come fires 5 bullets, but at such a high rate of speed that it is more like a shotgun than a automatic weapon. I believe this to be caused by the for loop in my ModeDoFire() function, but I have been unable to find a better way of doing it. I am currently trying to get a tick function to work, but I just don't know how to do what I am trying to do.
My current idea is to enable tick in ModeDoFire() and then fire the bullet in Tick() if deltatime is >= 0.15 (firerate), but I do not know how ot make the bullet fire there, and I'm not sure how MDF() and Tick() interact.
This weapon is supposed to fire 5 rounds per click, and i alreayd have bWaitForRelease = true.
If anyone can point me in the right direction, I would greatly appreciate it. I do not want anyone to write my code for me, but code examples of how to implement this would greatly help.
Thanks in advance to anyone who can help me.
Mike Winters