User Tools

Site Tools


contributors:jh

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
contributors:jh [2022/08/09 18:05] – [Some of my Cinematic adventures] jerryhoppercontributors:jh [2022/08/25 15:49] (current) jerryhopper
Line 31: Line 31:
 **Timelapse: Crag Point Lighthouse** **Timelapse: Crag Point Lighthouse**
 {{youtube>lD2n8oQi9DA}} {{youtube>lD2n8oQi9DA}}
 +
 +
 +
 +----
 +
 +**My very first video in reforge**
 +{{youtube>BgJ55HdF_EY}}
 +
 +----
 +
 +
 +===== Scratchpad =====
 +
 +
 +
 +<code>
 +
 +
 +//Get the entity (soldier)
 +GenericEntity soldier = GenericEntity.Cast(GetWorld().FindEntityByName("soldier_scripted"));
 +
 +
 +//Control the Soldier.
 +CharacterControllerComponent soldier_c = CharacterControllerComponent.Cast(soldier.FindComponent(CharacterControllerComponent));
 +
 +// change stance
 +soldier_c.SetStanceChange(ECharacterStanceChange.STANCECHANGE_TOCROUCH);
 +
 +// move soldier
 +vector direction = {0,0,1};
 +soldier_c.SetMovement(2, direction);
 +
 +
 +// shoot phase 1
 +soldier_c.SetWeaponRaised(true);
 +soldier_c.SetSafety(false, true);
 +
 +// shoot phase 2
 +soldier_c.SetFireMode(2);
 +soldier_c.SetFireWeaponWanted(1)
 +</code>
 +
 +
 +
 +
 +**RESTAPI** 
 +how to use restApi
 +
 +via ArkensoR (https://discord.com/channels/105462288051380224/976155351999201390/996058255010832525)
 +<code>
 +class TestCallback : RestCallback
 +{
 +    override void OnSuccess( string data, int dataSize )
 +    {
 +        Print(" !!! OnSuccess() size=" + dataSize );
 +        if( dataSize > 0 )
 +            Print(data); // !!! NOTE: Print() will not output string longer than 1024b, check your dataSize !!!
 +    };
 +}
 +...
 +auto ctx = GetGame().GetRestApi().GetContext("https://webhook.site/XXXX-YOUR-GUID-XXXXX");
 +TestCallback callback();
 +//ctx.POST(callback,"RequestPath?Argument=Something", "Hello World");
 +ctx.POST(callback,"RequestPath?Argument=Something", "{\"someVar\": 1337}");
 +</code>
 +
 +
 +**FileHandle**
 +
 +Scripts/Core/generated/System/FileHandle.c
 +
 +<code>
 +FileHandle file = FileIO.OpenFile("$profile:testiik.txt", FileMode.WRITE);
 +if (file != 0)
 +{
 +file.FPrint("A");
 +file.FPrint(file, "B");
 +file.FPrint(file, "C");
 +file.CloseFile();
 +}
 +
 +</code>
 +
 +
  
contributors/jh.1660064735.txt.gz · Last modified: 2022/08/09 18:05 by jerryhopper

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki