Karen Posted February 21, 2006 Report Share Posted February 21, 2006 Possibility of adding new APIs has appeared. Post your wishes in this topic. Please, write well-defined functions that you need, desirably with list of parametresput your wishes till the end of the week Link to comment Share on other sites More sharing options...
KoMik Posted February 21, 2006 Report Share Posted February 21, 2006 Sorry about these two monkeys in my head, hitting each others by turns with boxing gloves - but what is this API? I haven't played H&S yet. Link to comment Share on other sites More sharing options...
Novik Posted February 21, 2006 Report Share Posted February 21, 2006 but what is this API?Application Program Interface. New script hooks/functions in simple words. Will be applied at next patch. List of existed functions:https://forum.nival.com/rus/showpost.php?p=...30&postcount=84List of existed hooks:https://forum.nival.com/rus/showpost.php?p=...16&postcount=90 to-do list at this moment: functions: bHasCrit, nDiff, nTime UnitHasCritical(unit, nCritID ) bool UnitIsSelected( unit )UI_ID FocusCameraEx( unit/position, nRod = 0, nYaw = 0, nPitch = 100 ) -- dinamic camera creationnX,nY,nZ PosToVector3D( position ) -- dinamic position creationposition Vector3DToPos( nX, nY, nZ ) -- dinamic position creation hooks: OnOpenShop()OnCloseShop()OnOpenStore()OnCloseStore()OnOpenLoot()OnCloseLoot()OnOpenCharacter()OnCloseCharacter()OnOpenPerks()OnClosePerks()OnOpenBiography()OnCloseBiography()OnOpenStatistics()OnCloseStatistics() Link to comment Share on other sites More sharing options...
KoMik Posted February 21, 2006 Report Share Posted February 21, 2006 Ahhaa! Great! Thanks. I dunno yet about new H&S functions or scripting it but I have missed these functions in S^3 (nothing special but...):-------------------------------------------------------------------------------------------------------------------------------------FullRetreat( unit, "waypoint" ) = Better that existin' UnitSetRetreatLogic( unit ). Should run like hell and doesn't attack at all.I have tried with UnitAIMode( unit, false ) + UnitMoveToWaypoint( unit, "w") but mob just freeze after a turn.-FullMeleeUnit( unit ) = If unit have melee weapon in hand then always try to barge to close combat + use melee((-UnitSeeDead( unit, group ) = Returns true if unit have spotted any stunned/killed group's unit... maybe to custom Auto Load?))------------------------------------------------------------------------------------------------------------------------------------ Perhaps those functions are not 'necessary' to anybody else... (?) That's all for now... I will be back with better time (and if I will remember my other 'ideas'). Link to comment Share on other sites More sharing options...
Novik Posted February 21, 2006 Report Share Posted February 21, 2006 All of this functions can be writing on existing API. Example: FullRetreat( unit, "waypoint" )function isDone(unit) local ret = not (IsValid(unit) and UnitCanFight(unit)) return(ret) end MIN_DISTANCE = 1.0 function FullRetreatThread( unit, waypoint ) if(isDone(unit)) then return end local wPos = GetWaypointPos(waypoint) UnitMoveToWaypoint(unit,waypoint) local dist = GetDistance(GetPos(unit),wPos) local oldDist = dist while((dist>MIN_DISTANCE) and (not isDone(unit))) do if(IsRealTime()) then Sleep(40) else SleepForTurn() end dist = GetDistance(GetPos(unit),wPos) if(isDone(unit)) then break end if((oldDist==dist) and (not PassCalcerIsActive())) then UnitMoveToWaypoint(unit,waypoint) end oldDist = dist end end function FullRetreat( unit, waypoint ) StartThread(FullRetreatThread, unit, waypoint) endFullMeleeUnit( unit )\UnitSeeDead( unit, group )I can write it too, but listing is long. You really need it? Link to comment Share on other sites More sharing options...
KoMik Posted February 21, 2006 Report Share Posted February 21, 2006 Wow, that was truly helpful - thanks a lot and more. I really needed that.I can write it too, but listing is long. You really need it?No. I think I know how to write those... If I encounter problems, I just hope a piece of help and ask a solution. . . . One function what I dunno how to do is:UnitLooseItems( unit ) = Takes all weapons/items from unit's slots and inventory (to emptiness).There is a function UnitRemoveInventoryToStore( unit ) but it's not what I need. I'm looking fora way to get captured/imprisoned and that's why all items should be taken from player's character/s. Thanks again. Link to comment Share on other sites More sharing options...
Novik Posted February 21, 2006 Report Share Posted February 21, 2006 UnitLooseItems( unit )function destroyItemInBackpack(unit) local item = UnitGetFirstItem(unit) if(IsValid(item)) then local itemID = UnitGetItemID( unit, item ) UnitRemoveInventoryItem( unit, itemID ) WaitForUnit(unit) return(true) end return(false) end function destroyAllItems(unit) while(destroyItemInBackpack(unit)) do end UnitActivateWeapon(unit,false) WaitForUnit(unit) UnitTakeOffSlotItem( unit, 0 ) UnitTakeOffSlotItem( unit, 1 ) UnitUpdateAnimation(unit) -- H&S only function, correct unit's hands animation endEscuse me, i don't remember - works this on S^3 or not. On H&S this code is OK. Link to comment Share on other sites More sharing options...
KoMik Posted February 21, 2006 Report Share Posted February 21, 2006 All right! Noted up.On H&S this code is OK.OK. I have planned to use it for my H&S mod. Thanks Novik. Hopefully I didn't messed this thread with my non-pro questions. End of the episode. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now