Test Ticks

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Sabresire

New Member
Nov 29, 2001
4
0
0
Visit site
Still trying to work out unreal script and its just boggling. I need a place to start with code and I can't even figure out how do insert some code that will come up at a particular instance. I've tried all sorts of places just inserting a broadcastmessage function but it never comes up.

I'd like to know how to access "ticks" in the game just to put a test message up there, perhaps in the unrealtournament pawn class. So that every hundred ticks or so I could post the message up.

It's kinda frustrating when you are starting to play with code and any modifications you do either don't seem to show up at all or cause errors. :(

Thanks in advance for help. This forum seems a great reference.
 

Mychaeel

New Member
Log("Some Message") reliably writes a message to UnrealTournament.log. That's probably your best (and virtually only) means to track the execution flow of your scripts.

Bind a key to "showlog" and run Unreal Tournament in windowed mode with the log window visible.

Happy debugging. :)
 

Sabresire

New Member
Nov 29, 2001
4
0
0
Visit site
Ok, but can someone give me an example of an object to use that in. In theory you aren't supposed to modify any of the actual unreal code, just subclass it. So how would you make a subclass and run it in a normal single player game (or tournament mode game doesn't matter.) and which object could you use with a tick function?

Say I put it in one of the playerpawns, as long as that instance of a playerpawn was still in the game it would run that tick function?

Someone got an example? =)

Also, is there an IRC channel where unrealscripter hang out?

Thanks for all the info. =)
 
check out the PressureZone actor (subclass of Info->ZoneInfo) for an example of Tick ...

Tick should be used very carefully since it will execute potentially hundreds of times per second (depending on the machine) ...

To subclass an actor in UED2, highlight it, then hit the New button at the top, and give a package name to store your subclass in (you don't want to alter stock actors' code) and a name, then you'll have a screen with the beginning of your new subclass. Change the keyword "expands" to "extends", then you're ready to work.

You change the behavior of an actor by overriding aspects of one of it's ancestors. So for example if you don't like all the stuff that happens when a player teleports and you're subclassing a teleporter, you'd find any functions that contain code causing the teleport effect, copy their code into your subclass, then remove or comment out the lines that cause the teleport effect.

To save your changes, use Tools menu, select Compile Changed Scripts, make sure you have no errors (status bar at the bottom will tell you), then go back to the Actors browser, make sure that only the checkbox beside your package is checked (bottom pane), then hit the Save button. You can now insert this subclass into your map in the normal manner.