User talk:Taglag

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search

Can't Get Refference on Combat AI[edit source]

I have tried many things in script trying to get to the point where I can add a usable Short, or ref to the AI that attack me in the game, sOo I can do something useful with them in the script.

But no matter what I try I can not seem to Get hold of the attacking AI in script.

Please, can sOmeone show me what to do to be able to type something like.

if (target.GetCombatTarget == player) and the game will actually let me manage the attacking AI.

here is one of my attempts to script AI.

ScriptName TAGRoughCombat ;THIS GOES ON QUEST RoughCombat
short DoOnce
short Once
short GAT 
ref target
short CombatMode
float Timer

Begin GameMode

  if (DoOnce == 0)
    If (Player.GetIsSex female == 1)
      set DoOnce to 1
      message "You are a Girl..:)"
    Else
      return
    endIf
  endif

; if (TagRoughCombat.GetCurrentAIPackage == 5)
  if (DoOnce == 1) 
    if ( TagRoughCombat.GetCombatTarget == player )
      Message "something is attacking you..!"
      set DoOnce to 2
    endif
  endif
  endif
; endif

;  if (DoOnce == 1)
;    if (target.GetCombatTarget == player)
;    set Target to GetSelf                        
;    Message"something is attacking you..!"
;    set DoOnce to 2
;  endif
;endif

END

it does not crash, but i can not get control of the AI in script. I hope i have explained this rightly.

I have tried sOo many, left some of my other attemps semicolened out, but i have tried, sOo many different functions it's Really discouraging.. I have done much scripting in Morrowind, and even some here, but this is the first time I have tried to take control of an unknown AI... and I just am Unable to seem to do it.

Please help me with the proper syntax, or manor in which to do this.. --Taglag 19:55, 25 April 2009 (EDT)

This does not belong on the Community Portal. Please restrict questions on that page to questions about the Wiki as a whole. You suggestion about examples was a perfect example of an appropriate thing to question on the Community Portal.
In general, questions on the Wiki should either be in the Talk page of an article you have a question about, in the Community Portal if it's about the Wiki as a whole, or not here at all if it's something else. Your Talk page can have whatever you like, which is why I've moved it here, but it's also not terribly likely to get answers here. Questions about specific things you are trying to do with a mod go on the Forums. There are more people there who are more likely to be able to answer your question quickly and completely. Questions on the Wiki tend to just confuse and clutter things, and frequently take much, much longer to be answered.
However, as long as I am here, I will attempt to help you out.
First of all, you're always going to have a hard time if you don't keep your indentation sane. It will make it impossible to notice things like the fact that you have an extra EndIf there, which is probably going to mess things up.
Second, TagRoughCombat is the script, isn't it? Scripts are not references, so you cannot use them with the reference.Function syntax. So I have no idea what you were trying to do with TagRoughCombat.GetCombatTarget, but it won't work. In fact, I'm surprised it even lets you save the script.
Third, the typical way of getting references to things attacking the player is to use a Magic script, which is attached to an invisible AOE spell that you have an activator Cast repeatedly. The AOE spell will run on everything it hits, and then it can check if the things it hits are in combat with the player. In order to do this, I recommend reading the Casting Spells From An Activator tutorial.
I hope that helps. If you still have questions, or new questions, I recommend starting a thread on the Forums.
Dragoon Wraith TALK 22:08, 25 April 2009 (EDT)
Just saw your edit on IsInCombat. The way you used the function is how it's supposed to be used, and was not what the Note was about. I removed it because it seemed to be a misunderstanding of what the note was getting at.
However, also, please try to maintain a professional tone when editing pages in the Wiki (i.e. the Article pages, as opposed to the Discussion pages). Proper English gramma and spelling are required, as is proper Wiki mark-up. Further, use signatures is not allowed in non-discussion articles. Please keep these things in mind, thank you.
Dragoon Wraith TALK 22:26, 25 April 2009 (EDT)