UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Custom actors... How?

HOT
broken avatar :(
Created 7 years ago
by artsergo
0 Members and 1 Guest are viewing this topic.
6,099 views
broken avatar :(
×
broken avatar :(
Location: kh
Date Registered: 9 August 2013
Last active: 5 years ago
Posts
503
Respect
Forum Rank
Zombie Enslaver
Primary Group
Member
×
codmoddd1234's Groups
codmoddd1234's Contact & Social Links
If you want them in the raid_reg category its only 1 line to change it
Open aitype from my post above and change the top line that says
Actor_ally_us_usmc_artsergo
To
Actor_ally_us_raid_reg_artsergo
broken avatar :(
×
broken avatar :(
Location: rusiberia
Date Registered: 3 January 2017
Last active: 7 years ago
Posts
78
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Goodluck for all !
Signature
Believe in your strength, anytime, anywhere!
Only you can force yourself to change something in your life!
But In general, the world itself is beautiful if  you be optimist :)
×
artsergo's Groups
artsergo's Contact & Social Linksartsibsergeiartsergoartsergo
codmoddd1234 thank you!

Double Post Merge: January 30, 2017, 07:53:14 pm

     BluntStuffy and  codmoddd1234 you all very help me... thanks again

Double Post Merge: January 31, 2017, 05:57:30 pm

 how make for actors when they spawning that have other weapons but not one (example: thompson)
:)) just its funny )
Last Edit: January 31, 2017, 06:00:09 pm by artsergo
broken avatar :(
×
broken avatar :(
Location: rusiberia
Date Registered: 3 January 2017
Last active: 7 years ago
Posts
78
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Goodluck for all !
×
artsergo's Groups
artsergo's Contact & Social Linksartsibsergeiartsergoartsergo

Double Post Merge: February 01, 2017, 02:34:20 pm
   hi for all!  :)

   BluntStuffy or anyone talk me, please.
   here, on a sea in this forum, I found a some code about randoms topic and i remade this code.
   Right I remade code for random weapons for allies spawners?   ::)
   or its need add part code (for allies or axis working too)
   and right, that this code need placed in main gcs-script or its need placed in the character-file?

   remake code is such:
   
Code Snippet
Plaintext
////// add in main gsc of your map /////////
main()
{
        maps\_load::main();
        thread random_weapons();
}


/////// random weapons for allies /////////
random_weapons()
{
   weapArray = [];
   weapArray[ weapArray.size ] = "m1garand";
   weapArray[ weapArray.size ] = "colt";
   weapArray[ weapArray.size ] = "thompson";
   weapArray[ weapArray.size ] = "MachineGuns";
   weapArray[ weapArray.size ] = "m1carbine";
   weapArray[ weapArray.size ] = "springfield";
   weapArray[ weapArray.size ] = "svt40";
   weapArray[ weapArray.size ] = "Shotgun";
   keys = GetArrayKeys( weapArray );
   return weapArray[RandomInt( weapArray.size )];
}
 
    :)

Double Post Merge: February 01, 2017, 03:39:14 pm
can any say me? please
i want make today )

Double Post Merge: February 01, 2017, 04:44:36 pm

   no. this is no working, which wrote above.  :-\

  but I found new example code (may be this code - ok? )
  Help me, please.  ::)

Code Snippet
Plaintext
main()
{

// other code
thread chooseWeaponClass();
// other code

}

chooseWeaponClass( howManyCanSpawn )
{
// Add classes here
// You can stress/bug test a class by commenting out the rest
weaponClass = [];
weaponClass[weaponClass.size] = "Defender";
weaponClass[weaponClass.size] = "Attacker";
weaponClass[weaponClass.size] = "Stealer";
weaponClass[weaponClass.size] = "Kamikaze";

// Cycle and choose classes going
// Then spawn.
for( x = 0 ; x < howManyCanSpawn ; x++ )
{
eSpawner = undefined;

tempClass = array_randomize( weaponClass );
classToSpawn = tempClass[RandomInt( tempClass.size )];

guyWeapon = thread weaponClassThink( classToSpawn );

switch( guyWeapon )
{
//case "ptrs41":
//case "kar98k":
//case "gewehr43":
//case "shotgun":
case "thompson":
case "m1garand":
       eSpawner = findSpawnerScript( "rifle" );
   break;

case "m2_flamethrower":
    eSpawner = findSpawnerScript( "flame" );
    break;

case "stg44":
case "mp40":
     eSpawner = findSpawnerScript( "smg" );
     break;


default:
eSpawner = findSpawnerScript( "rifle" );
break;
}

wait( 0.3 );
eSpawned = eSpawner doSpawn();
if( spawn_failed( eSpawned ) )
{
// empty check
}

else
{
eSpawned thread spawnEvent( classToSpawn, guyWeapon );
//eSpawned thread flyingBodies();
}
}
}

   ::) help me

Last Edit: February 01, 2017, 04:44:36 pm by artsergo
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
Signature
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
You need to find the spawn-function for your AI ( in zombies it's in _zombiemode_spawner, yours would prob be _spawner but i have no SP experience whatsoever ).

Then try;

Code Snippet
Plaintext
	ai animscripts\shared::placeWeaponOn( "m1garand", "right" ); 


Maybe you need to do this first, i'm not sure:
Code Snippet
Plaintext
ai animscripts\shared::detachWeapon( ai.primaryweapon );

broken avatar :(
×
broken avatar :(
Location: rusiberia
Date Registered: 3 January 2017
Last active: 7 years ago
Posts
78
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Goodluck for all !
×
artsergo's Groups
artsergo's Contact & Social Linksartsibsergeiartsergoartsergo

   this is part code for which example from two
    :)
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
   this is part code for which example from two
    :)

 ??? i dont understand what you mean..
broken avatar :(
×
broken avatar :(
Location: rusiberia
Date Registered: 3 January 2017
Last active: 7 years ago
Posts
78
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Goodluck for all !
×
artsergo's Groups
artsergo's Contact & Social Linksartsibsergeiartsergoartsergo
   :)
   my post #17 has two example code.
   which a script from two scripts to try your variant code?

   just i don't understand where is your code need insert:

Code Snippet
Plaintext
 ai animscripts\shared::placeWeaponOn( "m1garand", "right" ); 

  //or

  ai animscripts\shared::detachWeapon( ai.primaryweapon );

  :)

-----

p.s.
and that to interesting, these two codes don't work.
And do not show errors
Last Edit: February 02, 2017, 06:09:12 pm by artsergo
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
Your two examples will not work, your first example only creates an array of weapon-names and that's it ( unless you have more code but didn't post it ).
your second example is either missing some code, or it will not work as well. As far as i can tell there's nothing actually giving the weapon to an ai.


I mentioned i dont know where to place them or if they work, because i dont mod SP. I mod Zombies ( it's a zombie-forum after all  :D ).
If i had to try i would put them in _spawner in the function 'spawn_think_action( targetname )' , right under these lines:

Code Snippet
Plaintext
	else if( IsDefined( self.script_banzai_spawn ) )
{
self thread maps\_banzai::spawned_banzai_immediate();
}

you add:

Code Snippet
Plaintext
 self animscripts\shared::placeWeaponOn( "m1garand", "right" );


You have to have those weapons loaded correctly in your map ( so loaded in a .csv etc ) or it wont work either.



If it turns out this code works to replace an ai's weapon, then i can tell you how to randomize it but let's start simple..




If you really want to get into this, you might want to read up on some scripting basics and learn to read code so you know what it does/how it works. Specially for SP you're not going to find a lot of people with experience here.
I can tell you are willing to learn/try stuff and invest time, so then i suggest read/watch tutorials for scripting in general it will benefit you with everything you want to make!
Last Edit: February 02, 2017, 06:38:05 pm by BluntStuffy
broken avatar :(
×
broken avatar :(
Location: rusiberia
Date Registered: 3 January 2017
Last active: 7 years ago
Posts
78
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Goodluck for all !
×
artsergo's Groups
artsergo's Contact & Social Linksartsibsergeiartsergoartsergo
Yes. I agree )
I just more interesting. as one, as the other. )
broken avatar :(
×
broken avatar :(
Location: rusiberia
Date Registered: 3 January 2017
Last active: 7 years ago
Posts
78
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Goodluck for all !
×
artsergo's Groups
artsergo's Contact & Social Linksartsibsergeiartsergoartsergo
 
    Now, this is source scripts for randomized weapons for actors who loading with start map, and
    ramdomized script for spawners / respawners allies
    (all with help codmoddd1234) thanks!

   

    source scripts (I wrote full description for customing actors and add):
    http://www.mediafire.com/file/avvxml69ztafyp4/customs_randoms.rar
 
Last Edit: February 09, 2017, 03:20:40 pm by artsergo

 
Loading ...