Support #926
Strange errors when adding a new weapon
| Status: | New | Start: | 12/23/2011 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assigned to: | - | % Done: | 0% |
|
| Category: | - | Spent time: | - | |
| Target version: | - | |||
| Milestones: | ||||
| Votes: | -1 |
Description
When I add a new weapon I get strange errors, but not when I replace a weapon, this apparently shouldn't happen and one should simply lose the laser when they pick up every single weapon:
Frame 4 missing in model *3, and we have no fallback - FAIL!
Frame 0 missing in model *3, and we have no fallback - FAIL!
Frame 13 missing in model *3, and we have no fallback - FAIL!
Frame 0 missing in model *3, and we have no fallback - FAIL!
Frame 4 missing in model *3, and we have no fallback - FAIL!
Frame 0 missing in model *3, and we have no fallback - FAIL!
Frame 13 missing in model *3, and we have no fallback - FAIL!
Frame 0 missing in model *3, and we have no fallback - FAIL!
Frame 4 missing in model *3, and we have no fallback - FAIL!
Frame 0 missing in model *3, and we have no fallback - FAIL!
Frame 13 missing in model *3, and we have no fallback - FAIL!
Frame 0 missing in model *3, and we have no fallback - FAIL!
Frame 4 missing in model *3, and we have no fallback - FAIL!
Frame 0 missing in model *3, and we have no fallback - FAIL!
Frame 13 missing in model *3, and we have no fallback - FAIL!
Frame 0 missing in model *3, and we have no fallback - FAIL!
Frame 4 missing in model *3, and we have no fallback - FAIL!
Frame 0 missing in model *3, and we have no fallback - FAIL!
Frame 13 missing in model *3, and we have no fallback - FAIL!
Frame 0 missing in model *3, and we have no fallback - FAIL!
Frame 4 missing in model *3, and we have no fallback - FAIL!
...
Frame 0 missing in model *3, and we have no fallback - FAIL!
Frame 7 missing in model *3, and we have no fallback - FAIL!
Frame 0 missing in model *3, and we have no fallback - FAIL!
Frame 6 missing in model *3, and we have no fallback - FAIL!
Frame 0 missing in model *3, and we have no fallback - FAIL!
Frame 7 missing in model *3, and we have no fallback - FAIL!
Frame 0 missing in model *3, and we have no fallback - FAIL!
Frame 6 missing in model *3, and we have no fallback - FAIL!
Frame 0 missing in model *3, and we have no fallback - FAIL!
Frame 7 missing in model *3, and we have no fallback - FAIL!
Frame 0 missing in model *3, and we have no fallback - FAIL!
Frame 6 missing in model *3, and we have no fallback - FAIL!
Frame 0 missing in model *3, and we have no fallback - FAIL!
Frame 7 missing in model *3, and we have no fallback - FAIL!
Frame 0 missing in model *3, and we have no fallback - FAIL!
Frame 6 missing in model *3, and we have no fallback - FAIL!
Frame 0 missing in model *3, and we have no fallback - FAIL!
Frame 7 missing in model *3, and we have no fallback - FAIL!
Frame 0 missing in model *3, and we have no fallback - FAIL!
Frame 6 missing in model *3, and we have no fallback - FAIL!
Frame 0 missing in model *3, and we have no fallback - FAIL!
Frame 7 missing in model *3, and we have no fallback - FAIL!
Frame 0 missing in model *3, and we have no fallback - FAIL!
Frame 6 missing in model *3, and we have no fallback - FAIL!
Frame 0 missing in model *3, and we have no fallback - FAIL!
Saving persistent data...
done!
// ONLY EVER ADD NEW WEAPONS AT THE END. IF YOU REMOVE ONE, PUT THE LAST ONE ON
// ITS PLACE. THIS IS TO AVOID UNNECESSARY RENUMBERING OF WEAPON IMPULSES.
// IF YOU DISREGARD THIS NOTICE, I'LL KILL YOU WITH THE @!#%'N TUBA
1 #include "w_laser.qc"
2 #include "w_shotgun.qc"
3 #include "w_uzi.qc"
4 #include "w_grenadelauncher.qc"
5 #include "w_minelayer.qc"
6 #include "w_electro.qc"
7 #include "w_crylink.qc"
8 #include "w_nex.qc"
9 #include "w_hagar.qc"
10 #include "w_rocketlauncher.qc"
11 #include "w_porto.qc"
12 #include "w_minstanex.qc"
13 #include "w_hook.qc"
14 #include "w_hlac.qc"
15 #include "w_tuba.qc"
16 #include "w_rifle.qc"
17 #include "w_fireball.qc"
18 #include "w_seeker.qc"
19 #include "w_shotgunautomat.qc"
20 #include "w_nukelayer.qc"
21 #include "w_pistol.qc"
22 #include "w_hmg.qc"
23 #include "w_mg.qc"
24 #include "w_pumpshotgun.qc"
History
Updated by mikeeusa3 5 months ago
I have been told that 24 is the max, that the bitmask is wide enough for that amount of weapons, and it's when one goes over to 25 that there is a problem, but here I haven't gone over? It has also been said for anything that I request that if it is given well next week I'll just come in asking for a re-up, another top-up, more slots... but why is that so bad? It means I'm working on things to add to the game or mod? Why is that alone a terrible thing.
Things done changed.
Wind Done Gone.
Updated by divVerent 5 months ago
Possibly the limit is actually 23, we never tried 24 and unlikely ever will.
Also, this could also simply be a bug in your code and not in Xonotic. Therefore, moving this to the appropriate tracker.
Please run on the console when it happened:
set foo -1
prvm_edict server 1
prvm_edictget server 1 exteriorweaponentity foo
prvm_edict server $foo
and paste the result.
Updated by mikeeusa3 5 months ago
Players dissappear.
LH says 24 weapons should work fine and this is not having to do w/ too many weapons (though it's triggered by it)
http://pics.nexuizninjaz.com/images/e62biioespe8itr9rw.jpg
Updated by divVerent 5 months ago
Well, I gave you some console commands to run. Run them when alone and the message spam is there.
Updated by mikeeusa3 5 months ago
here's the output of what you said to do
http://ompldr.org/vYnZzcw/bla.log
Updated by mand1nga 5 months ago
- Subject changed from When I add a new weapon I get strange errors, but not when I replace a weapon, this apparently shouldn't happen to Strange errors when adding a new weapon
Please use sane titles on the issues
Updated by divVerent 5 months ago
With this log, we're getting somewhere.
You did not even have the "24th gun". You only have the 1st, 2nd and 20th gun.
Currently displayed gun: shotgun
Inventory: laser, shotgun, gun #20
Oddly, even though you don't have all these guns, you have weapon load values for all guns in range from 2 to 23. So I suppose you had these guns selected and thrown away?
Player modelindex for some reason is 4, i.e. model "*3". It was not set to that value by setmodel(), as "model" has a sane value.
Please check for any assignments to "modelindex" for the player entity.
Updated by divVerent 5 months ago
Is this based on current git BTW? Current git no longer writes to player's modelindex when player dies.
Updated by mikeeusa3 5 months ago
I wouldn't go over a 32 weapon limit in a week, and though you don't need a higherlimit for xonotic vanilla yet you did say you wanted a chaos-xonotic mod, so I'm making one, I need a higher limit. My thought is to put a crossbow in and stuff, just need a few more spaces. And I publish my code, it's not like I'm keeping it to myself on my own server, I'm trying to help out and learn.
Updated by mikeeusa3 5 months ago
LH made this suggestion:
<LordHavoc> yeah the magic has to be reworked
<LordHavoc> it's not a big deal, it's just work
<LordHavoc> you can define your weapons numerically
<LordHavoc> as 0, 1, 2, 3, 4, 5...
<LordHavoc> rather than bit flags
<LordHavoc> which makes them effectively limitless (millions)
<LordHavoc> and use .float weapons[WEP_MAX];
<LordHavoc> where WEP_MAX is one higher than the last weapon index
<LordHavoc> so you could have WEP_MAX at 60
<LordHavoc> and WEP_SHOTGUN is 2
<LordHavoc> and WEP_LASER is 1
<LordHavoc> and such
<LordHavoc> I'm saying you rework these
<LordHavoc> there are unavoidable changes to make
<LordHavoc> the weapons[] array would just be to track which weapons you have acquired
<LordHavoc> so that the next/prev weapon switching and other code can iterate it
<LordHavoc> by array indexing rather than separate named floats for each
Updated by divVerent 5 months ago
I quite insist on networking weapons as stats. Multiple stats, sure. Otherwise, we'd use lots of the 256 stats for weapons.
So, we'd end up changing .float weapons to .float weapons[WEPFLD_MAX] for example, and change all weapons handling code to handle all four values.
Weapon X then goes into weapons[floor(x / 24)] and has the value exp2(modf(x, 24))
Updated by mikeeusa3 5 months ago
Sounds like a good plan. Just changing 24 to another number would increase the max weapons?