Page 1 of 2

Learn UScript.

PostPosted: Mon Mar 13, 06 10:52 pm
by Cozmo
I want to learn UnrealScript.
People say open Deusex.u and look around to learn but that hasnt helped me much, ive gone on UnrealWiki and i get bombared with scripts - can someone reccomend a good place to start?

PostPosted: Mon Mar 13, 06 11:00 pm
by MainMan
I really recommend decompiling deusex.u, it is very hepful. To start with, look at some default properties, then try weapon editing, gradually getting more advanced.

Personally, I never found unrealWiki helpful. Maybe I'm just dumb, but like you said, whenever i go on, I get bombarded with information and it's not really that helpful. I'd much rathe be shown the code and learn how it works (from a ready script) than learn about the principles on a website.

PostPosted: Tue Mar 14, 06 2:50 pm
by Alex
~MainMan~ wrote:I really recommend decompiling deusex.u, it is very hepful. To start with, look at some default properties, then try weapon editing, gradually getting more advanced.

Personally, I never found unrealWiki helpful. Maybe I'm just dumb, but like you said, whenever i go on, I get bombarded with information and it's not really that helpful. I'd much rathe be shown the code and learn how it works (from a ready script) than learn about the principles on a website.

unrealWiki is only handy if you need to know something about a specific function, but in your case, just look at things like Switch1.uc or SodaCan.uc, you know what it does, so you can find out how it works.

PostPosted: Tue Mar 14, 06 4:56 pm
by Cozmo
I think ive mastered defaultproperties. :D
Decompile Deusex.u
But i just have not learned much from this, i can read a basic script and have a vauge idea what it does but that's it.
:(

PostPosted: Tue Mar 14, 06 4:58 pm
by Alex
~Cozmo~ wrote:I think ive mastered defaultproperties. :D
Decompile Deusex.u
But i just have not learned much from this, i can read a basic script and have a vauge idea what it does but that's it.
:(

That's it?
That is a huge start! You know more then 99% of the whole Deus Ex community now.

PostPosted: Tue Mar 14, 06 5:00 pm
by Dae
I recommend you to set a task for yourself and do your best to complete it. I learned a lot of things this way :)

PostPosted: Tue Mar 14, 06 5:07 pm
by Siva
Ya, I set a stupidly large task to do, But I am fscking doing it anyway, even though it will be completed when DX3 is released.

PostPosted: Tue Mar 14, 06 5:12 pm
by Cozmo
From what ive heard, there will be no DX:3.
:(

PostPosted: Tue Mar 14, 06 5:15 pm
by Siva
~Cozmo~ wrote:From what ive heard, there will be no DX:3.
:(


*cough* Thats my point *cough*

PostPosted: Tue Mar 14, 06 5:17 pm
by Ballistix
~Cozmo~ wrote:From what ive heard, there will be no DX:3.
:(


Well if it was anything like DX:2 (which im 97% positive it will be) who gives a fuck.

PostPosted: Tue Mar 14, 06 5:31 pm
by Dae
~Cozmo~ wrote:From what ive heard, there will be no DX:3.
:(

That was a sarcasm :)

PostPosted: Tue Mar 14, 06 5:33 pm
by Cozmo
While im here i might as well ask a question. :)
After opening DeusExWeapon i figured defaultproperties are all just variables (Hope im right)
I dont realy need this but i just want to edit this as an example.
To prove my theory i wana make it that i can change the heal ammount of a sodacan in defaults but it dosent work :? Dont laugh if theres some easy mistake this is my first attempt at anything thats not default noobing :) .

Code: Select all
//=============================================================================
// Sodacan.
//=============================================================================
class SodacanB extends SodaCan

Var Float HealA

state Activated
{
   function Activate()
   {
      // can't turn it off
   }

   function BeginState()
   {
      local DeusExPlayer player;
      
      Super.BeginState();

      player = DeusExPlayer(Owner);
      if (player != None)
         player.HealPlayer(HealA, False);

      PlaySound(sound'MaleBurp');
      UseOnce();
   }
Begin:
}

defaultproperties
{
     HealA=5
}

PostPosted: Tue Mar 14, 06 5:37 pm
by MainMan
Hmm i dunno what's wrong with that... Maybe change var float at the top to var int (int = integer (whole number), float = a number with 6 decimal places after it.)

PostPosted: Tue Mar 14, 06 5:41 pm
by Dae
Var Float HealA

change to
var int heala;

As MainMan already said, the variable should be integer and don't forget about semicolons in the end.

Oh and yeah, noone will laugh at those, who try to learn something.

PostPosted: Tue Mar 14, 06 5:49 pm
by Cozmo
Ah i forgot to put ; before State that was main problem...
ZOMG It works! :D
Ive taken a small step towards coding, now i know variables are default stuff :)

PostPosted: Tue Mar 14, 06 9:08 pm
by Siva
I have recently followed in cosmo's footsteps :O !11!oneone!1.

Learned all I think I need for a while from defaultpros of DeusEx.U

PostPosted: Tue Mar 14, 06 9:12 pm
by Cozmo
AAAGH!!!!
IT HAS A Z NOT A S!
Cozmo!

PostPosted: Wed Mar 15, 06 10:07 am
by Siva
Haha, your cosmo the womens magazine XD.

PostPosted: Wed Mar 15, 06 4:21 pm
by Rödewijk
cosmo Image

PostPosted: Wed Mar 15, 06 5:23 pm
by Allan
Right, Trying to get back on topic... :P

Cozmo's Code wrote: function BeginState()
{
local DeusExPlayer player;

Super.BeginState();

player = DeusExPlayer(Owner);
if (player != None)
player.HealPlayer(HealA, False);

PlaySound(sound'MaleBurp');
UseOnce();
}


Right, the bit in bold (Super.BeginState), means that it loads up the version of BeginState from SodaCan, aswell as what you have there. So, try getting 2 of your custom sodacans, and see what happens :)

If i guess, it will use 2 at once, and heal 2 with one, and however much you set for the healing amount with the other. Give it a try Cosmo, and tell me what happens ;) (Ya know i mean Cozmo, jus pullin' your leg :P)

PostPosted: Wed Mar 15, 06 5:39 pm
by MainMan
XII//:Prod1gy wrote:Haha, your cosmo the womens magazine XD.

I read that every day...

PostPosted: Wed Mar 15, 06 7:15 pm
by Cozmo
Could someone post a list of all variables?
as in,

Var int
Var Float
etc...

PostPosted: Wed Mar 15, 06 9:01 pm
by Allan
Um...

Var Float (Number with 6 decimal places)

Var Int (Non-decimal Number)

Var Bool (Yes/No variable)

Var Class (Selects a class type for the variable)

Note: Usually, after the Class bit, people put things like <Decoration> or <Weapon>, this limits the choice for this variable to things from that class.

Var YourClassHere (Lets you play around with the properties of another class, usually to do stuff like change appearence, etc.)

Note: Where YourClassHere is, put any class you like, so long as it has lots of variables to play around with ;)

Var String (Text entry variable, can be used for messages, or commands)

There is a Var Enum or something, but i dunno how to explain that one.. :?

Finally, if you put () after the Var bit (So it looks like Var() Int, for example), you can edit the variable value in UEd :D

Oh, and does your special Sodacan class use 2 at once Cozmo? *Points to my last post*

PostPosted: Wed Mar 15, 06 9:06 pm
by Cozmo
No, sorry. :(
Ah so DF vanding machine can cheange lifespan of its product eh? :-k

Edit:

Another problem, i moddified the WeaponCreditcard to try make it so you can fire any ammount but there are problems...
To use you delete say and put Set WeaponCreditsmodified giveA NUMBER HERE but this only works on non-mtl because of set commands, :? any way of changing the ammount you give on mtl without needing admin?

PostPosted: Wed Mar 15, 06 9:09 pm
by Allan
In theory, yes :) It can indeed.

Also, if you look at the normal vending machine, it may help you to get the Var ENum variable. Oddly, they are always situated at the top of the variable lists :? . I would put it there if you ever have to use one :)

PostPosted: Wed Mar 15, 06 9:10 pm
by Cozmo
Oh yeah, bad mannors :(
ty allan

PostPosted: Wed Mar 15, 06 9:16 pm
by Allan
No prob :)

Er, i'm not sure :? . This WeaponCreditcard from the Darkforce mod?

PostPosted: Wed Mar 15, 06 9:17 pm
by Cozmo
Yes, i modified it with the var int thingy so you can get exact ammount to give another player instead of pressing 20 about 100.000.000.000 times, :evil:
but it only works on non-mtl because of set commands

PostPosted: Wed Mar 15, 06 9:33 pm
by Allan
Er, Do you plan to use the darkforce safes/ATM's? (Just intrested)

I can try and do something, but the fact it isn't actually a weapon (because it isn't in DeusExWeapon) may be a bit of a hassle :? ...

PostPosted: Wed Mar 15, 06 9:37 pm
by Cozmo
i know that, just sayin the classname
yes safes as well :D so u withdraw whatever instead of pressing 20 about 100.000.000.000 times.