Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Netgibbon

#1
It's a habit i picked up at work when i had a job (laugh). There was a work experience kid that turned up one day and he started doing that. It seemed to make more sense and sometimes it made the code easier to read so we all started to do it.
#2
I've come straight from using Unity and I've always created a text element for the name of something and another one that I manipulate through code to display something like
|Credits:| |lblCredits|
in the UI.

I'd then use things like creditsString = creditsInt.ToString(); and lblCredits.Text = creditsString;

Even though I can't append a string with an integer value, I can give it its own label which changes throughout the course of the game.
#3
Thank you so much. Although I did have to put it in repeatedly_excecute() for it to work properly.
I should really have figured that out days ago. I've been banging my head against a brick wall trying to figure it out and the solution was that simple.(wtf)
#4
I'm using String.Format to try and turn the value of an integer into a readable string but I'm getting an error every time I try to use it.
my code looks like this
Code: ags

//main global script file
int gold;
gold = 300;
export gold;
String goldAsText = String.Format("%d", gold);
export goldAsText;


and i keep getting the error:
Error (Line 5): cannot assign value to global pointer.

If anyone can help me figure out what's happening here, that would be great.
#5
Thanks for the reply. I'll give it a shot :-D
#6
Is it possible to put an image in an area like the main menu and use something like a hotspot and a click function to open up a web page in a player's browser?
If there is, it'd be cool to know how to do it but if not I suppose I'll have to figure out some other way of achieving this.
#8
Is it possible to create an AGS game that uses a first person camera perspective?

I've tried my own method where i have the player's Helmet UI on the whole screen and then putting an invisible sprite in the game but it doesn't seem to work right. and it appears to go through the bottom of the helmet and then not appear on screen again, forcing me to have to restart the game.
#9
Quote from: Snarky on Tue 23/09/2014 14:42:39
You don't need a plugin for that. The hardest part is probably to make the physical code wheel. In the game itself, you just need a few arrays of codes, two of sprites, and a random number generator. Something like this (very rough, probably buggy):

Code: AGS

// Header:
#define CODEWHEEL_SIZE 15
#define CODEWHEEL_SLOTS 7

struct CodeSlot
{
  String name;
  int code[CODEWHEEL_SIZE];
};

struct CodePos
{
  int faceTop;
  int faceBottom;
  int slot;

  import function InitRandom();
  import function Check(int code);
};

int faceTop[CODEWHEEL_SIZE];
int faceBottom[CODEWHEEL_SIZE];
CodeSlot codeSlot[CODEWHEEL_SLOTS];

// Script:

function CodePos::InitRandom()
{
  this.faceTop = Random(CODEWHEEL_SIZE);
  this.faceBottom = Random(CODEWHEEL_SIZE);
  this.slot = Random(CODEWHEEL_SLOTS);
}

function CodePos::Check(int code)
{
  int spin = (this.faceBottom - this.faceTop + CODEWHEEL_SIZE) % CODEWHEEL_SIZE;
  return int == codeSlot[this.slot].code[spin];
}


Then you just have to populate the CodeSlot arrays with codes (and names) and the faceTop/faceBottom arrays with sprite indexes to match the code wheel. To put up a code challenge on screen, make an instance of CodePos and initialize it, then display the faceTop/faceBottom graphics and the name of the code slot (Antigua, Bermuda, etc.).

Thank you very much (laugh)
#10
I was wondering if anyone has developed or if anyone knows about a plugin or library that my team could use to create a DRM system similar to the one used with Monkey Island's Dial-A-Pirate code wheel.

Any responses are much appreciated :)
SMF spam blocked by CleanTalk