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 - DoorKnobHandle

#2201
okok.

at the beginning of your script you add:

Code: ags

int playerishuman;


This introduces a global int variable which holds 0 or 1 depending on whether the player is a human or a cat right now.

Then you code the initial value of this var (lets say your player begins the game being a human...).

You add in the game_start func:

Code: ags

playerishuman = 1;


ok, then you have a inventory item which you can use and it changes your appearance...

so you go to the inventory item editor, select your item and click "on use:"

in this script you write simply:

Code: ags

if (playerishuman = 0)
{
 Ã, playerishuman = 1;
 Ã, SetCharacterView (EGO, NUM_OF_VIEW_WITH_PLAYER_AS_HUMAN);
}
else
{
 Ã, playerishuman = 0;
 Ã, SetCharacterView (EGO, NUM_OF_VIEW_WITH_PLAYER_AS_CAT);
}



which basically just changes the variable to 0 if its 1 or to 1 if it used to be 0 and then changes your view.

now you have this var set up correctly.

now lets say you want the player to only be able to do something if he's a cat. then you would write:

Code: ags

if (playerishuman == 0)
{
 Ã, // what the player should do...
}


thats it.

hope it helps.
#2202
You'd realize things like this with variables.

You add a variable "int playerishuman = 1" which is 1 if the player is human and 0 if the player is a cat.

Then you change the characters appearance depending on this var.

If you have further questions, ask...
#2203
Critics' Lounge / Re: Style C&C
Sun 13/02/2005 13:02:46
I'd really be looking forward to see a game using this kind of "sketch" graphic, but the animation would be really really hard to realize, since you'd have to draw out every single frame... I mean you can't do the animation digitally by using software like Photoshop because it is high-res... If you are really good and quick in drawing those things you should really give it a try but it is going to take a long time to just create a walkcycle animation for one character.

Great work, though.
#2204
That is exactly how I have it set up right now...

You have to build an oil raffinery structure, and this oil raffinery gives you 5000 $ every minute, of course if you need more money, you can always build up to three oil raffineries, which will give you a 5000 $ plus every minute, so up to 15.000 $ right now, although I am not done with the balancing process...

And you can built more powerplants as well if you need more energy, since every unit is not only taking away money but also energy... (just like in C&C...)
#2205
Quote
Are you making it TCP/IP?

That is exactly what I am planning to do, I already have the plug-in and will start
learning everything about it right after I released that playable demo (which is not
going to include multiplayer, but it is going to be available in the full-version)...

The things left to for me are Attack Code, AI, Level Editor, Complete Visuals, Adding ways to gain money (maybe just that you get a special amount of money every xth seconds). Thats it.

Of course, the demo will only feature two levels, no multiplayer and no level editor.

The rest is comming with the full version.
#2206
Ok, I'll do that first thing in the morning...

Thank you for all your quick help once again, I would have never figured that out on my own.

I will keep you up to date with what happens when I use the 2.7 Beta Version!
#2207
Hey,

Thank you for all the comments and interest...

Since it is going to take me atleast one more week with that playable demo-version
of "Troopers", I decided to show you more screenshots out of the current version,
so you can make sure my progress is doing good...


The Main Menu


The new interface design, the airport building and a better radar map...


The new "Create Unit"-Interface and the african scenario...

Keep me up to date with your thoughts about this project...
#2208
Thank you sooo much.

I should've known that, guess I'm already asleep for today or something, but it still didn't change anything. Actually it is fine if it reads that string correctly at the beginning of the game, since I init the level only once and as long as it reads it correctly when I init, everything is fine... But it still puzzles me...
#2209
That's the struct MAP:

Code: ags

struct structMap {
	string name [50]; // official name of current map
	int scenario; // 0: europe, 1: africa
};


The second parameter "int scenario" is not used right, but it is going to be the content
of that second line...

I searched through the whole 1000-line script for "map.name", but it is only mentioned in your function and in my keycode check code part. Nowhere else...
#2210
Thank you so much for all this work...

No that is strange...

With your functions, it says: THE STRING IS: TESTLEVEL (coreectly) but when the game runs and
I press TAB to test it again with this code:

Code: ags

 if (keycode==9) Display (map.name);  // Tab, show mapname


it displays only "Test"... Wierd isn't it..?
#2211
Thanks,

yes, of course I can reveal it :D

it is:

Testlevel

That's it... nothing special with the forth or fifth character but it just saves
"Test" in map.name...
#2212
Thank you so much, Scorpiorus.

You are right with the animating cursor thing... It's because I set it to Cursor Mode
0 every game loop and so I guess it keeps showing the first frame...

That BBuffer is a typo, and I forgot to put the [200] behind that map.name string,
now everything works...

One more thing left open:

Is there a way to read the second line out of the file now?


EDIT: Well it does not work entirely correct now...

I added the [200] to map.name and now it returns me the error message:
TESTLEVEL.TLV: ERROR READING LEVEL DATA (NAME)
and when I check the map.name contents in the game it is filled with the first four characters
from that TESTLEVEL.TLV file and nothing more... That is really strange...
#2213
Critics' Lounge / Re: My new character
Thu 10/02/2005 21:51:10
No, no, don't get me wrong. He looks very much improved by now.

I would never be able to draw something like this myself. Honestly.

I was trying to make a joke with this "boob"-thing (because I couldn't find
a different critique and it kinda jumped into my eyes...)
#2214
Could be... I'll download a newer version tomorrow...
#2215
Critics' Lounge / Re: My new character
Thu 10/02/2005 21:33:22
Looks really better now, congrats...

But has he boobs or what?
#2216
Can't open them with Adobe Acrobat Reader 4.0...
#2217
Try turning off Anti-Aliasing Mode.

If you use Photoshop 7.0 you should see the check box tu turn it
off in the top bar when you activate the brush tool.
#2218
Ok, a playable demo is coming really soon.

I am not going to give you more screenshots but I
can tell you that the game now features a new
graphical interface, more gameplay features (like
a nuclear bomb, an airport which is required
in order to create apaches etc...) and less bugs.

Also, it is going to include single/ multiplayer games
with several different game modes, like "Deathmatch"
(You have to kill every enemy unit to win), "VIP"
(The player loses, who first loses his VIP unit and
"King of the Hill" (A game takes either 15, 30, 45 or
60 minutes and you gain points every second you are
controlling the hill in the middle of the map with same
distance to every players base. After that amount of
time the player with the most points/who controlled
that hill the longest time wins...).

If you have any more ideas or suggestions on other
game modes or anything else in the game, make sure
to let me now, because now is the time I'm building
it in...

Thanks!

EDIT: Oh and now we got an announcer who announces
things like 'Nuclear Bomb in development' or 'Nuclear Air
Strike ahead' with a really cool voice!
#2219
Critics' Lounge / Re: My new character
Mon 07/02/2005 20:15:51
#3 is the best. Pretty good work!

#1: Redo the upper body, it looks too small right now, as if his pants would be all the way up over his belly button or so. I don't think that is meant to be like this, is it? :)

#2: Shoes are to big and his pose is not a very good idea. For some other reason I think he looks boring there. Can't put my finger on it though...

But good work with the third one! For some reason the second and third one pose looks good in lower res...
#2220

What the hell is wrong???

Replace the 24 with 9... Still does not work!

EDIT:

Now I'm havin troubles with this as well although I already had it working...

Doesnt give me any errors while compiling but then when I load a game it throws
me out with an error in the third line in that FileReadRawString func!

Code: ags

function FileReadRawString(int fileHandle, string buffer) {
Ã,  
Ã,  Ã,  int error_code = 0;
Ã,  Ã,  char byte = 0;
Ã,  Ã,  
Ã,  Ã,  StrCopy(bbuffer, "");
Ã,  
Ã,  Ã,  while (FileIsEOF(fileHandle)==0)
Ã,  Ã,  {
Ã,  Ã,  Ã,  Ã,  byte = FileReadRawChar(fileHandle);
Ã,  Ã,  Ã,  Ã,  
Ã,  Ã,  Ã,  Ã,  error_code = FileIsError(fileHandle);
Ã,  Ã,  Ã,  Ã,  
Ã,  Ã,  Ã,  Ã,  if (!error_code) // if there is no error reading the file
Ã,  Ã,  Ã,  Ã,  {
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  if (byte == 10)
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  {
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  return error_code;
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  }
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  else if (byte != 13)
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  {Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  StrSetCharAt(buffer, StrLen(buffer), byte);
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  }
Ã,  Ã,  Ã,  Ã,  }
Ã,  Ã,  Ã,  Ã,  else
Ã,  Ã,  Ã,  Ã,  {
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  return error_code;
Ã,  Ã,  Ã,  Ã,  }
Ã,  Ã,  }
Ã,  
Ã,  Ã,  return FileIsError(fileHandle);
}

function load_level ( string filename )
{
	int level = FileOpen ( filename, FILE_READ);
	int error_check = FileReadRawString(level, map.name);
	if (error_check == 0)
		Display ("'%s': ERROR READING LEVEL DATA (NAME)!", filename);
	FileClose ( level );
	
	return level;
}


What is wrong here?

Any help please?
SMF spam blocked by CleanTalk