http://px.worms2d.info/px080wiki/api.php?action=feedcontributions&user=Ravander&feedformat=atomProject X Wiki - User contributions [en]2024-03-28T09:01:34ZUser contributionsMediaWiki 1.28.0http://px.worms2d.info/px080wiki/index.php?title=TODO&diff=903TODO2011-08-11T16:50:17Z<p>Ravander: Blanked the page</p>
<hr />
<div></div>Ravanderhttp://px.worms2d.info/px080wiki/index.php?title=PXUpdater&diff=902PXUpdater2011-08-11T16:40:37Z<p>Ravander: Created page with "Launch PXUpdater.exe and press Update to check for updates. If updates exist, your px files will be automatically updated. Remember to keep wkPX.dll in your worms folder while ..."</p>
<hr />
<div>Launch PXUpdater.exe and press Update to check for updates. <br />
If updates exist, your px files will be automatically updated.<br />
<br />
Remember to keep wkPX.dll in your worms folder while updating, <br />
otherwise it does not work.</div>Ravanderhttp://px.worms2d.info/px080wiki/index.php?title=File:Pxwxw.png&diff=827File:Pxwxw.png2011-08-07T16:27:34Z<p>Ravander: jee WXW SHIT</p>
<hr />
<div>jee WXW SHIT</div>Ravanderhttp://px.worms2d.info/px080wiki/index.php?title=Editorsobj.pxl&diff=803Editorsobj.pxl2011-08-06T19:26:44Z<p>Ravander: Created page with "Includes objects to use in MEd - Map Editor."</p>
<hr />
<div>Includes objects to use in MEd - Map Editor.</div>Ravanderhttp://px.worms2d.info/px080wiki/index.php?title=Template:Libraries&diff=802Template:Libraries2011-08-06T19:26:08Z<p>Ravander: </p>
<hr />
<div><center><br />
{{Navbox<br />
| name = Libraries<br />
| title = In the series of '''PX Libraries'''<br />
<br />
| group1 = Libraries<br />
| list1 = [[afr.pxl]] · [[cba.pxl]] · [[foo.pxl]] . [[editorsobj.pxl]] · [[friendlymines.pxl]] · [[math.pxl]] · [[newdrums.pxl]] · [[particles.pxl]] · [[render.pxl]] · [[smoke.pxl]] · [[turret.pxl]] · [[utils.pxl]] · [[weapons.pxl]]<br />
}}<br />
</center></div>Ravanderhttp://px.worms2d.info/px080wiki/index.php?title=File:Ico_maped.png&diff=697File:Ico maped.png2011-07-25T15:31:48Z<p>Ravander: Map editor icon.</p>
<hr />
<div>Map editor icon.</div>Ravanderhttp://px.worms2d.info/px080wiki/index.php?title=CCrateDesc&diff=691CCrateDesc2011-07-25T08:08:04Z<p>Ravander: Created page with '{{Up|Scripting}} This structure describes a crate. struct CCrateDesc { fixed X; fixed Y; ECrateType type; int amount; int …'</p>
<hr />
<div>{{Up|Scripting}}<br />
This structure describes a crate.<br />
<br />
struct CCrateDesc<br />
{<br />
fixed X;<br />
fixed Y;<br />
ECrateType type;<br />
int amount;<br />
int weapon;<br />
int weapons;<br />
int health;<br />
bool highlight;<br />
};<br />
<br />
X, Y - coordinates <br /><br />
<br />
{{Classes}}</div>Ravanderhttp://px.worms2d.info/px080wiki/index.php?title=Template:Classes&diff=690Template:Classes2011-07-25T08:04:26Z<p>Ravander: </p>
<hr />
<div><center><br />
{{Navbox<br />
| name = Classes<br />
| title = In the series of '''Worms Armageddon Classes'''<br />
<br />
| group1 = Classes<br />
| list1 = [[CGame]] · [[CGameState]] · [[CObject]] · [[CGObject]] · [[CWorm]] · [[CMine]] · [[CMissile]] · [[COilDrum]] · [[CTurnGame]] · [[CEnv]] · [[CTeam]] · [[CLandscape]] · [[CEditorObject]] · [[CArrow]] · [[CFilter]] · [[CSpriteAnim]] · [[CGas]] · [[CCrate]]<br />
| group2 = Structures<br />
| list2 = [[CShootDesc]] · [[CMineParams]] · [[CWeapon]] · [[CWeaponLaunch]] · [[CObjList]] · [[CColMask]] · [[CQuad]] · [[CWormParams]] · [[CCrateDesc]]<br />
}}<br />
</center></div>Ravanderhttp://px.worms2d.info/px080wiki/index.php?title=CCrate&diff=689CCrate2011-07-25T08:02:41Z<p>Ravander: </p>
<hr />
<div>{{Up|Scripting}}<br />
<br/><br />
{{Class|name=CCrate|description=Describes a crate|constructor=CCrate::CCrate(CObject* Parent,CCrateDesc* desc,EDropType type);}}<br />
<br />
=== Fields ===<br />
<br />
<br />
class CCrate : [[CGObject]]<br />
{<br />
CCrateDesc desc <br />
}<br />
<br />
<br />
{{Classes}}</div>Ravanderhttp://px.worms2d.info/px080wiki/index.php?title=CGas&diff=687CGas2011-07-25T07:58:46Z<p>Ravander: </p>
<hr />
<div>{{Up|Scripting}}<br />
<br/><br />
{{Class|name=CGas|description=Describes gas|constructor=CGas::CGas([[CObject]] Parent, fixed x, fixed y, int Power, int OwnerTeam);}}<br />
<br />
=== Fields ===<br />
<br />
<br />
class CGas : [[CGObject]]<br />
{<br />
int Power; <br />
fixed x;<br />
fixed y; <br />
}<br />
<br />
<br />
{{Classes}}</div>Ravanderhttp://px.worms2d.info/px080wiki/index.php?title=Known_bugs&diff=680Known bugs2011-07-22T01:59:42Z<p>Ravander: </p>
<hr />
<div>{{Up|Main Page}}<br />
<br />
<br />
<br />
By '''[[User:Diego|Diego]] 10:57, 7 March 2010 (UTC), not discarded ''': Game crashes when trying to start with a non existent scheme file selected.<br />
* What? It happened sometimes ago but Entuser fixed it.. --[[User:Undefined|Undefined]] 18:26, 7 March 2010 (UTC)<br />
** Discarded:<br />
**<pre>it's like "game crashes if remove sprites.dat while loading of game" for me</pre><br />
*** Anws, will be fixed too. --[[User:Entuser|Entuser]] 15:19, 17 May 2010 (UTC)<br />
*** Did you ever fix this?<br />
<br />
<br />
<br/><br />
----<br />
BY ... templates:<br />
Kdone, use like this<br />
<nowiki>{{subst:By|Fixed}} Crashes on startup</nowiki><br />
or if the bug is not fixed...<br />
<nowiki>{{subst:By}} Crashes on startup</nowiki><br />
<br />
<br />
== <br />
risbo crashes all the time ==</div>Ravanderhttp://px.worms2d.info/px080wiki/index.php?title=User_libs_reference&diff=654User libs reference2010-10-12T11:30:52Z<p>Ravander: Created page with '{{Libraries}}'</p>
<hr />
<div>{{Libraries}}</div>Ravanderhttp://px.worms2d.info/px080wiki/index.php?title=Class_reference&diff=653Class reference2010-10-12T11:30:41Z<p>Ravander: Created page with '{{Classes}}'</p>
<hr />
<div>{{Classes}}</div>Ravanderhttp://px.worms2d.info/px080wiki/index.php?title=User:Ravander&diff=652User:Ravander2010-10-11T16:12:44Z<p>Ravander: Created page with '<br\>'</p>
<hr />
<div><br\></div>Ravanderhttp://px.worms2d.info/px080wiki/index.php?title=Lesson_1._Visualize_me!&diff=650Lesson 1. Visualize me!2010-10-09T14:58:13Z<p>Ravander: /* RESULT. */</p>
<hr />
<div>In this lesson you will learn how to create simple interface for the game, paint it and add some text.<br\><br />
The result of the lesson is a new interface element, which is always in the center of your screen, with the text “MyDebug”.<br\><br />
Lesson is devided into logical parts. Every part is a "Piece of code" and explanation. Good luck! <br />
<br />
<br />
[[File:InterfaceTutorialPicture4.png]]<br />
<br />
== PART 1. ==<br />
<br />
Let’s create a Library.<br\><br />
Name: “DebugInterface”<br\><br />
Scriptname: “DebugInterface”<br\><br />
<br />
<br />
[[File:InterfaceTutorialPicture1.png]]<br />
<br />
<br />
require utils;<br />
CDebugInterface : CObject;<br />
CBitmap* GUIBitmap;<br />
<br />
<br />
1. This library will be useful to capture target worm.(GetCurrentWorm()).<br\><br />
2. We declared that CDebugInterface will be CObject’s child class. <br\><br />
3. We declared that GUIBitmap will be a pointer to CBitmap object. GUIBitmap is just a name for variable. CDebugInterface is also the name for the class so you can change it if you want.<br\><br />
<br />
<br />
== PART 2. ==<br />
<br />
<br />
void DebugInterface::InitGraphic()<br />
{ <br />
GUIBitmap = MakeBitmap(50,50);<br />
}<br />
<br />
void DebugInterface::FirstFrame()<br />
{<br />
new CDebugInterface(Root);<br />
}<br />
----<br />
InitGraphic() and FirstFrame() are special functions called, obviously, on graphic initialization and on the first moment of the game.<br\> <br />
This constructions allow you to catch those moments and call any functions you want:<br />
<br />
YourScriptname::InitGraphic()<br />
{<br />
// do here what you want<br />
} <br />
YourScriptname::FirstFrame()<br />
{<br />
// do here what you want<br />
}<br />
<br />
So, on InitGraphic() we have created a CBitmap32 object and cought it with GUIBitmap variable.<br\><br />
On FirstFrame() we have created a new CDebugInterface object and used Root as a parent.<br />
<br />
IMPORTANT: Root is not available on InitGraphic() so use FirstFrame() instead.<br />
<br />
== PART 3. ==<br />
<br />
<br />
<br />
CDebugInterface::CDebugInterface(CObject* parent)<br />
{<br />
super(parent); <br />
DebuggerGUI = GUIBitmap; <br />
}<br />
----<br />
<br />
<br />
<br />
CDebugInterface::CDebugInterface(CObject* parent)<br />
<br />
It’s our class constructor. It takes only 1 argument – parent. Our CDebugInterface is still ALMOST a CObject.<br\> <br />
To make it be full CObject let’s take a look at CObject constructor:<br />
<br />
CObject::CObject(CObject* Parent)<br />
<br />
It also takes parent. That’s why we use super(parent). It calls CObject constructor inside our CDebugInterface class,<br\> <br />
so “parent” goes from <br />
CDebugInterface::CDebugInterface(CObject* parent) <br />
and now it is really a full CObject. If you create new classes from CObject, CGObject and etc. calling super() in the constructor will prevent a lot of bugs, crashes, etc.<br\> <br />
<br />
DebuggerGUI = GUIBitmap;<br />
<br />
Our class gets DebuggerGUI field and takes GUIBitmap as a meaning.<br />
<br />
<br />
<br />
== PART 4. ==<br />
<br />
<br />
void CDebugInterface::DrawBitmap()<br />
{<br />
AddInterfaceBitmap(0,0,0,DebuggerGUI,0,0,50,50,0); <br />
}<br />
<br />
void CDebugInterface::DrawBackground()<br />
{<br />
DebuggerGUI->Rect(0,0,50,50,ARGB(255,0,0,0));<br />
}<br />
<br />
void CDebugInterface::DrawText()<br />
{ <br />
local a = 1;<br />
local b = 1;<br />
GS->Disp->DrawText(1,DebuggerGUI, 2, 2, "MyDebug", &a, &b); <br />
}<br />
----<br />
<br />
<br />
<br />
DrawBitmap(), DrawBackground(), DrawText() are the names of fuctions and CDebugInterface:: before them tells that those functions will ONLY be called for CDebugInterface objects and it’s children classes.<br />
<br />
AddInterfaceBitmap(0,0,0,DebuggerGUI,0,0,50,50,0);<br />
<br />
To understand how any function works take a look at mini-help or wiki.<br />
<br />
void CObject::AddInterfaceBitmap(int unk,fixed x,fixed y,CBitmap* bitmap,int srcX,int srcY,int sx,int sy,int flags)<br />
<br />
[[File:InterfaceTutorialPicture5.png ]]<br />
<br />
For fully newbies:<br\><br />
void – tells that this functions returns nothing.<br\><br />
CObject:: - method's class name.<br\> <br />
AddInterfaceBitmap - function name.<br\><br />
unk – unknown argument, maybe layer.<br\><br />
x, y – Position X and Position Y<br\><br />
bitmap – a pointer to CBitmap object.<br\><br />
<br />
Basically we have added our DebuggerGUI on the screen, as x and y are 0 it will be always in the center of the screen. The Bitmap usually born without any colors, so it’s time to paint it. <br />
<br />
<br />
void CBitmap::Rect(int left,int top,int right,int bottom,int clr)<br />
<br />
[[File:InterfaceTutorialPicture2.png]]<br />
<br />
Paints a rectangular on our bitmap.<br />
<br />
The picture above illustrates how the Bitmap is painted with a Rectangular according to the arguments.<br\><br />
Clr is the Color. Use ARGB Fuction to get the right interger<br\><br />
ARGB(a,r,g,b);<br\><br />
A – ALPHA (opacity)<br\><br />
R – RED<br\><br />
G – GREEN<br\><br />
B - BLUE<br\><br />
<br />
DebuggerGUI->Rect(0,0,50,50,ARGB(255,0,0,0));<br />
<br />
It fills our DebuggerGUI with black color(actually paints a black rectangular).<br\><br />
Now it’s time to add some text.<br\><br />
<br />
int CDisplay::DrawText(int fnt,CBitmap* bitmap,int x,int y,string txt,int* outX,int* outY)<br />
<br />
[[File:InterfaceTutorialPicture3.png]]<br />
<br />
This function retuns integer.<br\><br />
CDisplay is method’s class. By the way, CDisplay is created by the game in GS, and called Disp. So don’t create it. <br\><br />
Drawtext – name of the function.<br\><br />
FNT is the number of the Font.<br\><br />
BITMAP is for the name of the bitmap you want to place text in. <br\><br />
TXT is the text. <br\><br />
Use &a and &b as outX and outY <br\><br />
<br />
local a = 1;<br />
local b = 1;<br />
GS->Disp->DrawText(1,DebuggerGUI, 2, 2, "MyDebug", &a, &b); <br />
<br />
== PART 5. ==<br />
<br />
Finally it’s time to manage calling of this methods. We will use message because all of our functions must be called on every frame or drawqueue.<br\><br />
<br />
void CDebugInterface::Message(CObject* sender,EMType Type,int MSize,CMessageData* MData)<br />
{<br />
if (Type == M_FRAME)<br />
{ <br />
DrawBackground();<br />
DrawText();<br />
}<br />
<br />
if (Type == M_DRAWQUEUE)<br />
{<br />
DrawBitmap();<br />
}<br />
}<br />
<br />
<br />
== RESULT. == <br />
So finally your code should look like:<br />
<br />
require Utils;<br />
CDebugInterface : CObject;<br />
CBitmap* GUIBitmap;<br />
<br />
void DebugInterface::InitGraphic()<br />
{ <br />
GUIBitmap = MakeBitmap(50,50);<br />
}<br />
<br />
void DebugInterface::FirstFrame()<br />
{<br />
new CDebugInterface(Root);<br />
}<br />
<br />
CDebugInterface::CDebugInterface(CObject* parent)<br />
{<br />
super(parent); <br />
DebuggerGUI = GUIBitmap; <br />
}<br />
<br />
void CDebugInterface::DrawBitmap()<br />
{<br />
AddInterfaceBitmap(0,0,0,DebuggerGUI,0,0,50,50,0); <br />
}<br />
<br />
void CDebugInterface::DrawBackground()<br />
{<br />
DebuggerGUI->Rect(0,0,50,50,ARGB(255,0,0,0));<br />
}<br />
<br />
void CDebugInterface::DrawText()<br />
{ <br />
local a = 1;<br />
local b = 1;<br />
GS->Disp->DrawText(1,DebuggerGUI, 2, 2, "MyDebug", &a, &b); <br />
}<br />
<br />
void CDebugInterface::Message(CObject* sender,EMType Type,int MSize,CMessageData* MData)<br />
{<br />
if (Type == M_FRAME)<br />
{ <br />
DrawBackground();<br />
DrawText();<br />
}<br />
<br />
if (Type == M_DRAWQUEUE)<br />
{<br />
DrawBitmap();<br />
}<br />
}<br />
<br />
To The Next Chapter [[Lesson 2. Place me!]]</div>Ravanderhttp://px.worms2d.info/px080wiki/index.php?title=CArrow&diff=580CArrow2010-10-03T20:57:57Z<p>Ravander: </p>
<hr />
<div>{{Up|Scripting}}<br />
<br/><br />
{{Class|name=CArrow|description=Describes an arrow|constructor=CArrow::CArrow([[CObject]] Parent,int* damage, [[CShootDesc]]);}}<br />
<br />
=== Fields ===<br />
<br />
<br />
class CArrow : [[CGObject]]<br />
{<br />
int TeamIndex; <br />
int WormIndex; <br />
}<br />
<br />
<br />
{{Classes}}</div>Ravanderhttp://px.worms2d.info/px080wiki/index.php?title=CMineParams&diff=574CMineParams2010-09-15T11:35:42Z<p>Ravander: </p>
<hr />
<div>{{Up|Scripting}}<br />
This structure describes the parameters of created mine. It's used for making a new mine.<br />
<br />
struct CMineParams<br />
{<br />
int Radius;<br />
int Prefuse;<br />
int Flags;<br />
int Fuse;<br />
int Bias;<br />
int BlastPower;<br />
int Damage;<br />
};<br />
<br />
Radius - radius of sensor in pixels <br /><br />
Prefuse - delay after worm placed it <br /><br />
Flags - flags, describes objects react on. (see [[Collision flags]]) <br /><br />
Fuse - fuse in msec <br /><br />
Bias - positive shift of Y coordinate of explosion <br /><br />
BlastPower - power of blast (100 - default) <br /><br />
Damage - damage <br /><br />
<br />
{{Classes}}</div>Ravander