Strona G艂贸wna Postal Site

Postal Forum Strona G艂贸wna
Najwi臋ksze na 艣wiecie forum o grach z serii Postal. U nas zawsze jest krwawo!

 SzukajSzukaj  U偶ytkownicyU偶ytkownicy  GrupyGrupy
RejestracjaRejestracja  ZalogujZaloguj  AlbumAlbum
   
 Og艂oszenie 
Zapraszamy wszystkich nowych do udzielania si臋 na naszym forum i do przeczytania Regulaminu.
Zanim napiszesz nowy temat u偶yj opcji szukaj!

Poprzedni temat «» Nast臋pny temat
[ POMOC] podmiana / repleacer
Autor Wiadomo艣膰
Bartkov 
Junior Modder



Pom贸g艂: 2 razy
Wiek: 13
Do艂膮czy艂: 02 Gru 2012
Posty: 414
Sk膮d: Wielkopolska
Wys艂any: 2017-02-01, 18:41   [ POMOC] podmiana / repleacer

Witam, mam pytanie jak napisa膰 repleacer do granatnika? chodzi o to, 偶e zamiast granatnika b臋dzie inna bro艅. Chodzi oczywi艣cie o "艣wietny" granatnik z p2 complete. B臋d臋 wdzi臋czny za pomoc ;)
_________________
Od 艣miechu niedaleko jest do p艂aczu, bo szcz臋艣cie jest kruche jak szk艂o.
 
 
 
Pan Szatan 
Joker
Stalker



Pom贸g艂: 26 razy
Wiek: 17
Do艂膮czy艂: 05 Gru 2013
Posty: 3385
Sk膮d: Metro
Wys艂any: 2017-02-01, 19:04   

W modzie Xetreme Launcher jest repleacer kt贸ry zamienia zwyk艂膮 wyrzutni臋 na w艂a艣nie t膮.
Ja bym spr贸bowa艂 odtworzy膰 sobie te pliki w PostED a potem wyexportowa膰 skrypt i zobaczy膰 jak to dzia艂a ;)
_________________
I'm fucking insane in the brain
 
 
Rycho3D 
Master Modder
嗉 路炭炭墓摊炭炭路炭 炭 嗉



Pom贸g艂: 84 razy
Wiek: 38
Do艂膮czy艂: 24 Kwi 2011
Posty: 5737
Sk膮d: SinCity
Wys艂any: 2017-02-01, 22:45   

Podobnie do tego
Kod:
///////////////////////////////////////////////////////////////////////////////
// Asset Replacer
//
// This is a sample Workshop mod based off of P2GameMod.
// Feel free to copy this code and use it as a basis for your own game mods.
//
// This is a mod that reads in a list of textures and sounds in the default
// properties, and attempts to replace them in-game wherever possible.
//
// Limitations:
// * BSP surfaces can't be messed with. If you want to change the texture on
//   a wall, rebuild the map and include it with your mod.
// * Dialog won't be replaced. Script a new dialog class and assign it to
//   the desired pawns.
// * Some classes change materials or sounds on the fly; this mod won't change
//   those.
// * Certain specific sounds or skins won't be replaced, you'll have to change
//   them manually.
///////////////////////////////////////////////////////////////////////////////
class AssetReplacer extends P2GameMod;

struct MaterialReplaceStruct {
    var() Material OldMaterial, NewMaterial;
};

struct SoundReplaceStruct {
    var() Sound OldSound, NewSound;
};

var() array<MaterialReplaceStruct> MaterialReplace;
var() array<SoundReplaceStruct> SoundReplace;

///////////////////////////////////////////////////////////////////////////////
// ReplaceMaterial
// Attempts to replace passed-in material
///////////////////////////////////////////////////////////////////////////////
function Material ReplaceMaterial(Material ReplaceMe)
{
    local int i;
   
    for (i = 0; i < MaterialReplace.Length; i++)
    {
        if (ReplaceMe == MaterialReplace[i].OldMaterial)
            return MaterialReplace[i].NewMaterial;
    }
   
    return None;
}

///////////////////////////////////////////////////////////////////////////////
// ReplaceSound
// Attempts to replace passed-in sound
///////////////////////////////////////////////////////////////////////////////
function Sound ReplaceSound(Sound ReplaceMe)
{
    local int i;
   
    for (i = 0; i < SoundReplace.Length; i++)
    {
        if (ReplaceMe == SoundReplace[i].OldSound)
            return SoundReplace[i].NewSound;
    }
   
    return None;
}

///////////////////////////////////////////////////////////////////////////////
// ParseActor
// Looks to replace any textures, sounds on new actor
///////////////////////////////////////////////////////////////////////////////
function ParseActor(Actor Other)
{
    local int i, j;
    local Material NewMaterial;
    local Sound NewSound;
    local Name NewName;
   
    if (Other == None)
        return;
   
    // Try Actor skins and sounds
    for (i = 0; i < Other.Skins.Length; i++)
    {
        NewMaterial = ReplaceMaterial(Other.Skins[i]);
        if (NewMaterial != None)
            Other.Skins[i] = NewMaterial;
    }
    NewMaterial = ReplaceMaterial(Other.Texture);
    if (NewMaterial != None)
        Other.Texture = NewMaterial;
    NewSound = ReplaceSound(Other.AmbientSound);
    if (NewSound != None)
        Other.AmbientSound = NewSound;
       
    // Emitters.
    if (Emitter(Other) != None)
    {
        for (i = 0; i < Emitter(Other).Emitters.Length; i++)
        {
            NewMaterial = ReplaceMaterial(Emitter(Other).Emitters[i].Texture);
            if (Texture(NewMaterial) != None)
                Emitter(Other).Emitters[i].Texture = Texture(NewMaterial);
        }
    }
   
    // Sound Things
    if (SoundThing(Other) != None)
    {
        for (i = 0; i < SoundThing(Other).Settings.Sounds.Length; i++)
        {
            NewSound = ReplaceSound(SoundThing(Other).Settings.Sounds[i]);
            if (NewSound != None)
                SoundThing(Other).Settings.Sounds[i] = NewSound;
        }
    }
   
    // Pistol.
    if (PistolWeapon(Other) != None)
    {
        NewSound = ReplaceSound(PistolWeapon(Other).FireSound);
        if (NewSound != None)
            PistolWeapon(Other).FireSound = NewSound;
    }
}

///////////////////////////////////////////////////////////////////////////////
// CheckReplacement
// This function is called for any actor spawned into the world.
// You can use this function to change any default properties of that actor,
// or replace it entirely with something else using ReplaceWith.
// Return FALSE if you replace the actor or just want it to be destroyed.
// Return TRUE if you want to keep the actor and don't want to replace it.
// Unlike other functions you do NOT need to call Super here.
///////////////////////////////////////////////////////////////////////////////
function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
{
    ParseActor(Other);
    return true;
}

///////////////////////////////////////////////////////////////////////////////
// ModifyNPC
// Called by PersonController/AnimalController after adding default inventory.
// Use this function to alter any aspect of the NPC you like.
// At this point the pawn's head and body are set, so we can change their skins
// now!
///////////////////////////////////////////////////////////////////////////////
function ModifyNPC(Pawn Other)
{
    local int i;
    Super.ModifyNPC(Other);
   
    // Do both the body and head separately.
    ParseActor(Other);
    if (P2MocapPawn(Other) != None)
    {
        ParseActor(P2MocapPawn(Other).MyHead);
        // And while we're at it get the boltons too
        for (i = 0; i < P2MocapPawn(Other).MAX_BOLTONS; i++)
            ParseActor(P2MocapPawn(Other).Boltons[i].part);
    }
}

///////////////////////////////////////////////////////////////////////////////
// Default properties required by all P2GameMods.
///////////////////////////////////////////////////////////////////////////////
defaultproperties
{
    // GroupName - any Game Mods with the same GroupName will be considered incompatible, and only one will be allowed to run.
    // Use this if you make mods that are not designed to run alongside each other.
    GroupName=""
    // FriendlyName - the name of your Game Mod, displayed in the game mod menu.
    FriendlyName="Asset Replacer"
    // Description - optional short description of your Game Mod
    Description="Replaces textures and sounds in-game."
   
    MaterialReplace[0]=(OldMaterial=Texture'AnimalSkins.Dog',NewMaterial=Texture'Engine.DefaultTexture')
    MaterialReplace[1]=(OldMaterial=Texture'ChameleonSkins.MB__033__Avg_M_SS_Pants',NewMaterial=Texture'Engine.DefaultTexture')
    SoundReplace[0]=(OldSound=Sound'AnimalSounds.insects.katydid1',NewSound=Sound'AmbientSounds.fart4')
_________________
|Persja STP|AOH|Traffic|P2Tropik|Eliminator|Kropek|M4A1|UfoPorno|
 
 
 
Wy艣wietl posty z ostatnich:   
Odpowiedz do tematu
Nie mo偶esz pisa膰 nowych temat贸w
Nie mo偶esz odpowiada膰 w tematach
Nie mo偶esz zmienia膰 swoich post贸w
Nie mo偶esz usuwa膰 swoich post贸w
Nie mo偶esz g艂osowa膰 w ankietach
Nie mo偶esz za艂膮cza膰 plik贸w na tym forum
Mo偶esz 艣ci膮ga膰 za艂膮czniki na tym forum
Dodaj temat do Ulubionych
Wersja do druku

Skocz do:  

www.Game-State.com www.Game-State.com
www.Game-State.com www.Game-State.com www.Game-State.com
FacebookSteamYouTubeDiscord

Powered by phpBB modified by Przemo © 2003 phpBB Group - forum anime
Style created by Kula & Gozda modified by prawdziwy 666
艢mieszne obrazki