| Blockland Forums > Modification Help |
| Provide Your Custom Scripts for Streamlining Development |
| << < (3/4) > >> |
| Swollow:
--- Quote from: PhantOS on January 08, 2018, 08:04:03 AM ---can you commentate the vector functions because they're really confusing and its unclear on what they return. the names give some guess but already im confused on how geteyevectorhack is any different from the default geteye vector --- End quote --- getEyeVectorHack gets the vector of where your body is facing from your eyepoint even if you are freelooking rotate vector angle something like this --- Code: ---%upHack = %pl.getUpVectorHack(); %forward = %pl.getForwardVector(); %rightVec = vectorCross(%forward,%up); %muzVec = %pl.getEyeVectorHack(); %a = (getRandom()-0.5)*($PI*2); %x = mCos(%a)*(getRandom()*%spread); %y = mSin(%a)*(getRandom()*%spread); vectorAngleRotate(vectorAngleRotate(%muzVec,%upHack,%x),%rightVec,%y); --- End code --- this is something along the lines of what my weapon pack uses to create circular spread instead of how most weapons create cubic spread vector relative shift, shifts a transform with a vector as its local axis --- Code: ---%up = %pl.getUpVectorHack(); %forward = %pl.getEyeVectorHack(); %pos = vectorAdd(%pl.getMuzzlePoint(%slot),vectorRelativeShift(%forward,%up,"3 3 0")); --- End code --- this would get the position 3 units in front and 3 units to the right of the muzzlePoint |
| phflack:
the good keybind code --- Code: ---//Stolen from Ephialtes who stole from Randy function AddBind(%division, %name, %command) { for(%i=0;%i<$remapCount;%i++) { if($remapDivision[%i] $= %division) { %foundDiv = 1; continue; } if(%foundDiv && $remapDivision[%i] !$= "") { %position = %i; break; } } if(!%foundDiv) { error("Division not found: " @ %division); return; } if(!%position) { $remapName[$remapCount] = %name; $remapCmd[$remapCount] = %command; $remapCount++; return; } for(%i=$remapCount;%i>%position;%i--) { $remapDivision[%i] = $remapDivision[%i - 1]; $remapName[%i] = $remapName[%i - 1]; $remapCmd[%i] = $remapCmd[%i - 1]; } $remapDivision[%position] = ""; $remapName[%position] = %name; $remapCmd[%position] = %command; $remapCount++; } --- End code --- |
| elm:
https://github.com/Elmling/Lob2/tree/master/Classes for deving rpgs.. |
| Greek2me:
--- Quote from: phflack on January 08, 2018, 03:59:17 PM ---the good keybind code --- End quote --- I prefer mine: http://www.greek2me.us/code/Support_Keybinds.cs However, I think OP intended this topic to be for code that you use *while* you're developing and that you would not include in your add-on. Debugging code, basically. |
| Platypi:
--- Quote from: Dannu on January 07, 2018, 05:15:32 AM ---Doesn't sound like a good idea to me. Imagine add-ons being dependent on the fcbn function. --- End quote --- --- Quote from: Conan on January 07, 2018, 05:19:56 AM ---sounds like a bad way to create dependencies and break mods in the future. if anything this should be limited to code snippets for reference to do basic stuff, like remove a given word from a string of words --- End quote --- As I stated in the OP: --- Quote from: Platypi on January 06, 2018, 07:31:30 AM ---All utilities included would be solely for the use of development, and not to be included as dependencies for finished, publicly released add-ons. --- End quote --- --- Quote from: Greek2me on January 09, 2018, 08:41:18 PM ---However, I think OP intended this topic to be for code that you use *while* you're developing and that you would not include in your add-on. Debugging code, basically. --- End quote --- This. Perhaps something like Support_DebugLib would be more apt to punctuate this point. |
| Navigation |
| Message Index |
| Next page |
| Previous page |