[Pogamut-list] Adding weapons and ammunition
frank_fjs
pogamut-forum at diana.ms.mff.cuni.cz
Sun May 30 22:27:20 CEST 2010
Re: Adding weapons and ammunition
Author: frank_fjs
Hi,
I'm using v.3.0.11 and I'm trying again to reaload my weapons (FlakCannon). Like I said in my last post, I think there are a inconsistente in weaponry class, I saw that bot uses weaponry-ammo to shoot but when bot reload it use weaponry-weaponsById. ¿Is it a bug? ¿or I'm not understanding weaponry? I think that was working in a older version but I'm not sure
I've debuged verion 3.0.11. and I have next conclusions:
-Bots only shoot if it has ammo in weaponry-ammo
-If I use addInventory with ammoPickup, weaponry increase his ammo in weaponry-weaponsById but not in weaponry-ammo (so I can't really reload and finally my bot stop shooting)
-If I use addInventory with weaponPickup, weaponry increase his ammo in weaponry-ammo but weaponry-weaponsById set his ammo to 0 (with that method my bot can shoot again)
-If I try to reload AssaultRifle, it launch next exception:
(ReloadBotIC) [SEVERE] 22:10:51.945 Fatal error in WorldView[161]: Exception raising event InfoMessage[ItemPickedUp] | Id = WorldObjectId[DM-Trainingday.AssaultAmmoPickupid1861] | InventoryId = WorldObjectId[DM-Trainingday.GrenadeAmmo] | Location = [2150.20; -1430.80; -79.15] | Amount = 4 | AmountSec = 0 | Type = ItemType[name = XWeapons.AssaultAmmoPickup, category = AMMO, group = ASSAULT_RIFLE] | Dropped = true |
(ReloadBotIC) [SEVERE] 22:10:51.964 Fatal error happenned - component bus is stopping.
FatalErrorEvent[
Component=UT2004SyncLockableWorldView
Message=Exception raising event InfoMessage[ItemPickedUp] | Id = WorldObjectId[DM-Trainingday.AssaultAmmoPickupid1861] | InventoryId = WorldObjectId[DM-Trainingday.GrenadeAmmo] | Location = [2150.20; -1430.80; -79.15] | Amount = 4 | AmountSec = 0 | Type = ItemType[name = XWeapons.AssaultAmmoPickup, category = AMMO, group = ASSAULT_RIFLE] | Dropped = true |
Cause=java.lang.NullPointerException
Cause stacktrace:
cz.cuni.amis.pogamut.ut2004.agent.module.sensomotoric.Weaponry$Ammunition.itemPickedUp(Weaponry.java:614)
cz.cuni.amis.pogamut.ut2004.agent.module.sensomotoric.Weaponry$ItemPickedUpListener.notify(Weaponry.java:845)
cz.cuni.amis.pogamut.ut2004.agent.module.sensomotoric.Weaponry$ItemPickedUpListener.notify(Weaponry.java:840)
cz.cuni.amis.pogamut.base.communication.worldview.impl.AbstractWorldView$ListenerNotifier.notify(AbstractWorldView.java:98)
cz.cuni.amis.pogamut.base.communication.worldview.impl.AbstractWorldView$ListenerNotifier.notify(AbstractWorldView.java:77)
cz.cuni.amis.utils.listener.Listeners.notify(Listeners.java:252)
cz.cuni.amis.utils.listener.ListenersMap.notify(ListenersMap.java:76)
cz.cuni.amis.pogamut.base.communication.worldview.impl.AbstractWorldView.notifyLevelAListeners(AbstractWorldView.java:629)
cz.cuni.amis.pogamut.base.communication.worldview.impl.AbstractWorldView.innerRaiseEvent(AbstractWorldView.java:700)
cz.cuni.amis.pogamut.base.communication.worldview.impl.AbstractWorldView.raiseEvent(AbstractWorldView.java:604)
cz.cuni.amis.pogamut.base.communication.worldview.impl.EventDrivenWorldView.raiseEvent(EventDrivenWorldView.java:102)
cz.cuni.amis.pogamut.base.communication.worldview.impl.EventDrivenWorldView.innerNotify(EventDrivenWorldView.java:126)
cz.cuni.amis.pogamut.base.communication.worldview.impl.EventDrivenWorldView.notify(EventDrivenWorldView.java:223)
cz.cuni.amis.pogamut.base3d.worldview.impl.BatchAwareWorldView.notify(BatchAwareWorldView.java:83)
cz.cuni.amis.pogamut.ut2004.communication.worldview.UT2004SyncLockableWorldView.processBatch(UT2004SyncLockableWorldView.java:206)
cz.cuni.amis.pogamut.ut2004.communication.worldview.UT2004SyncLockableWorldView.processBatches(UT2004SyncLockableWorldView.java:189)
cz.cuni.amis.pogamut.ut2004.communication.worldview.UT2004SyncLockableWorldView.unlock(UT2004SyncLockableWorldView.java:166)
cz.cuni.amis.pogamut.ut2004.agent.module.logic.SyncUT2004BotLogic.afterLogic(SyncUT2004BotLogic.java:70)
cz.cuni.amis.pogamut.base.agent.module.LogicModule$LogicRunner.run(LogicModule.java:391)
java.lang.Thread.run(Thread.java:619)
Thanks
Frank
--
Reply Link: <http://diana.ms.mff.cuni.cz/main/tiki-view_forum_thread.php?forumId=4&comments_reply_threadId=4&comments_parentId=164&post_reply=1#form>
More information about the Pogamut-list
mailing list