Jump to content

teleport script help plz


Godschildgaming

Recommended Posts

so I'm trying to make a spell that will teleport the player up to a npc that it hits, like teleport strike from elder scrolls online

scn "scriptname"

short npctarget
begin gamemode
set getself to npctarget
player.moveto npctarget
end

but the construction set wont let me save this script, so is there anyway to get this to work, or a script that works to do the same thing???

Link to comment
Share on other sites

You're trying to assign a variable to a command!

In other words, you switched the command GetSelf and the variable npctarget.

The correct syntax is:

Set <variable> to <value>

 

GetSelf is a command which return the reference of the actor where the script is running. In this case, the script run on the target of the spell, so GetSelf return him/her. You should take the reference returned by GetSelf and assign it to npctarget (not the opposite!).

 

 

Also, spells must not use GameMode.

They have their own set of commands like this: http://cs.elderscrolls.com/index.php?title=ScriptEffectStart

Refer to the tutorials to learn how to create scripts. You'll find everything you need here: http://cs.elderscrolls.com/index.php?title=Main_Page

 

 

Here's the correct script, and some suggestions:

scn scriptname  ;Don't use quotes here. Only use quotes in strings'

short npctarget

begin ScriptEffectStart     ;runs once, when the spell hit and the script effect is applied on the target
  set npctarget to getself   ;call the command getself, get the returned value and store it in npctarget
  player.moveto npctarget
end
Edited by forli
Link to comment
Share on other sites

 

You're trying to assign a variable to a command!

In other words, you switched the command GetSelf and the variable npctarget.

The correct syntax is:

Set <variable> to <value>

 

GetSelf is a command which return the reference of the actor where the script is running. In this case, the script run on the target of the spell, so GetSelf return him/her. You should take the reference returned by GetSelf and assign it to npctarget (not the opposite!).

 

 

Also, spells must not use GameMode.

They have their own set of commands like this: http://cs.elderscrolls.com/index.php?title=ScriptEffectStart

Refer to the tutorials to learn how to create scripts. You'll find everything you need here: http://cs.elderscrolls.com/index.php?title=Main_Page

 

 

Here's the correct script, and some suggestions:

scn scriptname  ;Don't use quotes here. Only use quotes in strings'

short npctarget

begin ScriptEffectStart     ;runs once, when the spell hit and the script effect is applied on the target
  set npctarget to getself   ;call the command getself, get the returned value and store it in npctarget
  player.moveto npctarget
end

thx dude i figured it out I totally was scripting it wrong and also found a little problem with the var so instead of me using short var i had changed it to ref

scn "scriptname"

short npctarget
begin gamemode
set getself to npctarget
player.moveto npctarget
end

i had to use

scn "scriptname"

ref npctarget
begin scripteffectstart
set npctarget to getself
player.moveto npctarget
end 

but the spell crashes oblivion when used, so now I got to find a way to fix that

Link to comment
Share on other sites

I may think about two possible causes:

 

1) I repeat: don't use quotes in the script name: after scn the game expect a simple word for the script name (like a variable name), not a quoted string. Quotes must only be used for creating strings.

 

2) Don't use scriptname as name of script. ScriptName is a keyword (scn is an abbreviation of this keyword).

When the game see scn scriptname it doesn' read:

<ScriptName keyword> <name of the script>
but this instead:

<ScriptName keyword> <ScriptName keyword>
So it become crazy, for not finding the name of the script but another keyword in its place.

 

Generally speaking, never use keywords for names (scripts/functions/variables/etc name) in any programming language. Other programming languages would not let you compile the code. CS scripts are a row imitation of a programming language, so it may silently accept the error but crash in game.

Edited by forli
Link to comment
Share on other sites

I may think about two possible causes:

 

1) I repeat: don't use quotes in the script name: after scn the game expect a simple word for the script name (like a variable name), not a quoted string. Quotes must only be used for creating strings.

 

2) Don't use scriptname as name of script. ScriptName is a keyword (scn is an abbreviation of this keyword).

When the game see scn scriptname it doesn' read:

<ScriptName keyword> <name of the script>
but this instead:

<ScriptName keyword> <ScriptName keyword>
So it become crazy, for not finding the name of the script but another keyword in its place.

 

Generally speaking, never use keywords for names (scripts/functions/variables/etc name) in any programming language. Other programming languages would not let you compile the code. CS scripts are a row imitation of a programming language, so it may silently accept the error but crash in game.

 

 

So I have changed the

scn "scriptname"

To

scn BIBTeleTargSSC

and have tested the spell but still crashes the game, the crash may be a problem with spells in the game because I've tried to make a resurrect spell but it crashed the game as well, is there anyway to stop it from crashing when the spell scripts try to run?

Link to comment
Share on other sites

  • Recently Browsing   0 members

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