Quantcast

Jump to content

» «
Photo

[W.I.P] Police Blackout Escape Inspired By Watch Dogs

41 replies to this topic
UltraNineNine
  • UltraNineNine

    Nothing Is Really Over Until The Moment You Stop Trying

  • Members
  • Joined: 13 Mar 2014
  • None

#31

Posted 13 June 2014 - 01:55 PM Edited by UltraNineNine, 16 June 2014 - 01:26 AM.

I wish if you make it c#

You could convert my code to c# here:http://converter.telerik.com/
 

  • WEISHENCHENG99 likes this

UltraNineNine
  • UltraNineNine

    Nothing Is Really Over Until The Moment You Stop Trying

  • Members
  • Joined: 13 Mar 2014
  • None

#32

Posted 13 June 2014 - 02:05 PM Edited by UltraNineNine, 16 June 2014 - 01:25 AM.

 

.

 
This will disable the vehicle light too

For Each v As Vehicle In World.GetVehicles(Player.Character.Position, 30)                If Exists(v) Then                    v.EngineRunning = False                End If
try using this native for vehicle lights:
FORCE_ALL_VEHICLE_LIGHTS_OFF(boolean off);
 
 
For streetlamps... use THIS!
public bool Nox(String name, GTA.Object obj, double Xx, double Yy, double Zz)    {        if (obj.Model == name)        {            Vector3 noxVectorum = obj.GetOffsetPosition(new Vector3((float)Xx, (float)Yy, (float)Zz));            World.AddExplosion(noxVectorum,                ExplosionType.Molotov,                1f, false, true, 0f);            Wait(1);            return true;        }        return false;    }    public void Deluminate()    {        Game.DisplayText("Deluminate!");        foreach (GTA.Object obj in World.GetAllObjects())        {            if (Exists(obj))            {                if(Nox("CJ_NYLAMP1", obj, -1.82063600, 0.02231500, 6.33843700)) { continue; }                if(Nox("CJ_NYLAMP2", obj, -2.17200700, 0.12333000, 8.01229700)) { continue; }                if(Nox("CJ_NYLAMP2b", obj, 2.21655300, 0.12538500, 8.00557600)) { continue; }                if(Nox("BM_NYlamp1", obj, -2.36057700, -0.04451300, 9.00610300)) { continue; }                if(Nox("BM_NYlamp1_italy", obj, -2.36051900, -0.04246800, 9.00714800)) { continue; }                if(Nox("BM_NYlamp10", obj, 1.10564800, -0.02796000, 6.95975000)) { continue; }                if(Nox("BM_NYlamp110b", obj, -1.15087100, -0.02192500, 6.95975000)) { continue; }                if(Nox("BM_NYlamp12", obj, 0.50356900, 0.00084300, 3.08407400)) { continue; }                if(Nox("BM_NYlamp1a", obj, -2.35546000, -0.04351300, 9.00610300)) { continue; }                if(Nox("BM_NYlamp1b", obj, 1.58855900, -0.03478700, 7.78166800)) { continue; }                if(Nox("BM_NYlamp1c", obj, -2.36583400, -0.04447800, 9.00714800)) { continue; }                if(Nox("BM_NYlamp2a", obj, 2.86529300, -0.03331400, 7.23945800)) { continue; }                if(Nox("BM_NYlamp2b", obj, 2.56053300, -0.03848800, 7.68502200)) { continue; }                if(Nox("BM_NYlamp3", obj, 0.58802200, 0.00009400, 6.62310900)) { continue; }                if(Nox("BM_NYlamp4", obj, 0.00244300, -0.00017500, 3.41847400)) { continue; }                if(Nox("BM_NYlamp5", obj, 0.00000000, 0.00000000, 2.59286800)) { continue; }                if(Nox("BM_NYlamp6", obj, -0.00296800, 0.90626500, 7.07489600)) { continue; }                if(Nox("BM_NYlamp6a", obj, 0.00018300, -0.99192200, 7.07489500)) { continue; }                if(Nox("BM_NYlamp6c", obj, 0.00302100, 0.90626500, 7.07489600)) { continue; }                if(Nox("BM_NYlamp7", obj, 0.42898600, 0.00000000, 3.51846300)) { continue; }                if(Nox("BM_NYlamp7_b", obj, -0.42384300, -0.00064000, 3.51846200)) { continue; }                if(Nox("BM_NYlamp7_c", obj, 0.42520900, -0.00085800, 3.51846300)) { continue; }                if(Nox("BM_NYlamp8a", obj, -0.04518500, -0.04813000, 4.05437000)) { continue; }                if(Nox("BM_NYlamp9", obj, 2.59298700, -0.03134200, 6.98542600)) { continue; }                if(Nox("CJ_DM_LIGHT_1", obj, -0.00109900, 0.00061100, 1.03649400)) { continue; }                if(Nox("BM_wall_light_06", obj, -0.00118600, -0.28953200, 0.18201800)) { continue; }                if(Nox("BM_Fount_Lamp", obj, -0.36859100, -0.00169400, 1.54113400)) { continue; }            }        }    }
Took me a bit to get all those values.. lol


Just played around with it and its pretty cool :D

I strongly suggest to read and learn from this code, don't just copy and paste ;)

That's my way of learning scripting man :)

  • WEISHENCHENG99 likes this

LetsPlayOrDy
  • LetsPlayOrDy

    Too fast for ya

  • Members
  • Joined: 24 Aug 2013
  • United-States

#33

Posted 13 June 2014 - 02:19 PM

 

I wish if you make it c#

. You could convert my code to c# here:http://converter.telerik.com/
 

 

 

Oh... I thought he wanted Infamous's code to be in C#, which already is


InfamousSabre
  • InfamousSabre

    Harpocrates

  • Members
  • Joined: 03 Jan 2013

#34

Posted 13 June 2014 - 08:52 PM Edited by InfamousSabre, 13 June 2014 - 08:53 PM.

Updated a bit for dual lamped street lights. I noticed some weren't turning off. Those same ones though, seem to have an invincible glass on one side. Weird. The light still goes off though.
 

public bool Nox(String name, GTA.Object obj, double Xx, double Yy, double Zz)
    {
        if (obj.Model == name)
        {
            Vector3 noxVectorum = obj.GetOffsetPosition(new Vector3((float)Xx, (float)Yy, (float)Zz));
            World.AddExplosion(noxVectorum,
                ExplosionType.Molotov,
                1f, false, true, 0f);
            Wait(1);
            return true;
        }
        return false;
    }

    public void Deluminate()
    {
        Game.DisplayText("Deluminate!");
        foreach (GTA.Object obj in World.GetAllObjects())
        {
            if (Exists(obj))
            {
                if(Nox("CJ_NYLAMP1", obj, -1.82063600, 0.02231500, 6.33843700)) { continue; }
                if(Nox("CJ_NYLAMP2", obj, -2.17200700, 0.12333000, 8.01229700)) { continue; }
                if(Nox("BM_NYlamp1", obj, -2.36057700, -0.04451300, 9.00610300)) { continue; }
                if(Nox("BM_NYlamp1_italy", obj, -2.36051900, -0.04246800, 9.00714800)) { continue; }
                if (Nox("BM_NYlamp10", obj, 1.10564800, -0.02796000, 6.95975000)) { continue; }
                if (Nox("BM_NYlamp3", obj, 0.58802200, 0.00009400, 6.62310900)) { continue; }
                if (Nox("BM_NYlamp4", obj, 0.00244300, -0.00017500, 3.41847400)) { continue; }
                if (Nox("BM_NYlamp5", obj, 0.00000000, 0.00000000, 2.59286800)) { continue; }
                if (Nox("BM_NYlamp6", obj, -0.00296800, 0.90626500, 7.07489600)) { continue; }
                if (Nox("BM_NYlamp6a", obj, 0.00018300, -0.99192200, 7.07489500)) { continue; }
                if (Nox("BM_NYlamp6c", obj, 0.00302100, 0.90626500, 7.07489600)) { continue; }
                if (Nox("BM_NYlamp7", obj, 0.42898600, 0.00000000, 3.51846300)) { continue; }
                if (Nox("BM_NYlamp7_c", obj, 0.42520900, -0.00085800, 3.51846300)) { continue; }
                if (Nox("BM_NYlamp8a", obj, -0.04518500, -0.04813000, 4.05437000)) { continue; }
                if (Nox("BM_NYlamp9", obj, 2.59298700, -0.03134200, 6.98542600)) { continue; }
                if (Nox("CJ_DM_LIGHT_1", obj, -0.00109900, 0.00061100, 1.03649400)) { continue; }
                if (Nox("BM_wall_light_06", obj, -0.00118600, -0.28953200, 0.18201800)) { continue; }
                if (Nox("BM_Fount_Lamp", obj, -0.36859100, -0.00169400, 1.54113400)) { continue; }
                if (Nox("BM_NYlamp12", obj, 0.50356900, 0.00084300, 3.08407400)) { continue; }
                if (Nox("BM_NYlamp1a", obj, -2.35546000, -0.04351300, 9.00610300)) { continue; }
                if (Nox("BM_NYlamp1c", obj, -2.36583400, -0.04447800, 9.00714800)) { continue; }
                if (Nox("BM_NYlamp2a", obj, 2.86529300, -0.03331400, 7.23945800)) { continue; }

                Nox("BM_NYlamp110b", obj, -1.15087100, -0.02192500, 6.95975000);
                if (Nox("BM_NYlamp110b", obj, 1.10668200, -0.02192600, 6.95970100)) { continue; }

                Nox("CJ_NYLAMP2b", obj, 2.21655300, 0.12538500, 8.00557600);
                if (Nox("CJ_NYLAMP2b", obj, -2.17667800, 0.12343800, 8.00720200)) { continue; }

                Nox("BM_NYlamp1b", obj, 1.58855900, -0.03478700, 7.78166800);
                if (Nox("BM_NYlamp1b", obj, -1.61765900, -0.03474597, 7.78166600)) { continue; }

                Nox("BM_NYlamp2b", obj, 2.56053300, -0.03848800, 7.68502200);
                if (Nox("BM_NYlamp2b", obj, -2.58014900, -0.03065500, 7.68636900)) { continue; }

                Nox("BM_NYlamp7_b", obj, -0.42384300, -0.00064000, 3.51846200);
                if (Nox("BM_NYlamp7_b", obj, 0.42632300, -0.00030500, 3.51846200)) { continue; }
            }
        }
    }

UltraNineNine
  • UltraNineNine

    Nothing Is Really Over Until The Moment You Stop Trying

  • Members
  • Joined: 13 Mar 2014
  • None

#35

Posted 16 June 2014 - 01:19 AM Edited by UltraNineNine, 21 June 2014 - 08:06 AM.

 

Updated a bit for dual lamped street lights. I noticed some weren't turning off. Those same ones though, seem to have an invincible glass on one side. Weird. The light still goes off though.
 

public bool Nox(String name, GTA.Object obj, double Xx, double Yy, double Zz)
    {
        if (obj.Model == name)
        {
            Vector3 noxVectorum = obj.GetOffsetPosition(new Vector3((float)Xx, (float)Yy, (float)Zz));
            World.AddExplosion(noxVectorum,
                ExplosionType.Molotov,
                1f, false, true, 0f);
            Wait(1);
            return true;
        }
        return false;
    }

    public void Deluminate()
    {
        Game.DisplayText("Deluminate!");
        foreach (GTA.Object obj in World.GetAllObjects())
        {
            if (Exists(obj))
            {
                if(Nox("CJ_NYLAMP1", obj, -1.82063600, 0.02231500, 6.33843700)) { continue; }
                if(Nox("CJ_NYLAMP2", obj, -2.17200700, 0.12333000, 8.01229700)) { continue; }
                if(Nox("BM_NYlamp1", obj, -2.36057700, -0.04451300, 9.00610300)) { continue; }
                if(Nox("BM_NYlamp1_italy", obj, -2.36051900, -0.04246800, 9.00714800)) { continue; }
                if (Nox("BM_NYlamp10", obj, 1.10564800, -0.02796000, 6.95975000)) { continue; }
                if (Nox("BM_NYlamp3", obj, 0.58802200, 0.00009400, 6.62310900)) { continue; }
                if (Nox("BM_NYlamp4", obj, 0.00244300, -0.00017500, 3.41847400)) { continue; }
                if (Nox("BM_NYlamp5", obj, 0.00000000, 0.00000000, 2.59286800)) { continue; }
                if (Nox("BM_NYlamp6", obj, -0.00296800, 0.90626500, 7.07489600)) { continue; }
                if (Nox("BM_NYlamp6a", obj, 0.00018300, -0.99192200, 7.07489500)) { continue; }
                if (Nox("BM_NYlamp6c", obj, 0.00302100, 0.90626500, 7.07489600)) { continue; }
                if (Nox("BM_NYlamp7", obj, 0.42898600, 0.00000000, 3.51846300)) { continue; }
                if (Nox("BM_NYlamp7_c", obj, 0.42520900, -0.00085800, 3.51846300)) { continue; }
                if (Nox("BM_NYlamp8a", obj, -0.04518500, -0.04813000, 4.05437000)) { continue; }
                if (Nox("BM_NYlamp9", obj, 2.59298700, -0.03134200, 6.98542600)) { continue; }
                if (Nox("CJ_DM_LIGHT_1", obj, -0.00109900, 0.00061100, 1.03649400)) { continue; }
                if (Nox("BM_wall_light_06", obj, -0.00118600, -0.28953200, 0.18201800)) { continue; }
                if (Nox("BM_Fount_Lamp", obj, -0.36859100, -0.00169400, 1.54113400)) { continue; }
                if (Nox("BM_NYlamp12", obj, 0.50356900, 0.00084300, 3.08407400)) { continue; }
                if (Nox("BM_NYlamp1a", obj, -2.35546000, -0.04351300, 9.00610300)) { continue; }
                if (Nox("BM_NYlamp1c", obj, -2.36583400, -0.04447800, 9.00714800)) { continue; }
                if (Nox("BM_NYlamp2a", obj, 2.86529300, -0.03331400, 7.23945800)) { continue; }

                Nox("BM_NYlamp110b", obj, -1.15087100, -0.02192500, 6.95975000);
                if (Nox("BM_NYlamp110b", obj, 1.10668200, -0.02192600, 6.95970100)) { continue; }

                Nox("CJ_NYLAMP2b", obj, 2.21655300, 0.12538500, 8.00557600);
                if (Nox("CJ_NYLAMP2b", obj, -2.17667800, 0.12343800, 8.00720200)) { continue; }

                Nox("BM_NYlamp1b", obj, 1.58855900, -0.03478700, 7.78166800);
                if (Nox("BM_NYlamp1b", obj, -1.61765900, -0.03474597, 7.78166600)) { continue; }

                Nox("BM_NYlamp2b", obj, 2.56053300, -0.03848800, 7.68502200);
                if (Nox("BM_NYlamp2b", obj, -2.58014900, -0.03065500, 7.68636900)) { continue; }

                Nox("BM_NYlamp7_b", obj, -0.42384300, -0.00064000, 3.51846200);
                if (Nox("BM_NYlamp7_b", obj, 0.42632300, -0.00030500, 3.51846200)) { continue; }
            }
        }
    }

Good job Infamous you help me a lot,I have updated the source code at the first page and convert my code to C#,now I'm making the white line effect from this video:https://www.youtube....h?v=bWf8QalPP7w should't be difficult :)

  • WEISHENCHENG99 likes this

WEISHENCHENG99
  • WEISHENCHENG99

    Player Hater

  • Members
  • Joined: 05 Feb 2014
  • Bulgaria

#36

Posted 22 June 2014 - 09:45 AM Edited by WEISHENCHENG99, 22 June 2014 - 10:02 AM.

Wow this script is awesome,I play around with it and it's cool. Although,Can you make the police that is arresting the player look shocked when the light is turning off. That will improve the AI system :lol: .


UltraNineNine
  • UltraNineNine

    Nothing Is Really Over Until The Moment You Stop Trying

  • Members
  • Joined: 13 Mar 2014
  • None

#37

Posted 22 June 2014 - 09:46 AM Edited by UltraNineNine, 22 June 2014 - 10:04 AM.

Wow this script is awesome,I play around with it and it's cool. Although,Can you make the police that is arresting the player look shocked when the light is turning off. That will improve the AI system :lol: .

I can do that but I need the shocked animation first :)

  • WEISHENCHENG99 likes this

WEISHENCHENG99
  • WEISHENCHENG99

    Player Hater

  • Members
  • Joined: 05 Feb 2014
  • Bulgaria

#38

Posted 22 June 2014 - 09:53 AM Edited by WEISHENCHENG99, 22 June 2014 - 10:06 AM.

 

Wow this script is awesome,I play around with it and it's cool. Although,Can you make the police that is arresting the player look shocked when the light is turning off. That will improve the AI system :lol: .

I can do that but I need the shocked animation first :)

I already found it,use this:

Private peds As GTA.Ped

Dim AnimSet2 As AnimationSet
Dim AnimName2 As String = ("shock_d")

AnimSet2 = New AnimationSet("amb@shock")

For Each peds As GTA.Ped In World.GetAllPeds
                If Exists(peds) Then
                    peds.Animation.Play(AnimSet2, AnimName2, 8, AnimationFlags.Unknown05 Or AnimationFlags.Unknown06)
                End If
            Next

The AnimationFlags.Unknown05 represents loop animation while AnimationFlags.Unknown06 represents to stop the ped in the last animation position

The anim are not the best but if you find the other anim then feel free to change it


UltraNineNine
  • UltraNineNine

    Nothing Is Really Over Until The Moment You Stop Trying

  • Members
  • Joined: 13 Mar 2014
  • None

#39

Posted 22 June 2014 - 10:00 AM Edited by UltraNineNine, 22 June 2014 - 10:01 AM.

I already found it,use this:

Private peds As GTA.Ped

Dim AnimSet2 As AnimationSet
Dim AnimName2 As String = ("shock_d")

AnimSet2 = New AnimationSet("amb@shock")

For Each peds As GTA.Ped In World.GetAllPeds
                If Exists(peds) Then
                    peds.Animation.Play(AnimSet2, AnimName2, 8, AnimationFlags.Unknown05 Or AnimationFlags.Unknown06)
                End If
            Next

The AnimationFlags.Unknown05 represents loop animation while AnimationFlags.Unknown06 represents to stop the ped in the last animation position

The anim are not the best but if you find the other anim then feel free to change it

 

It seem that your method make the player execute the anim too

  • WEISHENCHENG99 likes this

Noox
  • Noox

    changeScriptAbility(&myScriptAbility, "improve");

  • Members
  • Joined: 20 Jun 2014
  • None

#40

Posted 22 June 2014 - 10:10 AM Edited by Noox, 22 June 2014 - 10:14 AM.

Not sure how VB works but to avoid that you have to change the condition and I noticed (not sure if I'm wrong here) Niko is always the first ped.

if(Exists(peds) && peds != Player.Character)
    //anim

UltraNineNine
  • UltraNineNine

    Nothing Is Really Over Until The Moment You Stop Trying

  • Members
  • Joined: 13 Mar 2014
  • None

#41

Posted 22 June 2014 - 10:25 AM Edited by UltraNineNine, 22 June 2014 - 10:32 AM.

 

Not sure how VB works but to avoid that you have to change the condition and I noticed (not sure if I'm wrong here) Niko is always the first ped.

if(Exists(peds) && peds != Player.Character)
    //anim

Thx,I translate your code to VB and set it like this and now player won't be affect with the anim anymore.

 For Each peds As GTA.Ped In World.GetAllPeds
                If (Exists(peds) _
            AndAlso (peds <> Player.Character)) Then
                    peds.Task.ClearAllImmediately()
                    peds.Animation.Play(AnimSet2, AnimName2, 8, AnimationFlags.Unknown05 Or AnimationFlags.Unknown06)
                End If
            Next
  • WEISHENCHENG99 likes this

Noox
  • Noox

    changeScriptAbility(&myScriptAbility, "improve");

  • Members
  • Joined: 20 Jun 2014
  • None

#42

Posted 22 June 2014 - 11:06 AM

No problems!





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users