AgentOrange Posted March 11, 2021 Author Share Posted March 11, 2021 "game mode" function comes to mind, i think its begin OnGameMode I could not find any reference to this function. I only found Begin GameMode which I am using currently. Link to comment Share on other sites More sharing options...
Mishkax Posted March 11, 2021 Share Posted March 11, 2021 thats why i said make sure of the syntax on the wiki EDIT: found out game mode runs every frame apparently,my bad Link to comment Share on other sites More sharing options...
Mishkax Posted March 11, 2021 Share Posted March 11, 2021 here is a better function to use for your purposes https://cs.elderscrolls.com/index.php?title=IsDodging Link to comment Share on other sites More sharing options...
Mishkax Posted March 11, 2021 Share Posted March 11, 2021 ill give it a shot Begin GameMode if (Player.IsDodging == 1)Player.Setghost IGhostFlag 1 elseif (Player.IsDodging == 0)Player.SetGhost IGhostFlag 0 End im not guaranteeing that one and youll need to check it yourself Link to comment Share on other sites More sharing options...
DrakeTheDragon Posted March 12, 2021 Share Posted March 12, 2021 The syntax notation of SetGhost in the Wiki is quite confusing and non-standard compared to the Wiki's usual notation, but "iGhostFlag" is just meant to say the function has an input parameter that's the ghost flag and of type integer, an additional remark saying it can be either 0 or 1 as well. SetGhost iGhostFlag ( 0 or 1 )So usage by "player.SetGhost 1" or "player.SetGhost 0" is totally appropriate. If you use "iGhostFlag", however, I guarantee the compiler will complain about an unknown function or variable for that. The script so far is looking quite fine to me, and even though it didn't have any turn off of the ghost status, yet, it should've at least made you a ghost the first time dodging.You can simplify the "ElseIf" line by simply making it an "Else". No need to check for dodging "again", when it's simply an "is or is not".Oh, and one more thing, watch the return type of those "Is..." functions. In most cases they're Boolean (0 or 1, true or false) and can be used without comparison."If (Player.IsDodging)" for the "is" case and "Else" for "is not" will definitely suffice. But if it's still not doing anything, you should definitely take care the script is actually running.If it's a Quest script, it also needs to be bound to a quest, and the quest needs to be started with the start of the game (there's a flag for that in the dialog in the CS). Link to comment Share on other sites More sharing options...
Pellape Posted March 12, 2021 Share Posted March 12, 2021 Is it only for the player or more actors? If it is only the player, you can attach the script to a item in your inventory, like a token but it is easiest to do it on a wearable I guess and any will do. Link to comment Share on other sites More sharing options...
AgentOrange Posted March 12, 2021 Author Share Posted March 12, 2021 But if it's still not doing anything, you should definitely take care the script is actually running.If it's a Quest script, it also needs to be bound to a quest, and the quest needs to be started with the start of the game (there's a flag for that in the dialog in the CS). Oh does it need to be a quest? I thought "begin OnGameMode" would suffice to make the script run all the time? Is it only for the player or more actors? If it is only the player, you can attach the script to a item in your inventory, like a token but it is easiest to do it on a wearable I guess and any will do.I was thinking to make it work for any actor. But I thought it would be simpler start with the player only as this is my first script I'll be making from scratch. I don't even know how to refer to all actors. :sweat: Link to comment Share on other sites More sharing options...
KatsAwful Posted March 12, 2021 Share Posted March 12, 2021 (edited) Scripts in Oblivion have to be attached to something in order to actually run. Quest scripts are attached to a quest and are run globally while the quest is active. Object scripts are attached to an object (like an item) and are run based on their block mode. If you're doing something globally its best to use quest scripts, as you can adjust the speed they are processed with fQuestDelayTime. Object scripts with something like "GameMode" will run instantaneously all the time and cannot be stopped and they also need to be on an object that will be loaded when you want to do stuff Edited March 12, 2021 by KatsAwful Link to comment Share on other sites More sharing options...
AgentOrange Posted March 12, 2021 Author Share Posted March 12, 2021 (edited) so Scripts in Oblivion have to be attached to something in order to actually run. Quest scripts are attached to a quest and are run globally while the quest is active. Object scripts are attached to an object (like an item) and are run based on their block mode. If you're doing something globally its best to use quest scripts, as you can adjust the speed they are processed with fQuestDelayTime. Object scripts with something like "GameMode" will run instantaneously all the time and cannot be stopped and they also need to be on an object that will be loaded when you want to do stuff So was using Begin GameMode a mistake in my script? Or should I keep it? What should I do next? Edited March 12, 2021 by AgentOrange Link to comment Share on other sites More sharing options...
KatsAwful Posted March 12, 2021 Share Posted March 12, 2021 GameMode is the right block mode, but for this kind of script it should be used in a quest script so you can manage how it runs. Make a quest and attach your script to it, making sure the quest starts automatically. Then in your script, define and set fQuestDelayTime (its a float) to a reasonably low value like 0.01 Link to comment Share on other sites More sharing options...
Recommended Posts