Deleted57015472User Posted July 29, 2018 Share Posted July 29, 2018 (edited) Hello, so I'm getting back into modding for the first time in.. like 10 or 11 years. I'm 22. Yeah.So I'm having a very dumb issue, on my first very rough script (designed to generate targets for wander packages at a set distance from the spawn point in each cardinal direction)..It doesn't seem to recognize ObjectReference as a class, or perhaps it's rejecting me setting up an array of them, I'm unsure. lemme posts the codes: Scriptname zzzDPDrifterManagementSystem {The system in charge of spawning and assigning drifters to locations, aswell as acting as a liason for the existing colony management system} GlobalVariable MaximumDrifters; int ScavengeDistance = 4056; ObjectReference SpawnPoint; Static Spawners; ObjectReference[] ScavengePoints = new ObjectReference[4]; ObjectReference[] GuardPoints = new ObjectReference[12]; Actor[] ActorArray = new Actor[MaximumDrifters]; bool initialized = false; Event OnActivate(ObjectReference akActionRef) if akActionRef == Game.GetPlayer() if initialized == false int tick = 0; while (tick < 4) int x = 0; int y = 0; if tick == 0 x = 1; y = 1; endif if tick == 1 x = 1; y = -1; endif if tick == 2 x = -1; y = -1; endif if tick ==3 x = -1; y = 1; endif ScavengePoints[tick] = spawnpoint.placeatme(Spawners); ScavengePoints[tick].MoveTo(SpawnPoint, Spawnpoint.GetPositionX() + (ScavengeDistance*x), SpawnPoint.GetPositionY() + (ScavengeDistance*y)); Game.GetPlayer().MoveTo(SpawnPoint, Spawnpoint.GetPositionX() + (ScavengeDistance*x), SpawnPoint.GetPositionY() + (ScavengeDistance*y)); Utility.Wait(6.0) tick++; endwhile Game.GetPlayer().MoveTo(SpawnPoint); Debug.MessageBox("Cardinal Scavenge Points Configured at distance "+"ScavengeDistance"); initialized = true; endif endif EndEvent and the errors: Compiling "zzzDPDrifterManagementSystem.psc"... E:\Games\steamapps\common\Fallout 4\Data\Scripts\Source\User\zzzDPDrifterManagementSystem.psc(10,35): no viable alternative at input 'new' E:\Games\steamapps\common\Fallout 4\Data\Scripts\Source\User\zzzDPDrifterManagementSystem.psc(10,54): required (...)+ loop did not match anything at input '[' E:\Games\steamapps\common\Fallout 4\Data\Scripts\Source\User\zzzDPDrifterManagementSystem.psc(10,18): Unknown user flag objectreference No output generated for zzzDPDrifterManagementSystem.psc, compilation failed. While I'm at it, is there a resource for a definition of functions library to add autocomplete to notepad++? The.. often very unhelpful wiki only has such for skyrim. Pardon if my terminology is off, I'm basically just an idiot who passed a basic java course years ago and am going off that for experience. Edit: Please ignore the functions moving the player, that is just me screwing around with it for debugging purposes and to get a more visual sense of the distances involved. Edited July 29, 2018 by Guest Link to comment Share on other sites More sharing options...
bbiller Posted July 29, 2018 Share Posted July 29, 2018 While I may not know Fallout coding directly, I do know a number of languages maybe this will help. When setting up a type for a variable you just need the type, no bracket required to start, so see if these line fixes help: ObjectReference ScavengePoints = new ObjectReference[4];ObjectReference GuardPoints = new ObjectReference[12];Actor ActorArray = new Actor[MaximumDrifters]; They are from the start of your script. Also if switch case options are available, that can cut down some of the work in that while loop, though failing that an if then else pattern should speed things up, rather than going through all options. Example:switch (tick){case 0:What to dobreak;case 1:what to dobreak;case 2:what to dobreak;case 3:what to dobreak;} then resume work. A for loop may also work.for(tick=0;tick<4;tick++){ Set x and y as needed Do spawning and moving}You will not need to add to the tick as that is handled by the end of the for statement (start value, condition, counter). If then else example:If tick == 0What to doElseIf tick == 1What to doElseIf tick == 2What to doElseIf tick == 3What to doEnd if The above will go through the if's until it gets to the right one, but will stop hunting once the condition is found (tick is the expected value). A C or C++ class can be a big help and there are free tutorials out there. I'm also assuming someone has made a resource of all the functions, variables, and loop types available. Hopefully this is of some aid to you. Link to comment Share on other sites More sharing options...
Deleted57015472User Posted July 30, 2018 Author Share Posted July 30, 2018 While I may not know Fallout coding directly, I do know a number of languages maybe this will help. Thank you, I was never taught about breaks and I can definitely see that being a much more efficient system than the if statements. Always good to learn something new (and realize for statements are still in papyrus) Unfortunately, the arrays are still having trouble initialize, perhaps they are not arrayable, and need to be manually done (yuck). Link to comment Share on other sites More sharing options...
bbiller Posted August 2, 2018 Share Posted August 2, 2018 Of those three lines try changing to () on the ends instead of brackets, those are for getting to the individual pieces (ex. New Array items=new Tools(5); then to access 5th, items[4], as array goes 0 to 4 for the five). Adjust my example accordingly, as I haven't looked into nodding Fallout 4, just dealt with some mods I made but never released for Dark Forces 2 Jedi Knight and the addon missions in Mysteries of the Sith, though I was looking into the original Unreal Engine with the original Deus Ex (good game, worth some of your time as it is what brought about the later Deus Ex's like Mankind Divided). Link to comment Share on other sites More sharing options...
Recommended Posts