Establishing Scripting Concept

Post » Sun Nov 18, 2012 12:27 am

Try an Armor item instead? You'll then be able to use OnEquipped/OnUnequipped and, for a re-useable follower controller ...thing, it might be handy to favorite it which you can do with an ARMO unlike a MISC. You might be able to get OnActivete to fire from within your inventory if the MISC reference is persistent/filling an alias, but it would still not be favorite-able.
User avatar
lolli
 
Posts: 3485
Joined: Mon Jan 01, 2007 10:42 am

Post » Sun Nov 18, 2012 7:08 am

Try an Armor item instead? You'll then be able to use OnEquipped/OnUnequipped and, for a re-useable follower controller ...thing, it might be handy to favorite it which you can do with an ARMO unlike a MISC. You *might be able to get OnActivete to fire from within your inventory if the MISC reference is persistent/filling an alias, but it would still not be favorite-able.
While I understand what you are saying, I don't want to use an Armour item because I want to be consumable. With how I have it now I am giving the user an impression that they are 'deploying' the spider. Unless there is a better way of course.
But I have had a look into the Spider Control Rod but I cannot figure out how it works, I have looked through the item and its magic effects and have found no trace of anything useful, nor the special spider either. I am completely stumped in that manner but I think I may have just missed something.
User avatar
Elisha KIng
 
Posts: 3285
Joined: Sat Aug 18, 2007 12:18 am

Post » Sun Nov 18, 2012 2:19 am

With Game.GetPlayer().PlaceAtMe() how do I make it spawn something within a papyrus script. I have tried the: Name and Form ID and my script will not compile in either case.
User avatar
Carlos Vazquez
 
Posts: 3407
Joined: Sat Aug 25, 2007 10:19 am

Post » Sun Nov 18, 2012 7:49 am

With Game.GetPlayer().PlaceAtMe() how do I make it spawn something within a papyrus script. I have tried the: Name and Form ID and my script will not compile in either case.

You gotta look into properties man. They will make this whole thing go a lot smoother.
User avatar
flora
 
Posts: 3479
Joined: Fri Jun 23, 2006 1:48 am

Post » Sun Nov 18, 2012 2:06 am

You gotta look into properties man. They will make this whole thing go a lot smoother.
Okay so I define the property I can see how to make this work for an actor but not for an item.
What type should I use and will I use the Form ID or the Actor/Objects name? Will experiment.
User avatar
Clea Jamerson
 
Posts: 3376
Joined: Tue Jun 20, 2006 3:23 pm

Post » Sun Nov 18, 2012 1:02 am

So I believe I have my property's set up correctly, one for an actor and the other for a misc object but I cannot make them reference the Actor/Misc unless they are in a separate cell. The script compiles successfully but in game the event is fire, the debug message appears but the actor does not.
User avatar
Emma Pennington
 
Posts: 3346
Joined: Tue Oct 17, 2006 8:41 am

Post » Sun Nov 18, 2012 12:14 am

For PlaceAtMe you should be using an ActorBase property, not Actor.
User avatar
yessenia hermosillo
 
Posts: 3545
Joined: Sat Aug 18, 2007 1:31 pm

Post » Sat Nov 17, 2012 11:46 pm

For PlaceAtMe you should be using an ActorBase property, not Actor.
Sweet will try when I have a moment
It works!!!
User avatar
Shiarra Curtis
 
Posts: 3393
Joined: Thu Jan 04, 2007 3:22 pm

Post » Sun Nov 18, 2012 6:40 am

My spiders are "replicating"(an extra one spawns) themselves whenever they travel. I already know how to resolve this but I am not sure what caused it. Ideas?
(Resolve by checking the actor deleting itself automatically if there is more than one.
User avatar
Jimmie Allen
 
Posts: 3358
Joined: Sun Oct 14, 2007 6:39 am

Post » Sun Nov 18, 2012 5:46 am

What is the best way to go about referencing "self" (the actor a script is being run on)?
User avatar
R.I.p MOmmy
 
Posts: 3463
Joined: Wed Sep 06, 2006 8:40 pm

Post » Sat Nov 17, 2012 8:13 pm

Well, as I just learned you only need to if you're passing self as a parameter of a function. Otherwise, just say what you want it to do. So, if you want to disable it, just say Disable(). If you need to do a findclosestreferenceofanytypeinlistfromref however, you'll need to pass in the word 'self' as the arCenter parameter of the function.
User avatar
Monique Cameron
 
Posts: 3430
Joined: Fri Jun 23, 2006 6:30 am

Post » Sun Nov 18, 2012 12:30 pm

Well, as I just learned you only need to if you're passing self as a parameter of a function. Otherwise, just say what you want it to do. So, if you want to disable it, just say Disable(). If you need to do a findclosestreferenceofanytypeinlistfromref however, you'll need to pass in the word 'self' as the arCenter parameter of the function.
Wait, its that easy? Damn...
User avatar
Cathrine Jack
 
Posts: 3329
Joined: Sat Dec 02, 2006 1:29 am

Post » Sun Nov 18, 2012 9:22 am

Okay so the Wiki's information on http://www.creationkit.com/Global is a bit vague so:
I am trying to set a Global Variable but it will not compile, giving me an error with something along the lines of: "No alternate input ".""
Scriptname Control_SpiderCreate extends ObjectReference {Creates a dwmer control spider and checks if there are any other control followers alive}MiscObject Property SpiderCore  AutoActorBase Property Control_Spider  Auto GlobalVariable Property Control_AutomationCount AutoGlobalVariable Property Control_AutomationLimit AutoControl_AutomationCount.Setvalue(0)Control_AutomationLimit.Setvalue(1)Event OnActivate(ObjectReference akActionRef)	  if Control_AutomationLimit.GetValue() > Control_AutomationCount.GetValue()		    Game.GetPlayer().PlaceAtMe(Control_Spider)		    Utility.Wait(1)		    Game.GetPlayer().RemoveItem(SpiderCore, 1)		    Debug.Notification("Spider Activated")	  ElseIf Control_AutomationLimit.GetValue() <= Control_AutomationCount.GetValue()		    Debug.Notification("Unable to have any more automations")		    Utility.wait(1)		    Debug.MessageBox("Control_AutomationLimit"+ Control_AutomationLimit )		    Debug.MessageBox("Control_AutomationCount" + Control_AutomationCount )	  Else		    Debug.MessageBox("Somthing is not right")	  EndIfEndEvent
Any ideas on what I have stuffed up?
User avatar
Phillip Brunyee
 
Posts: 3510
Joined: Tue Jul 31, 2007 7:43 pm

Post » Sun Nov 18, 2012 10:25 am

The problem is that you're trying to run functional code (SetValue) outside of a function or event body. Move that code into an event like OnInit and it should work.

Cipscis
User avatar
Kayla Oatney
 
Posts: 3472
Joined: Sat Jan 20, 2007 9:02 pm

Post » Sun Nov 18, 2012 11:07 am

My spiders are "replicating"(an extra one spawns) themselves whenever they travel. I already know how to resolve this but I am not sure what caused it. Ideas?

What do you mean by travel?

If you are using PlaceAtMe() then it is because that function places a new reference of the base object whenever it is called

If you want to spawn the same spider each time, you could make a small holding cell and place your spider in it. Then when you want to spawn it, use something like

ObjectReference Property mySpider  automySpider.MoveTo(game.getplayer())

according to the http://www.creationkit.com/MoveTo_-_ObjectReference the only problem is it will "pop in" which may be a bit off putting.

When you want to dismiss the spider you could use http://www.creationkit.com/MoveToMyEditorLocation_-_ObjectReference

Of course, I could be barking up the wrong tree entirely

- Hypno
User avatar
i grind hard
 
Posts: 3463
Joined: Sat Aug 18, 2007 2:58 am

Post » Sat Nov 17, 2012 11:29 pm

What do you mean by travel?

If you are using PlaceAtMe() then it is because that function places a new reference of the base object whenever it is called

If you want to spawn the same spider each time, you could make a small holding cell and place your spider in it. Then when you want to spawn it, use something like

ObjectReference Property mySpider  automySpider.MoveTo(game.getplayer())

according to the http://www.creationkit.com/MoveTo_-_ObjectReference the only problem is it will "pop in" which may be a bit off putting.

When you want to dismiss the spider you could use http://www.creationkit.com/MoveToMyEditorLocation_-_ObjectReference

Of course, I could be barking up the wrong tree entirely

- Hypno
I meant "when the player travels". Current there aren't any of my spiders in any cells, the only way to 'create' them at the moment is through the script I posted.

The problem is that you're trying to run functional code (SetValue) outside of a function or event body. Move that code into an event like OnInit and it should work.

Cipscis
Ah, thank you!
User avatar
zoe
 
Posts: 3298
Joined: Sun Nov 12, 2006 1:09 pm

Post » Sat Nov 17, 2012 11:08 pm

I meant "when the player travels". Current there aren't any of my spiders in any cells, the only way to 'create' them at the moment is through the script I posted.

Yeah, but the point hypno is trying to make is that if you use placeAtMe, you create a new persistent reference. So if your PC enters the cell, that creates a spider. If he leaves and re-enters another one is created for two, and so on. That sounds a lot like the problem you describe.

The suggestion is therefore to create a new cell with no connection to the rest of the game, and to drag the required number of spiders into that cell from the object browser. Then you can move them to the player location when you need them and move them back when no longer needed.
User avatar
Tina Tupou
 
Posts: 3487
Joined: Fri Mar 09, 2007 4:37 pm

Post » Sun Nov 18, 2012 6:17 am

This will also prevent some save game bloat.

The other option, of course, is to create a copy of the DialogueFollower quest. Then make several copies of the Follower alias within that quest, and use the following script:
Quest Property DialogueFollowerCopy autoevent OnLoad()   (DialogueFollowerCopy as DialogueFollowerScript).SetFollower(self)endEvent

This will make the spider follow you to the ends of Nirn.
User avatar
casey macmillan
 
Posts: 3474
Joined: Fri Feb 09, 2007 7:37 pm

Post » Sun Nov 18, 2012 4:11 am

At the moment everything is pretty much working. One small bug which I should squash in 20 minutes or so.
{Controls the spiders OnDeath and on Activate Functions}MiscObject Property Control_SpiderCore  AutoActorBase Property Control_Spider  Autobool Function IsDead() nativeGlobalVariable Property Control_AutomationCount AutoGlobalVariable Property Control_AutomationLimit  Autobool Control_StateDead = falseEvent OnActivate(ObjectReference akActionRef)		    debug.notification("Dead = "+ Control_StateDead)		    if Control_StateDead == true	  		    ; To stop the stupid message box				  Debug.Notification("Dead")		    Else				  Debug.MessageBox("Automation deactivated")				  Game.GetPlayer().AddItem(Control_SpiderCore)				  Delete();Unsure which works				  Disable()				  Control_AutomationCount.SetValue(Control_AutomationCount.GetValueInt() - 1)		    EndIfEndEventEvent OnDeath(Actor akKiller)		    Control_AutomationCount.SetValue(Control_AutomationCount.GetValueInt() - 1)		    Control_StateDead = True		    Debug.Notification("A automation has died")		    Debug.Notification("Automation Count:" + Control_AutomationCount.GetValueInt())EndEventEvent OnLoad()		    Control_AutomationCount.SetValue( Control_AutomationCount.GetValueInt() + 1)		    Control_StateDead = False		    Debug.Notification("Automation Limit:" + Control_AutomationLimit.GetValueInt())		    Debug.Notification("Loaded")EndEvent
and
Scriptname Control_SpiderCreate extends ObjectReference {Creates a dwmer control spider and checks if there are any other control followers alive}MiscObject Property SpiderCore  AutoActorBase Property Control_Spider  Auto GlobalVariable Property Control_AutomationCount AutoGlobalVariable Property Control_AutomationLimit  AutoEvent OnLoad()	  if Control_AutomationLimit.GetValue() == 0		    Control_AutomationLimit.SetValue(1)	  EndIfEndEventEvent OnActivate(ObjectReference akActionRef)	  if Control_AutomationLimit.GetValue() > Control_AutomationCount.GetValue()		    Game.GetPlayer().PlaceAtMe(Control_Spider)		    Game.GetPlayer().RemoveItem(SpiderCore, 1)		    Debug.Notification("Spider Activated")	 	  ElseIf Control_AutomationLimit.GetValue() <= Control_AutomationCount.GetValue()		    Debug.Notification("Unable to have any more automations")	  Else		    Debug.MessageBox("Somthing is not right")	  EndIfEndEventEvent OnEquip()	  if Control_AutomationLimit.GetValue() > Control_AutomationCount.GetValue()		    Game.GetPlayer().PlaceAtMe(Control_Spider)		    Game.GetPlayer().RemoveItem(SpiderCore, 1)		    Debug.Notification("Spider Activated")	 	  ElseIf Control_AutomationLimit.GetValue() <= Control_AutomationCount.GetValue()		    Debug.Notification("Unable to have any more automations")	  Else		    Debug.MessageBox("Somthing is not right")	  EndIfEndEvent
And maybe some commenting and cleaning up.

Hope this helps someone.
User avatar
Alexander Lee
 
Posts: 3481
Joined: Sun Nov 04, 2007 9:30 pm

Post » Sun Nov 18, 2012 8:04 am

Not really a problem but more of a request.
Who would like to test the mod and provide me with some feedback (or point in the right direction where to find some people who are willing)?
User avatar
Oceavision
 
Posts: 3414
Joined: Thu May 03, 2007 10:52 am

Post » Sun Nov 18, 2012 9:08 am

I'll test it out.
User avatar
u gone see
 
Posts: 3388
Joined: Tue Oct 02, 2007 2:53 pm

Post » Sat Nov 17, 2012 10:44 pm

Thank you, I'll upload it when I have a moment.
User avatar
sharon
 
Posts: 3449
Joined: Wed Nov 22, 2006 4:59 am

Post » Sun Nov 18, 2012 11:36 am

http://dl.dropbox.com/u/9049845/COS.zip
To spawn the spider you need to first created the "core" in a forge, (it has no prerequisites at the moment) then you will need to drop the core out of your inventory and activate it. It will then be consumed and the spider will be placed. From there it should just function like a bodyguard and if you find it to be a nuisance just activate it to turn it back into a core. If it dies however, you cannot retrieve a core from its dead body. The spider scale with the player start at LVL5 and progressing to 80 and there can only be one active at a time.

Currently the mod is set up for just the one spider (but more 'variations' are in the works).
The current recipe is just a place holder currently.

What I would like tested:
How well it preforms in combat (for balance tweaking mainly)
How well it keeps up with the player
Activating the spider and the core
User avatar
Jordyn Youngman
 
Posts: 3396
Joined: Thu Mar 01, 2007 7:54 am

Post » Sun Nov 18, 2012 2:30 am

Trying to figure out how to distinguish between the different variations of spiders. I am thinking I am able to to use a spell but I am unsure how to cast it through a papyrus script.
User avatar
KRistina Karlsson
 
Posts: 3383
Joined: Tue Jun 20, 2006 9:22 pm

Post » Sat Nov 17, 2012 11:14 pm

Mod is more or less finished, thank you for all your help!
User avatar
Esther Fernandez
 
Posts: 3415
Joined: Wed Sep 27, 2006 11:52 am

PreviousNext

Return to V - Skyrim