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

Need help to code a cool way to unlock Pap

broken avatar :(
Created 8 years ago
by fusorf
0 Members and 1 Guest are viewing this topic.
3,945 views
broken avatar :(
×
broken avatar :(
Location: fr
Date Registered: 25 July 2015
Last active: 2 years ago
Posts
121
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
Personal Quote
//This is a comment
Signature
×
fusorf's Groups
fusorf's Contact & Social LinksfusorffusorfFireFusorf
Hey guys!

I have been thinking of a way to unlock the PaP in my map, the thing is I barely know where to start to implement it in game.
I know how to code (C and Java), but i'm lost when it comes to Waw : in which file to write, and how to link the script to ingame events in radiant?

I'm basically looking for someone to assist me with making this script. Not necessarily make everything for me, as I would like to learn so that I can do it by myself in the future. :)

Here's the idea :

Every 2 rounds until round 15, a plane passes by over the map. You have to shoot it with a rocket launcher. You can only hit it once every round. Each hit adds fire to one of its engines, and when it was hit 4 times, the plane crashes down, dropping the pack a punch on the map.

I know it's very specific and kinda complex but if you guys could help me with this and teach me a bit it would be awesome  :gusta:

Thanks!
broken avatar :(
×
broken avatar :(
Location: gbNewport
Date Registered: 2 November 2014
Last active: 2 years ago
Posts
1,265
Respect
Forum Rank
Zombie Colossus
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Embrace the Darkness
×
Tim Smith's Groups
Tim Smith's Contact & Social Linkstimsmith90THEREALBaDBoY17TimSmithMy clan Website
Why rocket luncher when you can do it like origins fire staff part. You need to have the model and then play fx on a tag. When shot delete the model and the fx. And open a door to PAP. I'm not home to write the script for you. But i'm sure someone will :).
broken avatar :(
×
broken avatar :(
Location: gbNewport
Date Registered: 2 November 2014
Last active: 2 years ago
Posts
1,265
Respect
Forum Rank
Zombie Colossus
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Embrace the Darkness
×
Tim Smith's Groups
Tim Smith's Contact & Social Linkstimsmith90THEREALBaDBoY17TimSmithMy clan Website
Well i will not call my self a scripter yet. But spent the last month learning and looking into treyarch scripts. Ofc with a lot of help from other people. Like harry, redspace blunt etc.. Still i can script basic stuff, still learning thou :).
broken avatar :(
×
broken avatar :(
Location: fr
Date Registered: 25 July 2015
Last active: 2 years ago
Posts
121
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
Personal Quote
//This is a comment
×
fusorf's Groups
fusorf's Contact & Social LinksfusorffusorfFireFusorf
To suggest an idea on what you asked:
- Make a vehicle path for the plane, pretty sure there is a ugx tutorial on it
- set variables on the level for the next plane round
- use a projectile impact check on the plane when flying

I'll try this out and ask if I have problems, thanks :)
broken avatar :(
×
broken avatar :(
Location: fr
Date Registered: 25 July 2015
Last active: 2 years ago
Posts
121
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
Personal Quote
//This is a comment
×
fusorf's Groups
fusorf's Contact & Social LinksfusorffusorfFireFusorf
Hi ! so I made some progress, coded this :

Code Snippet
Plaintext
#include common_scripts\utility;
#include maps\_utility;
#include maps\_zombiemode_utility;

plane_round(planeDamage){
while(1){
if (level.round_number >= 3){

//level.round_number >= 15 && level.round_number % 2 && planeDamage < 3

iPrintLnBold( "Round "+level.round_number+". This is a plane round" );

plane_pass_by();
planeDamage = plane_hit_detect(planeDamage);
}
}

plane_pass_by(){

plane = getEnt("plane","targetname");
    plane_path = GetVehicleNode("plane_path_start","targetname");
    plane AttachPath( plane_path );
    plane thread maps\_vehicle::vehicle_paths(plane_path);
    maps\_vehicle::vehicle_init(plane);

plane StartPath( plane_path );

iPrintLnBold( "Plane flying over the map..." );

}

plane_hit_detect(planeDamage){

plane = getEnt("plane","targetname");

/*while(1){
plane waittill( "damage", amount, attacker, direction_vec, point, "MOD_PROJECTILE" );
iPrintLnBold( "Plane has been damaged" );
} */

if (planeDamage > 3){
plane_down();
return 4;
}
else{
return planeDamage+1;
}
}

plane_down(){

iPrintLnBold( "Pap falls from the sky!" );
}

I get a syntax error at this line :
Quote
plane_pass_by(){

any advice ? did I do things wrong ?
broken avatar :(
×
broken avatar :(
Location: fr
Date Registered: 25 July 2015
Last active: 2 years ago
Posts
121
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
Personal Quote
//This is a comment
×
fusorf's Groups
fusorf's Contact & Social LinksfusorffusorfFireFusorf
Alright ! I got rid of that loop, instead I wanted to know where I can call my script (in _zombiemode) so that it executes at each round start.
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
I always call my stuff in mapname.gsc with the init() function for variables and precaches/fx above the thread for _zombiemode::main(); and below that I call my main(); function. Look at any of my last 3 releases and you will see it is part of the install instructions.

Idk if it is proper, but I try to keep all of my script to a single script if possible. I would not thread your function in zombiemode.gsc when it notifies the betweeb_round_over.

That's personal preference really. I like to call all my scripts in zombiemode, that way you dont have to seperately precache everything.
In your mapname.gsc you need to seperate the precache's, if you call from _zombiemode around line 60-70 you can keep your precaches in your custom script, like this:

_zombiemode:
(around line 60 )

Code Snippet
Plaintext
   maps\_custom_script::init();

your custom script:
Code Snippet
Plaintext
init()
{
      precache fx
      precache model

     level thread custom_script_main();
}

custom_script_main()
{
blah blah blah
}


I like doing it like this so i dont have all fx and models in my mapname .gsc 'scattered around' but simply at the top of the script that 'needs' them and it's super easy to find what you are looking for at a later stage.

Last Edit: July 21, 2016, 06:13:27 pm by BluntStuffy
broken avatar :(
×
broken avatar :(
Location: fr
Date Registered: 25 July 2015
Last active: 2 years ago
Posts
121
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
Personal Quote
//This is a comment
×
fusorf's Groups
fusorf's Contact & Social LinksfusorffusorfFireFusorf
I guess I'll leave my script call in mapname.gsc for now.  I'm having another issue: I followed the "UGX airstrike tutorial" to make my plane fly over the map, but when the function plane_pass_by() is called, the plane model does not move. It just disappears  :o
broken avatar :(
×
broken avatar :(
Location: ruMoscow
Date Registered: 30 July 2013
Last active: 2 months ago
Posts
152
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
BuIlDaLiBlE's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
That's personal preference really. I like to call all my scripts in zombiemode, that way you dont have to seperately precache everything.
I've been into scripting recently and in a lot of things that I bumped into was this precaching. What does it do and what if you don't precache? I suppose caching is for loading things into memory so it can be accessed without "lag spikes" or whatever.
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
I guess I'll leave my script call in mapname.gsc for now.  I'm having another issue: I followed the "UGX airstrike tutorial" to make my plane fly over the map, but when the function plane_pass_by() is called, the plane model does not move. It just disappears  :o

I have 0 experience with vehicle paths tbh, only time i've made a flying chopper i made animations for it in maya. But are you sure you precached everything correctly and everything is loaded in a .csv? Sounds like a missing model, or a bad vehicle-path maybe? But just guessing, like i said never used them myself before..


I've been into scripting recently and in a lot of things that I bumped into was this precaching. What does it do and what if you don't precache? I suppose caching is for loading things into memory so it can be accessed without "lag spikes" or whatever.

It simply loads assets into the game, if you dont precache something that isn't precached allready stock, it simply wont show up ingame ( checkerboard texture for shaders, missing models, models stuck in base-pose when anims are missing, weapon files not working, etc etc ).
If you add a model in radiant, there's no need to precache it, otherwise if it's not a stock zombie-waw asset you prob need to do so. precaching needs to be done before _zombiemode::main is called, or it wont work.
broken avatar :(
×
broken avatar :(
Location: fr
Date Registered: 25 July 2015
Last active: 2 years ago
Posts
121
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
Personal Quote
//This is a comment
×
fusorf's Groups
fusorf's Contact & Social LinksfusorffusorfFireFusorf
I have 0 experience with vehicle paths tbh, only time i've made a flying chopper i made animations for it in maya. But are you sure you precached everything correctly and everything is loaded in a .csv? Sounds like a missing model, or a bad vehicle-path maybe? But just guessing, like i said never used them myself before..

I don't think the model is missing as I can see it before the script starts. It's a Waw model. And the vehicle path seems correct.  ???

 
Loading ...