Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 683 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19054 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Cheat-Input like GTA SA #94199
10/13/06 12:45
10/13/06 12:45
Joined: Feb 2005
Posts: 3,687
Hessen, Germany
T
Tempelbauer Offline OP
Expert
Tempelbauer  Offline OP
Expert
T

Joined: Feb 2005
Posts: 3,687
Hessen, Germany
hi guys

since a few hours i´ve holiday, I was happy and coded something...
it´s a cheat-input like GTA San Andreas. do you know it? - you can type in what you want and if you pressed a combination of characters (the cheat), a message appears and a piece of secret code will be executed. - now for 3DGS too


How to include...
- copy the sa_input.wdl and the chtpcx.pcx in your project-folder
- include the code in your levelscript:Code:
///////////////////////////////////////////////////////////////////////////////////
// GameStudio main script
////////////////////////////////////////////////////////////////////////////
// Files to over-ride:

...

include <lflare.wdl>; // remove when you need no lens flares
include <status.wdl>;
include <sa_input.wdl>;

////////////////////////////////////////////////////////////////////////////
// The engine starts in the resolution given by the follwing vars.
var video_mode = 6; // screen size 640x480
var video_depth = 16; // 16 bit colour D3D mode

...


- start the inkey_gtasa()-function (for example in your main-function):
Code:
function main()
{
// set some common flags and variables
// warn_level = 2; // announce bad texture sizes and bad wdl code
tex_share = on; // map entities share their textures

// center the splash screen for non-640x480 resolutions, and display it
splashscreen.pos_x = (screen_size.x - bmap_width(splashmap))/2;
splashscreen.pos_y = (screen_size.y - bmap_height(splashmap))/2;
splashscreen.visible = on;
// wait 3 frames (for triple buffering) until it is flipped to the foreground
wait(3);

// now load the level
level_load(level_str);
// freeze the game
freeze_mode = 1;
inkey_gtasa();

...




How to add your own cheat...
Open the sa_input.wdl and scroll down. You´ll see an example-cheat:
Code:
if(str_stri(tmpcheat,"beepman")) { beep; str_cpy(tmpcheat,""); gtanim();}



and so you can add it:
- copy the line
- change the first white value ("beepman") into your cheat
- change the second white value ("beep;") into your cheat-function (the function which execute the secret code, like 'make player undieable')

NOTE: the str_cpy-command have to be excecuted, otherwise your cheat will be executed after every key-pressing again! / the gtanim();-function is not needed coactive. it shows only the message "cheat activated"


How to control the cheat-input...
if the var "inkey_gtasa_active" is 1, the function works normally
if you change it to 0, the cheat-input will be stopped temporary (till you set it back to 1).
if you set it to -1, the inkey_gtsa-function will be terminated.


During the input the engine works normally. The function just notice all keystrokes and execute a function, if the combination of the keystrokes is a cheat!


How to get the code...
Just click here



Have a nice day
- Tempelbauer

ps: please give me feedback and report bugs. thanks

Re: Cheat-Input like GTA SA [Re: Tempelbauer] #94200
10/13/06 13:02
10/13/06 13:02
Joined: Apr 2005
Posts: 3,815
Finland
Inestical Offline
Rabbit Developer
Inestical  Offline
Rabbit Developer

Joined: Apr 2005
Posts: 3,815
Finland
I hope you need to press some keys while entering the cheat. since you can accidentaly enter a suicide cheat...


"Yesterday was once today's tomorrow."
Re: Cheat-Input like GTA SA [Re: Inestical] #94201
10/13/06 14:47
10/13/06 14:47
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
@Tempelbauer:
Thank you for this contribution!
I gonna check it out ...

@Inestical:
At least in GTA-SA you did not need to press and/or hold a certain key to enter a cheat.
You as a game developer who uses Tempelbauer's code has to make sure that this will not happen by accident.

Re: Cheat-Input like GTA SA [Re: Xarthor] #94202
10/13/06 14:49
10/13/06 14:49
Joined: Apr 2005
Posts: 3,815
Finland
Inestical Offline
Rabbit Developer
Inestical  Offline
Rabbit Developer

Joined: Apr 2005
Posts: 3,815
Finland
yes yes I know.. but it just helps for "not" finding the codes.. or not.. anyways, nice snippet there


"Yesterday was once today's tomorrow."
Re: Cheat-Input like GTA SA [Re: Inestical] #94203
10/13/06 15:42
10/13/06 15:42
Joined: Sep 2002
Posts: 8,177
Netherlands
PHeMoX Offline
Senior Expert
PHeMoX  Offline
Senior Expert

Joined: Sep 2002
Posts: 8,177
Netherlands
Cool code, quite useful indeed, thanks.

Cheers


PHeMoX, Innervision Software (c) 1995-2008

For more info visit: Innervision Software
Re: Cheat-Input like GTA SA [Re: PHeMoX] #94204
10/14/06 04:28
10/14/06 04:28
Joined: Aug 2001
Posts: 2,320
Alberta, Canada
William Offline
Expert
William  Offline
Expert

Joined: Aug 2001
Posts: 2,320
Alberta, Canada
Yeah, thanks for sharing this.


Check out Silas. www.kartsilas.com

Hear my band Finding Fire - www.myspace.com/findingfire

Daily dev updates - http://kartsilas.blogspot.com/
Re: Cheat-Input like GTA SA [Re: William] #94205
10/14/06 19:09
10/14/06 19:09
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
frazzle Offline
Expert
frazzle  Offline
Expert

Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
Nice code Tempelbauer !!
The "Cheat-Input like GTA SA" is a great contribution

Cheers

Frazzle


Antec® Case
Intel® X58 Chipset
Intel® i7 975 Quad Core
8 GB RAM DDR3
SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB
NVIDIA® GeForce GTX 295 Memory 1795GB
Re: Cheat-Input like GTA SA [Re: frazzle] #94206
10/14/06 23:51
10/14/06 23:51
Joined: May 2005
Posts: 819
U.S.
Why_Do_I_Die Offline
Warned
Why_Do_I_Die  Offline
Warned

Joined: May 2005
Posts: 819
U.S.
Nice Code , thnx for the contribution.

Re: Cheat-Input like GTA SA [Re: Why_Do_I_Die] #94207
10/15/06 10:15
10/15/06 10:15
Joined: Feb 2005
Posts: 3,687
Hessen, Germany
T
Tempelbauer Offline OP
Expert
Tempelbauer  Offline OP
Expert
T

Joined: Feb 2005
Posts: 3,687
Hessen, Germany
thanks guys

a tip: if you want that a signal appears after activating a cheat, play a sound in gtanim() (or just a beep;)

Re: Cheat-Input like GTA SA [Re: Tempelbauer] #94208
05/12/07 20:43
05/12/07 20:43
Joined: Feb 2007
Posts: 40
S
SuperTux Offline
Newbie
SuperTux  Offline
Newbie
S

Joined: Feb 2007
Posts: 40
Can you write down, how i add Cheats
e.g. if(str_stri(tmpcheat,"beepman")) { beep; str_cpy(tmpcheat,""); gtanim();}

where must i write down, that the String money +15 is ?

Page 1 of 2 1 2

Moderated by  adoado, checkbutton, mk_1, Perro 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1