Jump to content

Script Editing Assistance


kingtitan

Recommended Posts

This is what I changed it to:

 

scn ATLuciferDPAbilityScript

short Activate
short Button
short DoOnce
float Timer

begin OnActivate
if GetFactionRank ATLuciferFaction == 4 || GetFactionRank ATLuciferFaction == 21 || GetFactionRank ATLuciferFaction == 27
	messagebox "Take the body down?" "Take it down" "Leave it up"
	set Activate to 1
else
	Activate
	return
endif
end

begin GameMode
if GetFactionRank ATLuciferFaction < 1
	removespell ATLuciferAbility
endif
if IsIdlePlaying == 0
	pickidle 1
endif
if Activate == 1
	set Button to GetButtonPressed
	if Button == -1
		return
	elseif Button == 0
		SetActorsAI 1
		SetDestroyed 0
		SetUnconscious 0
		SetRestrained 0
		SetFactionRank ATLuciferFaction -1
		kill
		set Activate to 0
		set DoOnce to 0
		set Timer to 0
		removespell ATLuciferAbility
		Return
	elseif Button == 1
		set Activate to 0
	endif
endif
if GetFactionRank ATLuciferFaction == 4 || GetFactionRank ATLuciferFaction == 21 || GetFactionRank ATLuciferFaction == 27
	if IsIdlePlaying == 1 && DoOnce == 0 && Timer >= 1 && Timer < 2
		SetUnConscious 1
	elseif IsIdlePlaying == 1 && DoOnce == 0 && Timer >= 2
		SetActorsAI 0
		set DoOnce to 1
	elseif DoOnce == 0 && Timer < 2
		set Timer to Timer + GetSecondsPassed
	endif
endif
end

 

 

Problem persists unfortunately.

Link to comment
Share on other sites

The script looks fine to me and I can't see where the problem lies, so I think it's time to use some debug text to see what is actually happening. Use only one of them at a time otherwise they will overwrite each other and you might miss a message. See if this helps to identify what's going wrong.

 

scn ATLuciferDPAbilityScript

short Activate
short Button
short DoOnce
float Timer

begin OnActivate
if GetFactionRank ATLuciferFaction == 4 || GetFactionRank ATLuciferFaction == 21 || GetFactionRank ATLuciferFaction == 27
	messagebox "Take the body down?" "Take it down" "Leave it up"
	set Activate to 1
else
	Activate
	messagebox "NPC Activated!"	;<-------------------------- Debug text
	return
endif
end

begin GameMode
if GetFactionRank ATLuciferFaction < 1
	removespell ATLuciferAbility
endif
if IsIdlePlaying == 0
	pickidle 1
endif
if Activate == 1
	set Button to GetButtonPressed
	if Button == -1
		return
	elseif Button == 0
		messagebox "Button 0 running"	;<-------------------------- Debug text
		SetActorsAI 1
		SetDestroyed 0
		SetUnconscious 0
		SetRestrained 0
		SetFactionRank ATLuciferFaction -1
		kill
		set Activate to 0
		set DoOnce to 0
		set Timer to 0
		removespell ATLuciferAbility
		Return
	elseif Button == 1
		messagebox "Button 1 running"	;<-------------------------- Debug text
		set Activate to 0
	endif
endif
if GetFactionRank ATLuciferFaction == 4 || GetFactionRank ATLuciferFaction == 21 || GetFactionRank ATLuciferFaction == 27
	if IsIdlePlaying == 1 && DoOnce == 0 && Timer >= 1 && Timer < 2
		messagebox "SetUnconscious routine running"			;<-------------------------- Debug text
		SetUnConscious 1
	elseif IsIdlePlaying == 1 && DoOnce == 0 && Timer >= 2
		messagebox "SetActorsAI 0 routine running"			;<-------------------------- Debug text
		SetActorsAI 0
		set DoOnce to 1
	elseif DoOnce == 0 && Timer < 2
		set Timer to Timer + GetSecondsPassed
	endif
endif
end

Link to comment
Share on other sites

Ok here are my results. I went ahead and entered all debug texts one at a time:

 

Messagebox for "NPC activated" never showed up

messagebox for "button 0 running" showed up and went away when I hit ok

messagebox for "button 1 running" never showed up

messagebox for "setunconscious routine running" showed up and kept repeating when i hit ok

messagebox for "setactorsai 0 routine running" never showed up

 

Hopefully you can interpret that better than i can :)

Link to comment
Share on other sites

Okay, that definitely helps narrow down the problem.

 


  1.  
  2. Messagebox for "NPC activated" never showed up - BAD
  3. messagebox for "button 0 running" showed up and went away when I hit ok - GOOD
  4. messagebox for "button 1 running" never showed up - GOOD
  5. messagebox for "setunconscious routine running" showed up and kept repeating when i hit ok - BAD
  6. messagebox for "setactorsai 0 routine running" never showed up - GOOD

 

So basically it means that the "NPC activated" OnActivate block is not firing. It's not firing because the Faction Rank isn't being changed as evidenced by #4 showing and repeating.

 

I'd try making some changes to that "SetFactionRank ATLuciferFaction -1" line...

 


  •  
  • Change its syntax to match the wiki... "SetFactionRank ATLuciferFaction, -1" (note the comma)
  • Move "SetFactionRank ATLuciferFaction -1" to just above "SetActorsAI 1"
  • Not sure if this console command exists, but try opening the console, clicking on the NPC to select it and typing "GetFactionRank ATLuciferFaction" and see what number it gives you.

Link to comment
Share on other sites

Did all that and but of course, I couldn't loot, talk to, ect with the NPC.

 

However, when I attempted the console command it returned "item "atluciferfaction" not found for parameter faction" (or something to that effect). Basically, it seems like the game can't even find the faction! Could the problem lie within that?

Link to comment
Share on other sites

I got a hold of my friend that wrote the original script for me and I think he is going to basically write a "counter" scripted spell. Hopefully this will work, I will post my results from his script when I get it and test it out.
Link to comment
Share on other sites

Ah, that's good. It's always harder to troubleshoot someone else's script than one you wrote yourself, so with your friend on board, I'm sure s/he'll figure it out in a jiffy. I hope the mod turns out okay for you. :thumbsup:
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...