Jump to content
Official BF Editor Forums


  • Content Count

  • Joined

  • Last visited

Everything posted by [FH]ctz

  1. Expanded, 3.07638e-007 is 3.07638 * 10^-7. That's 0.000000307638. The editor will write these numbers due to limited floating point accuracy (see http://en.wikipedia.org/wiki/Floating_poin...uracy_problems). You can probably replace them with zero with no ill effects.
  2. First question: http://en.wikipedia.org/wiki/Scientific_notation I think all the AI code in BF2 misspells 'infantry' as 'infantery'. I would expect 'infantry' means the command fails silently. There are numerous misspellings all over the place, perhaps because DICE being a swedish company has many people whose first language is not english.
  3. [FH]ctz


    i just do sys.excepthook(*sys.exc_info()) -- this prints it in the standard form you quoted to sys.stderr.
  4. yes, this won't work. look: Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> some_number = 5 >>> some_string = "hi" >>> some_string + some_number Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: cannot concatenate 'str' and 'int' objects instead, try: >>> some_string + str(some_number) in other words: host.rcon_invoke("Object.team " + str(Team))
  5. [FH]ctz

    Muttrah City

    Very nice. It seems like lots of work has been put into this and the quality shows. Nice to see some of the fun layouts from the original (that grassy square with the fountain surrounded by high buildings always required some determination to take!).
  6. one line solution (expand to make more readable at your leisure ) randomplayer = random.choice([p for p in bf2.playerManager.getPlayers() if p.getTeam() == 1 and p.isAlive() and not p.isManDown()]) whoops, fixed
  7. The way to do this is to spawn a PCO which immediately self-destructs (due to having a high critical damage) and attaching an effect to this PCO's destruction. Give the effect a sound which is not 3d and has huge cull distances. Then your python just needs to create a spawner at the origin for this object, and the server takes care of the rest.
  8. instead of def somefunction(player): if player.isMarked: pass # ... do stuff you'd do def somefunction(player): if hasattr(player, 'isMarked') and player.isMarked: pass # ... do stuff or even def somefunction(player): if player.__dict__.get('isMarked', False): pass # ... do stuff
  9. Don't worry, we have the same issue. Just tell your mappers to make all spawnable kit placements look good when facing north
  10. guiIndex is an integer you choose which links into the hud layer. for vanilla bf2, see GUIIndex.txt in the menu code for documentation as to what numbers maps to what hud. the hud code changes based on the hud variable 'GuiIndex'. displaySelectOnActivation pops up the weapon selection menu (in the bottom left) even if you select the weapon directly with the numeral keys. addFireRate allows a firearm to have switchable fire rates. i believe 0 is full auto, 1 is burst, 2 is semi-auto. not sure if this works on non-handweapons. dummy projectiles are models which are attached to the firearm, and who are deleted as you fire the weapon. they reappear when you reload. they are purely for aesthetics. i believe keepProjectiles is how long in seconds the projectiles last in the world (irrespective of the projectile's timetolive!) after the firer dies. maxProjectilesInWorld is a related setting, this is the absolute maximum number of projectiles that one player can produce at a time (even if they're continually reloading). itemIndex serves the same purpose in vehicles as it does for handweapons: it is what numeral key you must press to switch to the weapon. it must be unique for each PCO, and if you want to mix selected and non-selected firearms in a single PCO the non-selected ones must have isselectable set to zero (we do this in fh2 to have selectable rounds on the main guns of tanks, but a non-selectable coaxial mg). for firearm inputs, they also must be unique for any PCO's weapon. I believe clashes cause both weapons to never fire. there is a way of getting around this (see bf2's m2 ammobox), but it has bugs (the secondary firearm fires at about 75% of the rate of the primary). this behaviour in the whole is awful, BF42 was must more useful (clashes caused both weapons to fire together).
  11. [FH]ctz

    Need Fire

    Well, how about spraying lots of firey AP mines around? People running into them will "detonate" them and they can expire as normal. That's only one kind of projectile. The main trick would be making the fire effect have a fairly large spread, so they overlap and a single 'mine' going off and disappearing didn't make all the flames disappear. (this is how i plan to do our flamethrowers when we get to needing them -- if anyone sees an obvious shortcoming with that please let me know! but i haven't actually tested this yet.)
  12. I'd be interested to know if they got it working in MP. Getting it to work in local and SP is easy (see my code in our map 'Sidi Rezegh' for something which works) but it doesn't and hasn't ever worked in MP, nor can I ever remember it working in SF either The general idea is to objecttemplate.active the S_ templates attached to triggerables or triggerable targets and attach sounds to them. The editor tends to helpfully delete these for you, but you can stash them safely in your tmp.con.
  13. It looks like the ItemSlotXSelected nodes were deleted. If you're lucky, they'll be rem'd out (so just remove the rems in front of each line, or the beginrem ... endrem block around them.) If not, it should be quite easy to copy them from the original. Easier still would be to grab the original BF2 HudElementsWeaponSelect.con and delete all the *BackFaded and *BackActive nodes to get rid of the solid background colours.
  14. Yes. forceSustainedFire.
  15. loading the images as DDSs will work ok, but: * but perform increasingly badly as you add more images, * not work for ATI graphics cards users once you start using non-power-2 textures. like mschoeldgen says, make your own atlas. there are provided tools which makes the process childs play.
  16. kill messages: edit the localisation. crosshairs: either set all the weapons to have a zero guiindex, or edit the hud code to disable certain guiindexes.
  17. i believe setDamage(0) on a soldier crashes the server when the soldier is not the root PCO (ie it's the child of another PCO).
  18. it would work in single player, but not multiplayer. python runs on the server, not client. it just so happens that for single player, the client also runs the server.
  19. you've forgot to add repair/rearm abilities to the kits
  20. you're welcome to this fix --- trunks/fh2/python/game/gamemodes/gpm_cq.py 2007/11/01 23:46:11 4049 +++ trunks/fh2/python/game/gamemodes/gpm_cq.py 2007/11/15 00:48:26 4143 @@ -309,7 +309,9 @@ attackOverWeight = - abs(team1OverWeight) timeToChangeControl = cp.cp_getParam('timeToLoseControl') - if cp.cp_getParam('onlyTakeableByTeam') != 0 and cp.cp_getParam('onlyTakeableByTeam') != attackingTeam: + # don't enforce onlyTakeableByTeam on neutral flags + if cp.cp_getParam('onlyTakeableByTeam') != 0 and cp.cp_getParam('onlyTakeableByTeam') != attackingTeam \ + and cp.cp_getParam('team') in [1,2]: return if team1Occupants > 0 or team2Occupants > 0:
  21. i've just tested this quite thoroughly -- i seem to always get _both_ unlock sets activated all the time -- meaning in your example the kit always has eurif_fnp90, and never USRIF_MP5_A3 or chsht_protecta. this is tested over about a dozen spawns, and 3 restarts of the game. EDIT: this agrees with what i get putting it through a shell: > var v_weapon = CRD_UNIFORM 1/4/0 "var" syntax: (variableName [= initValue])! > if v_weapon > 2 Unknown variable v_weapon! so, your code will *always* have: ObjectTemplate.addTemplate UnlockUSAT ObjectTemplate.addTemplate UnlockUSAT2 in the kit declaration, agreeing with what i see.
  22. do you have that texture it mentions in your hud atlas? if not, add it.
  • Create New...