Animated Barkin Doggos (Prefab help!)

broken avatar :(
Created 581 days ago
by
0 Members and 1 Guest are viewing this topic.
798 views
broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
User
Date Registered: N/A
Last active: N/A
Posts
N/A
Respect
Primary Group
Deleted Member
×
DeletedUser's Groups
DeletedUser's Contact & Social Links
So i need help with this Prefab! Im using these dogs for scenery in my map.

I do everthing it says but i end up with a bad syntax error...and i removed everything that i did to make sure it was this prefab and surely enough the map worked fine when i removed all the barkin dog stuff...

GSC Code in the prefab:
#include common_scripts\utility;
#include maps\_utility;
#include maps\_music;
#include maps\_anim;
#include animscripts\shared;
#include animscripts\utility;
#using_animtree( "dog" );
//////////////////
//in mapname.gsc
//maps\_zombiemode::main();
//thread maps\animated_dogs::setup_animated_barking_dogs();
///////////////////
//add to mod.csv
/*
xanim,german_shepherd_sleeping
xanim,german_shepherd_eating_loop
xanim,german_shepherd_attackidle_bark
xanim,german_shepherd_idle
*/
//

setup_animated_barking_dogs()
{
animated_barking_dogs = GetEntarray( "animated_barking_dogs", "targetname" );
array_thread( animated_barking_dogs, ::set_anim_playback_rate_dogs );
}
set_anim_playback_rate_dogs()
{
self useAnimTree( #animtree );
self endon("killanimscript");
self.animplaybackrate = 0.9 + randomfloat( 0.2 );
self.moveplaybackrate = 1;
self clearanim(%german_shepherd_attackidle_knob, 0.1);
while (1)
{
self attackidle_bark();
self animscripts\shared::DoNoteTracks("done");
}
}
attackidle_bark()
{
if( isdefined( self.script_noteworthy ) && self.script_noteworthy == "german_shepherd_idle" )
{
self setflaggedanimrestart( "dog_idle", %german_shepherd_idle, 1, 0.2, self.animplaybackrate );
}
if( isdefined( self.script_noteworthy ) && self.script_noteworthy == "german_shepherd_sleeping" )
{
self setflaggedanimrestart( "dog_idle", %german_shepherd_sleeping, 1, 0.2, self.animplaybackrate );
}
if( isdefined( self.script_noteworthy ) && self.script_noteworthy == "german_shepherd_eating_loop" )
{
self setflaggedanimrestart( "dog_idle", %german_shepherd_eating_loop, 1, 0.2, self.animplaybackrate );
}
if( isdefined( self.script_noteworthy ) && self.script_noteworthy == "german_shepherd_attackidle_bark" )
{
self setflaggedanimrestart( "dog_idle", %german_shepherd_attackidle_bark, 1, 0.2, self.animplaybackrate );
}
}

So i added #Include and the #Using anim tree to my Utilities tab in mymapname.gsc and when i added all this stuff i got a bad syntax error. I am not sure what the problem is. The code at the bottom is not the issue either! It's only the #Include and #Using_animtree stuff that is causing issues...it's required in order for this to work! But for some reason it gives me a bad syntax!
broken avatar :(
×
broken avatar :(
Location: nl
Date Registered: 20 September 2013
Last active: 3 days ago
Posts
346
Respect
Forum Rank
Perk Hacker
Primary Group
Community Scripter
×
gympie6's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
gympie6's Contact & Social LinksDistenc5Teffrie
So i need help with this Prefab! Im using these dogs for scenery in my map.

I do everthing it says but i end up with a bad syntax error...and i removed everything that i did to make sure it was this prefab and surely enough the map worked fine when i removed all the barkin dog stuff...

GSC Code in the prefab:
#include common_scripts\utility;
#include maps\_utility;
#include maps\_music;
#include maps\_anim;
#include animscripts\shared;
#include animscripts\utility;
#using_animtree( "dog" );
//////////////////
//in mapname.gsc
//maps\_zombiemode::main();
//thread maps\animated_dogs::setup_animated_barking_dogs();
///////////////////
//add to mod.csv
/*
xanim,german_shepherd_sleeping
xanim,german_shepherd_eating_loop
xanim,german_shepherd_attackidle_bark
xanim,german_shepherd_idle
*/
//

setup_animated_barking_dogs()
{
animated_barking_dogs = GetEntarray( "animated_barking_dogs", "targetname" );
array_thread( animated_barking_dogs, ::set_anim_playback_rate_dogs );
}
set_anim_playback_rate_dogs()
{
self useAnimTree( #animtree );
self endon("killanimscript");
self.animplaybackrate = 0.9 + randomfloat( 0.2 );
self.moveplaybackrate = 1;
self clearanim(%german_shepherd_attackidle_knob, 0.1);
while (1)
{
self attackidle_bark();
self animscripts\shared::DoNoteTracks("done");
}
}
attackidle_bark()
{
if( isdefined( self.script_noteworthy ) && self.script_noteworthy == "german_shepherd_idle" )
{
self setflaggedanimrestart( "dog_idle", %german_shepherd_idle, 1, 0.2, self.animplaybackrate );
}
if( isdefined( self.script_noteworthy ) && self.script_noteworthy == "german_shepherd_sleeping" )
{
self setflaggedanimrestart( "dog_idle", %german_shepherd_sleeping, 1, 0.2, self.animplaybackrate );
}
if( isdefined( self.script_noteworthy ) && self.script_noteworthy == "german_shepherd_eating_loop" )
{
self setflaggedanimrestart( "dog_idle", %german_shepherd_eating_loop, 1, 0.2, self.animplaybackrate );
}
if( isdefined( self.script_noteworthy ) && self.script_noteworthy == "german_shepherd_attackidle_bark" )
{
self setflaggedanimrestart( "dog_idle", %german_shepherd_attackidle_bark, 1, 0.2, self.animplaybackrate );
}
}

So i added #Include and the #Using anim tree to my Utilities tab in mymapname.gsc and when i added all this stuff i got a bad syntax error. I am not sure what the problem is. The code at the bottom is not the issue either! It's only the #Include and #Using_animtree stuff that is causing issues...it's required in order for this to work! But for some reason it gives me a bad syntax!

Have you tried running the map with developer 1?
Most of the time it tells you what is wrong.
If that is not going to help you plz send me the link to the tutorial and I will take a look for you. :)
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 2 hours ago
Posts
1,179
Respect
1,371Add +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
[RELEASED] Greenhouse Realism 3.0: [You are not allowed to view external links. Register or Login to see them]

NUK370WN Realism 3.0: [You are not allowed to view external links. Register or Login to see them]
Industrial Estate Realism 3.0: [You are not allowed to view external links. Register or Login to see them]

Support my work here:  [You are not allowed to view external links. Register or Login to see them]
×
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
Quote
So i added #Include and the #Using anim tree to my Utilities tab in mymapname.gsc

Not sure what you mean with that, but the instuctions say all you should add in your mapname.gsc is this line:
thread maps\animated_dogs::setup_animated_barking_dogs();

And add that right under the existing line:
maps\_zombiemode::main();


That's all you should do for 'scripting'
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 19 March 2018
Last active: 579 days ago
Posts
25
Respect
Forum Rank
Legless Crawler
Primary Group
Member
Personal Quote
Salem
×
Haaagaibmsirirla's Contact & Social Links
barking doggos lol
broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
User
Date Registered: N/A
Last active: N/A
Posts
N/A
Respect
Primary Group
Deleted Member
×
DeletedUser's Groups
DeletedUser's Contact & Social Links
Not sure what you mean with that, but the instuctions say all you should add in your mapname.gsc is this line:
thread maps\animated_dogs::setup_animated_barking_dogs();

And add that right under the existing line:
maps\_zombiemode::main();


That's all you should do for 'scripting'

OK SO I FOUND THE PROBLEM :D So apparently there was a typo...i apologize for wasting anyone's time on this.

 

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 Twitch
Loading ...