Welcome, Guest. Please login or register.

What openbor you prefer: Double dragon,battletoads or final fight !? by lirexpatrio
[December 07, 2012, 07:15:27 pm]


what are your favorite games OpenBOR?! by lirexpatrio
[December 07, 2012, 07:09:46 pm]


Post Some Awesome Videos by maxman
[December 07, 2012, 05:51:39 pm]


Can @cmd playmusic "aaaa" 1 also increse music sound ? by BeasTie
[December 07, 2012, 05:24:38 pm]


Streets of Rage: Silent Storm by mtrain
[December 07, 2012, 03:45:05 pm]


Site will be down for maintenance on 12/8/2012 thru 12/10/2012 by Damon Caskey
[December 07, 2012, 07:42:42 am]


Cancelled SOR 3d Remake by riccochet
[December 07, 2012, 03:58:33 am]


Dungeon Fighter: B.O.R. by msmalik681
[December 07, 2012, 03:24:27 am]


[TUTORIAL] How to create 4 Games of OpenBOR in 1 CD (650 MB) by magggas
[December 06, 2012, 09:46:25 pm]


custknife by Bloodbane
[December 06, 2012, 09:34:09 pm]


blockfx help by B.Kardi
[December 06, 2012, 04:09:14 pm]


street of age 4 hd by corradlo
[December 06, 2012, 01:41:36 pm]


ClaFan - Classic Fantasy ver 1.17 by soniczxblade
[December 06, 2012, 05:01:20 am]


Bug Archive by Bloodbane
[December 06, 2012, 02:00:44 am]


"Bio-Doom" and "Gears of Doom" by BulletBob
[December 05, 2012, 10:07:21 pm]


Contra Locked 'N' Loaded v2 by Bloodbane
[December 05, 2012, 09:39:43 pm]


Downloadable OpenBoR Manual by BeasTie
[December 05, 2012, 08:31:24 pm]


Having trouble testing changes by B.Kardi
[December 05, 2012, 03:05:53 pm]


DragonBall Absalon by msmalik681
[December 05, 2012, 02:52:13 pm]


[Hi-Res] Swamp by Vibrant
[December 05, 2012, 10:47:14 am]


  • Dot Guests: 167
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.



Author Topic: Get ammo count for weapon via script?  (Read 608 times)

0 Members and 1 Guest are viewing this topic.

Offline MatMan

  • Hero Member
  • *****
  • Posts: 1320
Get ammo count for weapon via script?
« on: June 08, 2012, 03:08:18 pm »
Is there a way to get the current or indexed weapons bullet count via script?

I know that getplayerproperty(playerindex, "weaponum"); get's the active weapon but i can't seem to find any other script functions for weapons, is there any other script functions for weapons?

Offline utunnels

  • Developer
  • Hero Member
  • *****
  • Posts: 2713
Re: Get ammo count for weapon via script?
« Reply #1 on: June 08, 2012, 09:55:08 pm »
According to old openbor logic, ammo count is stored in weapon item.
For example, if you pick up a gun, the item will be moved outside the screen until you drop it in the future.

If you don't have a weapon entity, you don't have ammo logic. The ammo count is currently not available, nor weaponnum.

But since you are using scripted weapon system, you can just use your own counters, because you can get your model name using getentityproperty(ent, "model").

Offline Bloodbane

  • Hero Member
  • *****
  • Posts: 7113
  • Dark Dragon
Re: Get ammo count for weapon via script?
« Reply #2 on: June 10, 2012, 01:39:02 am »
 Wait a second, are you saying there's no way with script to find if player is using weapon or not?
OpenBoR Manual

Basic OpenBoR Tutorials

OpenBoR Tricks & Tutorials

"The more often enemies attack, the more open they are to counter attacks"

Offline MatMan

  • Hero Member
  • *****
  • Posts: 1320
Re: Get ammo count for weapon via script?
« Reply #3 on: June 10, 2012, 05:09:06 am »
Wait a second, are you saying there's no way with script to find if player is using weapon or not?
There is the getplayerproperty(playerindex, "weaponum") command but I kept on getting the result of 0 whenever I called it, might be a bug or it could of been because the modelflag 1 command was both in the main file and weapon file (which does cause problems).

Offline utunnels

  • Developer
  • Hero Member
  • *****
  • Posts: 2713
Re: Get ammo count for weapon via script?
« Reply #4 on: June 10, 2012, 08:22:10 pm »
There's no such property yet.

Though you can get model and defaultmodel property.

model is your current model name and defaultmodel is your main model name.

For player, you can use getplayerproperty for weapnum, but not other types.

 



 0%




SimplePortal 2.3.3 © 2008-2010, SimplePortal