MajorMistake Posted January 31, 2010 Share Posted January 31, 2010 Hi there, i just started with fallout 3 scripting and have some issues understanding where to attach my scripts to and how to adress objects and targets correctly. The blocktype "OnEquip" does fine, when attached to a weapon. The G.E.C.K. Wiki says "Run once when object is equipped by ActorID." The object is the weapon the script is attached to, no problem there. But is there any way to use this query on an actor? And how to reference the weapon then? For example, i want to check if the player equips a weapon, and then do x based on the WeaponAnimType or something like that. Could i do this with the gamemode block, a quest and just "OnEquip"? The same thing when using OnHit: do i have to attach this to an actor, which is then automatically adressed? Or can i target someone remotely with this block? A question similar to this would be how to change all weapons at once. I don't want to change every weapon itself but rather script an overall change for specific weapon types. Do i have to attach a script to each weapon or is there another way? Thanks for your time :) Link to comment Share on other sites More sharing options...
Harmy52 Posted January 31, 2010 Share Posted January 31, 2010 You could use FormLists for your last question. Link to comment Share on other sites More sharing options...
MajorMistake Posted February 1, 2010 Author Share Posted February 1, 2010 Good idea. Though it seems not to be the solution i am looking for. I want to avoid adressing specific weapons. So when you add some weapon later it automatically inherits the base values because of its animationtype or something else. EDIT: Okay, i found some answers and hopefully a solution for my problem. Nothing fancy, as i am just a newbie, but nevertheless i want to post it here (because i searched this forum for hours and found lots of interesting threads with good questions, but often no answers). I went the quest script route, created a dummy quest and attached a quest script to it. I changed the questdelay to 0.5, seems to be enough to catch any change when drawing a weapon for example. Then i discovered the source of a big problem of mine: the numbers for GetAnimAction on the geck site are plain wrong. You have to switch to the discussin tab on the site to find more information about it, and i was so naive to believe the shown numbers were right -.- Lucky me checked the reload ani, and used "== 8", which never returned true - because the reload ani returns NINE - omg ;) After some testing i got this values: 0: draw a weapon or change a drawn one1: holster weapon When attacking with a pistol, you get 2,3,4 (4 is the part when the weapon gets back to the normal state after the shot).When attacking with a melee weapon, you just get 2 and 4 (2 for the beginning attack, 4 swing back)Using a grenade or a mine, you get 5,6,4. Reload Ani is 9.Landing after a jump gets me "C" - hmm. And doing nothing something like "FFFFFFFFFFF" - is there a problem with the variable i used for debugging (short aninumber)? After this i was able to do things based on the weapontype. Created a dummy quest and attached this script to it: scn CheckWeaponTypeScript Begin GameMode SetQuestDelay YourDummyQuest 0.5 If player.GetAnimAction == 0 ;if player draws a weapon or changes one already out if player.GetWeaponAnimType == 4 ;1hand pistol printc "1hand pistol!" elseif player.GetWeaponAnimType == 9 ;grenade printc "grenade!" EndifEndif End This script just prints the actual weapontype to the console (for testing purposes). You have to add your own actions there of course, also the other weapon types. I don't know if this script is efficient or usable, but it works for now... Link to comment Share on other sites More sharing options...
Recommended Posts