Jump to content
Official BF Editor Forums

Krauzi

Members
  • Content Count

    262
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Krauzi

  • Rank
    Member
  • Birthday 02/02/1992

Profile Information

  • Gender
    Male
  • Location
    Germany

Recent Profile Visitors

4,350 profile views
  1. this was just an example code i wanted to use the fileManager for copying Level data from vanilla bf2 to my mod
  2. i know that this is a very old topic but i did fix the problem this way: adding 7 kits to the init.con and modify the spawnmenu (give kit 5-7 x-coordinates of 600). bots can select this kits but humans cannot.
  3. Hello guys, the example of the fileManager ( http://bf2.fun-o-matic.org/index.php/ConGrammar [at the bottom]) doesnt seem to work anymore. Can anyone confirm this?
  4. if i remember right, host.rcon_invoke can also return values. so maybe a host.rcon_invoke("sv.spawnTime") will return the respawn time value. Dont have bf2 installed atm but ill try to help you within the next days if i have time.
  5. sure, it is open source under Apache Licence 2.
  6. oh lol i found out that the old (1.4.2) version works perfectly with bf2 version 1.5. Btw: I've coded a gamespy login emulator so you can enjoy the unlocks (which only works with online accounts) even if you dont have internet: http://gsloginserver.googlecode.com
  7. Hi guys, because BF2Statistics is down and i dont have any forum access any more now (where 1.5 fixes were published) i ask you guys here: Anyone has a working BF2statistics (especially the ASP thing) for BF2 with patch 1.5 or fixes for the current stat (1.4.2)? Cheers Krauzi.
  8. I think if you want to write a real game with good graphics and networkcode you cant avoid coding the core in C++. Some time ago i tried to rewrite a basic part of the python core (from C to C++) but i finally gave up because it were to many objects i had to change. But one thing i recognized was that python is not written very efficient and often not very smart (for example the whole dictoffset thing). I spent the last few weeks of my holidays (the last school holidays i'll ever have) to code a library which allowes you to easily integreate python into c++. Ill publish it here if you want (but im not yet finished). Anyway: Python isn't meant to be a language you should write a entire game in.
  9. ok then they changed a lot between 2.3 and < 2.3. Then maybe this works strlen = len(text)-len("turbo") text = text[ strlen : len(text) ] Anyway there shouldnt be any difference between demo and final bf2 (python side only). About your last question: I think you mean something like this: Clan_Members = ["name1", "name2", "name3", "name4"] def onPlayerSpawn( player, soldier ): if player.getName() in Clan_Members: #dunno weather this works because the CLAN tag could be in the name if not hasattr(player, "greet_sent"): sendrankstuff( player, rank, otherargs ) #i dont know the function for this atm player.greet_sent = True something like that should work. EDIT: I tested my script out and it seems to work on my BF2 client 1.5 (non demo): import bf2 import host def init(): host.registerHandler('ChatMessage', onChatMessage, 1) def onChatMessage(playerid, text, channel, flags): if len(text) < len("turbo"): return text = text[ len(text)-len("turbo") : ] if text == "turbo": host.rcon_invoke("ObjectTemplate.activeSafe Engine JEEP_FAAV_Engine") host.rcon_invoke("ObjectTemplate.setTorque 600 ") host.rcon_invoke("ObjectTemplate.newCar2.maxRpm 8000 ") host.rcon_invoke('game.sayall "|ccc|Turbo Activated!|ccc|"')
  10. ups maybe there was a syntax change with the array operator within python 2.3 -> < 2.3. Maybe try this one: text = text[ ( len(text)-len("turbo") ) : ]
  11. dont get into habit of doing this that way! You better code universal (this will avoid many error sources) like I've done in my script (which is also a lot of faster then the whole replace stuff [because you only copy a array once in comparison to 4 time copy with the replace stuff]).
  12. i think that the "if text[0:1] == "turbo"" thing doesnt work! You should better replace the whole text.replace stuff with: text = text[ len(text)-len("turbo") : ] if text == "turbo": #host.rcon_invoke stuff EDIT: Full code then: import bf2 import host def init(): host.rcon_invoke('game.sayall "Scrippy Loaded"') host.registerHandler('ChatMessage', onChatMessage, 1) def onChatMessage(playerid, text, channel, flags): if playerID == -1: playerID = 255 text = text[ len(text)-len("turbo") : ] if text == "turbo": host.rcon_invoke("ObjectTemplate.activeSafe Engine JEEP_FAAV_Engine") host.rcon_invoke("ObjectTemplate.setTorque 600 ") host.rcon_invoke("ObjectTemplate.newCar2.maxRpm 8000 ") host.rcon_invoke('game.sayall "|ccc| Turbo Activated!|ccc|"') host.rcon_invoke('game.sayall "end of invoke!"')
  13. This triggers can only (as far as i know) be set with python. This works well for static objects like map flags are and this is also used for the flag overtaking logic (see scoringCommon.py)
×
×
  • Create New...