Author Topic: I Found Some Fun Code To Toy With  (Read 1911 times)

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4954
I Found Some Fun Code To Toy With
« on: May 27, 2005, 03:45:35 AM »
Well, why not have a peak for yourself before I spoil it with code? It's only a few lines really, but I figured I'd let people run it before spoiling it.

Enjoy.  :P
 

Offline Eddy-B

  • Hero Member
  • *****
  • Posts: 1186
    • http://www.eddy-b.com
I Found Some Fun Code To Toy With
« Reply #1 on: May 27, 2005, 07:34:28 AM »
Nice Hooman :)

although when scrolling, it seems to be messing up the screen.. lol
maybe if you put it in InitProc instead of AiProc ?
Rule #1:  Eddy is always right
Rule #2: If you think he's wrong, see rule #1
--------------------

Outpost : Renegades - Eddy-B.com - Electronics Pit[/siz

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4954
I Found Some Fun Code To Toy With
« Reply #2 on: May 27, 2005, 06:07:39 PM »
Yeah, I noticed that problem too. And it won't work in InitProc because the screen gets redrawn and it gets erased. Maybe I should try a time trigger. Actually..., why maybe?

... /me tries a time trigger.

Yep. It seems to (mostly) solve the problem. When scrolling you can kinda see a bit of a trail, but it gets cleaned up fairly quickly. It never leaves traces behind permanently this way.

Anyways, here's some quick and dirty code to do it. Although, I'm sure Eddy has already seen it.  <_<

Code: [Select]
SCRIPT_API void TrigMessage()
{
char *string = "You are n00b, our colony is doomed!";
int FuncAddr = 0x4085C0;

__asm
{
  MOV ECX, 0x5756C0 + 0x1F4
  PUSH string
  CALL [FuncAddr]
}
}

In case you're wondering, 0x5756C0 seems to be the address of Dans_RULE_UIFrame. It contains a subobject that handles the drawing.
 

Offline BlackBox

  • Administrator
  • Hero Member
  • *****
  • Posts: 3093
I Found Some Fun Code To Toy With
« Reply #3 on: May 30, 2005, 04:17:34 PM »
haha, I was the one who showed you that :)

For the advanced types: edit the LOGFONT struct it sets up and you can change the size, font, weight, and other stuff about the text.

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4954
I Found Some Fun Code To Toy With
« Reply #4 on: May 30, 2005, 08:54:16 PM »
Yes, I double checked some of that stuff and you had told me about some of it. I just happened to see some code that was passing off one of the usual strings and figured that function made the big text. So I tried calling it myself. And yeah, it used the vtbl address you mentioned the day before or so. Funny how those things work out. I probably wouldn't have realized what the class was if you hadn't told me though.