Project X Forums



It is currently Sun Apr 28, 2024 6:42 am

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: PyroMan`s Libs from NewAge RopeRace
PostPosted: Fri Apr 27, 2012 4:14 pm 
Offline
User avatar

Joined: Sun Apr 08, 2012 1:09 pm
Posts: 425
Location: Ukraine, Kyiv
Hi everyone!
I was working under new px rr and found that those traps/turrets/weapons a very limited. But im bad at scripting, so tryed to understand how it works based on existing scripts by Zed, Enthuser, Undefined, Steps and others, who i found. And you know what? I think i understood a lot of thing, so now im presentimg you libs with a lot of modifications to enlarge possibilities for map-makers.
So in archive
Attachment:
File comment: include: Map, Scheme and Libs
NewAge_RopeRace_by_PyroMan.rar [2.49 MiB]
Downloaded 870 times
you will find a Map, Scheme, that needs in map, and Libs.
_
About libs:
1) pyroman_traps_sprites.pxl
With this lib u will get total control under game.
1st of all changes:
a) fixed problems with checkpoints: Now if playing 6 players - no more non-working cp for 6th player. Also, no more no-sound notification for 1st checkpoint. It works now.
b) added teleportation sound for teleport obj. Notice, that ALL sounds that i used in this teleport obj and in all other objects are loading directly from WormsArmageddon folders, not from lib.
c) for Zone obj added new parameter: EachNFrame. So now no more skipped frames, that happens sometimes. Ofc u can set it anly when u need it. And default parameter is 5 NFrames, as it was without this parameter on.
d) Trap now has two additional weapons: firework1 and firework2. They are actually modified weapons from New_Age_RopeRace_by_PyroMan.pxs scheme;
added some new parameters to traps:
- ShootOnceNOW: weapon will be shoot immidietly as soon as Proximity zone reached. It shoots once. I widely used it in my NewAge roperace. With this parameter activated, Delay, Shoot dealy have no sence. As i used it widely, parameters about force, delay, etc are set as default to 1.
_
Ok so thats about modifications. Now WHATS NEW:

1) object Spriterz:
this is very useful obj for loading custom sprites. Its actually changed Zed`s ossom AddSpr lib, but.. what i found - is when u using more than 10-15 sprites (specially placed all over the map), game becomes extremely laggy. SO, in this case i decide to put this lib working with proximity Zones. I had troubles by making it as external lib, so its putted into this Lib (traps_sprites), where Zone object is exist.
So, as u can guess, it loads custom sprites from lib. I found, that sprites shoud have "rounded" numbers of pixels, for exmpl: 100x1000px, 200x100px, etc. Otherwise sprite will not work. Even if its 20x80, and u set FNum = 4, anim speed.. 10 - it will not work. But it will work if it will be 20x100 with just empty space and FNum 5.
Using this obj, u can set hundreds of sprites on map. And game will NO lag.
Now about parameters:
a) SpriteName - name of png file in Lib (f.e. red_light.png)
b) Lock_X_axis (Lock_Y_axis) - this parameter i used for BlackZone on my map. This allows to lock sprite at specific Axis: X or Y. If "Lock_X_axis" selected, sprite will move with worm, butonly vertically. and if "Lock_Y_axis" selected, Sprite will move with worm only Horizontally.
c) MoveToWorm - in this case sprite will be attached to worm.
d) FrameNum - number of frames for sprite. for example for sprite 100x1000px it will be: 1000/100 = 10 frames.
e) AnimSpeed - speed 0-1000 to play sprite
f) ZPlane - this allows you to put sprite weather Before worm/landscape/other sprites or.. Behind. other words on top of view, or on bottom, like layers :)
g) PlayOnce - this parameter will play only one cicle of your sprite. If worm re-entered zone, sprite will play once again. etc
h) PlayBackwards - with this parameter choosed, sprite will load upwards and backwards, one by one. Of PlayBackwards and PlayOnce both choosed, srpite will play to last frame, then back to first frame and then will disable.
i) ProximityZone - zone obj that needs to activate sprite.

2) Object WA_Spriter
This object makes same function as SpriterZ, but sprites loading from WA existing. About spriteNumbers its nice to use PXSchemeEd and press button WA Sprites, to see what kind of sprites available and what numbers do they have. But its not the only function that this obj makes. It can also play WA sounds, by number. I tested them all, its 180 sounds, 126-180 of them - are speech sounds of current player. 1-126 - are sounds from DATA/Wav/Effects folder. I have a list of sound numbers and what they mean, but its written on paper. I will make a topic a lil later for this and put link here, so u will be able to know what Num is what sound.
So now about parameters:
a) SpriteNum - Number of WA sprite file (listed in PXSchemeEd.exe)
b) AnimSpeed - speed of playback. default is 15, works fine for most sprites.
c) ZPlane - this allows you to put sprite weather Before worm/landscape/other sprites or.. Behind. other words on top of view, or on bottom, like layers :)
d) RotationAngle - guess no comments required. I found that it would be nice to Flip sprites Hor/Vert, but i didnt found how to do it. So u can just rotate. Rotation works following the ClockWise.
e) Scale - make sprite larger/smaller in percentage.
f) PlayOnce - this parameter will play only one cicle of your sprite. If worm re-entered zone, sprite will play once again. etc
g) PlayBackwards - with this parameter choosed, sprite will load upwards and backwards, one by one. Of PlayBackwards and PlayOnce both choosed, srpite will play to last frame, then back to first frame and then will disable.
h) PlayWaSound - this allows you to play sound files, that i was talking about earlier. I recommend use it with PlayOnce parameter active.
i) ProximityZone - zone obj that needs to activate sprite.

3) Object Tail:
its actually tRail.. but who cares. idea is same :)
it works same as WA_Spriter, but it adds a copies of spites each.. let me remeber... each 10 frames with remebered last position of worm. Number of copies: 10.
Here is parameters for this Obj:
a) SpriteNum - Number of WA sprite file (listed in PXSchemeEd.exe)
b) AttachToWorm - if its ON, then it will add additional sprite, attached to Worm. For example u can use 64`s sprite (BurningSheep) to attach to worm. In this way u`ll get butning sheep roping with a trail. To set this specific SpriteNumber to worm, made next function:
c) SNumToAttach - Sprite`s number to attach to worm. Works only with AttachToWorm parameter ON;
d) AnimSpeed - speed of animation for previous parameter;
e) ZPlane - u know...
f) ProximityZone - zone obj that needs to activate sprite.

4) Object CrateSupplyZ:
This obj will allow you to supply a crate on map in specific area at specific moment. Also here is included OilDrum supply, that can be respawnable and self-destructing.
So here is available parameters:
a) CrateType - now it 3, against 2: Health Weapon OilDrum
b) Health - amount of health in crate if its Health-crate
c) CreateAtGStart - this will supply crate/drum at its place when game starts. If not selected - crate/drum will be supplied only when ProximityZone reached.
d) ClearEachTurn - if selected, crate/drum will be exploded when player will finish turn/loose control;
e) OilSnap - dunno what`s that. Found it in OilDrum function while creating. mb some1 will know whats that :)
f) ProximityZone - zone obj that needs to supply crate/oilDrum.

5) Object CustomLibTask:
This obj will allow you do ANYTHING on your map. With this function were made conditions, arrow shots, state changings like freezing or killing, launching fireworks, adding time to turn-timer, and many-many others. The only problem - is that it all have to be specified in PXLedit.exe and for specific task - shoud be set a number. This number u can only set in map editor, set priximity zone for it and some other features. what kind? find it out now:
a) ObjTask - this is a number of your task, that you written in PXLedit.exe
b) MakeOnce - this will make work your task only once, when Zone reached. Usefull for launching some weapons or state changing
c) EachNFrames - this parameter reads how many times your task will be redone per frame. For example if u shooting weapons - EachNFrames will work as Delay for ya. If you changing state, this will work as delay to work when zone reached. etc
d) WeapGravity - this parameter allows you to control weapon`s gravity, that called from this obj. In my map i iften used 0 gravity for some weapons, to totally control their movement.
e) ProximityZone - zone obj that needs to make your task working.

This object has many hidden functions that work by calling not from MapEditor, but from LibraryEditor.
There are:
- MakeArrow()
need command to be sent for good working:
admg - damage,
ShootX - x position to shoot
ShootY - y position to shoot
ShootSX - power+XAngle for shot
ShootSY - power+YAngle for shot
gravArrow - gravity factor, float (f.e. 0.25)
noStick - bool, true or false.
- MakeWeaponShot()
need command to be sent for good working:
weapNum (1, 2 or 3) if more than 3 - game will crash with ErrorLog. dunno why, it works so for each of listed functions.
ShootX, ShootY, ShootSX, ShootSY
w_grav - gravity factor
g_timer - delay for grenade
- MakeMine()
need command to be sent for good working:
ShootX, ShootY, ShootSX, ShootSY, m_prefuse, m_flags, m_bias, m_damage, m_blastPower, m_fuse, m_radius, m_unknown
- MakeMissileShot()
need command to be sent for good working:
weapNum (1, 2 or 3), ShootX, ShootY, ShootSX, ShootSY
w_targX, w_targY - to set Target position
- MakeSheepShot()
need command to be sent for good working:
weapNum (1, 2 or 3), ShootX, ShootY, ShootSX, ShootSY, w_grav, ExplTimer - timer before explode
- MakeFirework()
need command to be sent for good working:
weapNum (1, 2 or 3), ShootX, ShootY, ShootSX, ShootSY, w_grav, ExplTimer - timer before explode
- MakeFirework2()
need same command to be sent for good working:
weapNum (1, 2 or 3), ShootX, ShootY, ShootSX, ShootSY, w_grav, ExplTimer - timer before explode

also this obj include some custom variables, that used by other obj to activate itself. One of this usage presented here:

6) object Spriter_1by1:
this obj works as WA_spriter, but activates according to variables, that can be changed using CustomLibTask obj. I used it in my map, as last part of chamber 4, to open finish "doors". "BurningSheep" sprite loading one by one according to which zone has been reached.


__________________
well... so far so good. It was about one lib. Now about next libs :D
II. pyroman_customgame.pxl
Lib by Steps with changes by me :) This lib overrides WA sprites.
- With this lib active your worm will be a ninja-worm with ninja-rope :) I made a sprites for this. Saying ninja-worm i mean a worm with blue piece of... dunno how it called. as in dragon punch, on head. I decide to change it of step`s hats, coz its low amout of frames of his worms. It looked like a lil laggy for me, or smth. Only death animation was with higher frames, so it looks smooth and nice. so i keeped it :)
- Other thing that overrided - tcloud. I am a t-presser, so i was interested in this question. maybe some1 will find it a lil useless) anyway, now when u press T, u`ll see WTFcloud. Now im working under multiple t-clouds.

- Another added thing - "Meeee-eee" sheep sound that appears when you press "S". Just for fun :)

__________________
III, last one :) pyroman_turret
well-known turret now a lil modified. Actually its added Auto-ballista (arow) turret to map editor. Also added a feature for it: leave arrows or not.
Here is more detailed info:

Object ArrowTurret:
1) Invincible - weather can we kill it or not :)
2) Mounted - fixed X axis
3) AmmoPerTurn - no comments about)
4) LeaveArrows - leave arrows on map or no :) I decide to add this function in tactical meanings. f.e. use turret to luck smth or so.

well another thing about this turret. I made it for my NewAgeRR, so the arrows speed is a lil low ) if some1 need, i can add possibility for arrow`s speed, grav, etc.


To play my map, u need all libs included in archive and set specific scheme "New_Age_RR_by_PyroMan.pxs" and one more thing... Have Fun! :D

___________
P.S.Waiting from you, fellaz, new schemes and maps. Hopefully my work will help you to look at worms armageddon and possible traps on it a lil wider than usual.

_________________
Things to impress.


Top
 Profile  
Reply with quote  
 Post subject: Re: PyroMan`s Libs from NewAge RopeRace
PostPosted: Thu Aug 08, 2013 9:40 pm 
Offline

Joined: Wed Jul 31, 2013 4:03 pm
Posts: 35
Location: Ukraine
Thank you, Pyro, for this guide! I'm making WxW maps now with your libs. :)


Top
 Profile  
Reply with quote  
 Post subject: Re: PyroMan`s Libs from NewAge RopeRace
PostPosted: Fri Aug 09, 2013 8:12 pm 
Offline
User avatar

Joined: Sun Apr 08, 2012 1:09 pm
Posts: 425
Location: Ukraine, Kyiv
Danylo wrote:
Thank you, Pyro, for this guide! I'm making WxW maps now with your libs. :)


cool, i`m glad that you found my guides useful! (at least someone, haha)
Will be interesting to see at final results, when you`re done with maps.

_________________
Things to impress.


Top
 Profile  
Reply with quote  
 Post subject: Re: PyroMan`s Libs from NewAge RopeRace
PostPosted: Mon Aug 12, 2013 8:06 pm 
Offline

Joined: Wed Jul 31, 2013 4:03 pm
Posts: 35
Location: Ukraine
PyroMan wrote:
cool, i`m glad that you found my guides useful! (at least someone, haha)
Will be interesting to see at final results, when you`re done with maps.

I've already made few maps and posted here the best one. I've already played it and a few people like it.

I want to THANK YOU VERY MUCH for this topic because your libs urged me to have a look at scripting, although there is no my scripting in the map. I just looked inside your scripts, then at PX Wiki tutorials and realized that this it is much simpler to script that I imagined. Only the basic knowledge of programming is required.

Later on, I decided to rewrite your timer script that you wrote for Genia-1993. I studied your script and timedrace script and made the timer elapsing and deleted timer for defender team. And finally, I studied how to make map editor's object and made my own timer object for KTK maps without unnecessary race functions.

Now I'm going to make one more thing for KTK: the king-worm which cannot make turns, and if it dies, attackers win. but I have no ideas how to script it. I suppose that's it's better to make a separate topic for my problem, if you can help, right?


Top
 Profile  
Reply with quote  
 Post subject: Re: PyroMan`s Libs from NewAge RopeRace
PostPosted: Sat Aug 31, 2013 7:25 pm 
Offline
User avatar

Joined: Sun Apr 08, 2012 1:09 pm
Posts: 425
Location: Ukraine, Kyiv
Danylo wrote:
PyroMan wrote:
cool, i`m glad that you found my guides useful! (at least someone, haha)
Will be interesting to see at final results, when you`re done with maps.

I've already made few maps and posted here the best one. I've already played it and a few people like it.

I want to THANK YOU VERY MUCH for this topic because your libs urged me to have a look at scripting, although there is no my scripting in the map. I just looked inside your scripts, then at PX Wiki tutorials and realized that this it is much simpler to script that I imagined. Only the basic knowledge of programming is required.

Later on, I decided to rewrite your timer script that you wrote for Genia-1993. I studied your script and timedrace script and made the timer elapsing and deleted timer for defender team. And finally, I studied how to make map editor's object and made my own timer object for KTK maps without unnecessary race functions.

Now I'm going to make one more thing for KTK: the king-worm which cannot make turns, and if it dies, attackers win. but I have no ideas how to script it. I suppose that's it's better to make a separate topic for my problem, if you can help, right?


Yes dude, that`s right. Better make a separate topic for that help. I will try to help ya if i will can.
I think i have some suggestions how it could be implemented.

_________________
Things to impress.


Top
 Profile  
Reply with quote  
 Post subject: Re: PyroMan`s Libs from NewAge RopeRace
PostPosted: Sun Sep 01, 2013 8:03 pm 
Offline

Joined: Wed Jul 31, 2013 4:03 pm
Posts: 35
Location: Ukraine
I've already made something similar, so the problem is almost solved. Anyway, thanks for potential help. :D


Top
 Profile  
Reply with quote  
 Post subject: Re: PyroMan`s Libs from NewAge RopeRace
PostPosted: Fri May 23, 2014 10:37 am 
Offline

Joined: Mon Jun 24, 2013 2:51 pm
Posts: 6
Hey Pyro. Could you help me out with a simple task? I have no clue how to make the trap weps low grav.
I have tried to do it, but with 0% success. :?
Would be awesome to have them just floating through the air, so it's not total chaos.
And to create a more controlled game-play, scheme and map would be a million times easier.

I would really appreciate it if you guide me on this little thing. :D


Top
 Profile  
Reply with quote  
 Post subject: Re: PyroMan`s Libs from NewAge RopeRace
PostPosted: Sat May 24, 2014 6:55 pm 
Offline
User avatar

Joined: Sun Apr 08, 2012 1:09 pm
Posts: 425
Location: Ukraine, Kyiv
Wormdawg wrote:
Hey Pyro. Could you help me out with a simple task? I have no clue how to make the trap weps low grav.
I have tried to do it, but with 0% success. :?
Would be awesome to have them just floating through the air, so it's not total chaos.
And to create a more controlled game-play, scheme and map would be a million times easier.

I would really appreciate it if you guide me on this little thing. :D


what exactly you want to do?
in my px rr i used CustomLibTask to shoot weaps with 0 gravity, so they were floating. For example CustonLibTask in map editor configured that WeapGrav = 0 and it activates when worm reaches proximity zone. When proximity Zone Reached, activates function number 57 (for example), its mentioned in CustomLibTask. But inside its lib that function declared and its shooting weapon named "bazooka".

What this made for - is to shoot weapons with 0 gravity and meanwhile other weapons can be with default gravity (1.0)

But. If you need all weap to be with 0 gravity, no need to go such complicated way. It can be done with one simple script attached as separate lib or as script inside the scheme.

Code:
override void CWorm::FireFinal(CWeapon* Weap,CShootDesc* Desc)
{
    super;
    Weap->launch.gravityFactor = 0.0;
}

this simple script will make weap gravity equal 0 when its shooted by worm.
If your scheme generates missiles not by firing with Worm, then u can apply this script:
Code:
override void CMissile::CMissile(CObject* parent,CWeaponLaunch* ldata,CShootDesc* sdata)
{
    super;
    ldata->gravityFactor = 0.0;
}

But this will be aplyed only for CMissile class. For example Mine is another class called CMine. So u need change parameters there, like this (if u need):
Code:
override void CMine::CMine(CObject* Parent,CMineParams* Params,CShootDesc* SDesc,bool Snap,int Unk)
{
         super;
         GravityFactor = 0.0;
}

That is basically it.

I was long time not scripting at all, may be im wrong at some point, but for this moment i believe this should solve your problem. Good luck.

_________________
Things to impress.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 17 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Skin by Lucas Kane