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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Akow, TipmyPip, tomaslolo), 788 guests, and 11 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 4
Page 5 of 5 1 2 3 4 5
Re: 2D Movement Script (wall jumping, combat etc) [Re: ] #59910
09/07/06 08:28
09/07/06 08:28
Joined: Apr 2006
Posts: 1,551
Netherlands
D3D Offline
Serious User
D3D  Offline
Serious User

Joined: Apr 2006
Posts: 1,551
Netherlands
If you need starting point to c-script syntax in order to program these things yourself, I highly recommend the gamestudio manual and George Pirvu's C-Script Workshops on the download page. Also the Acknex User Magazine may come in hand, there are already 58 available for you to dive in!

Anyways like Frank_G said in another topic: update your gamestudio version. The one your using atm is full of bugs and will lead to problems along the road.

Dusty


smile
Re: 2D Movement Script (wall jumping, combat etc) [Re: D3D] #59911
09/07/06 08:32
09/07/06 08:32

A
Anonymous
Unregistered
Anonymous
Unregistered
A



It's uptodate just didin't change my thing to say it is yet, lol I'm a bit lazy.
--Tom_02345

Re: 2D Movement Script (wall jumping, combat etc) [Re: ] #59912
10/11/06 01:40
10/11/06 01:40
Joined: Jan 2002
Posts: 1,276
trapped in a paper bag
Drew Offline
Serious User
Drew  Offline
Serious User

Joined: Jan 2002
Posts: 1,276
trapped in a paper bag
if you update to 6.50.2 you will see this code no longer runs... JCL posted a fix in beta:
(works for me now, added my_ to those key_cul and curs...
then added vars and the code below...)

quote:
fraid not - it's a hardwired feature of the C-Script compiler and I'm not allowed to touch this part of the code. I even do not know why you haven't seen those errors indicated before, as this error message is in place since A4.

But it should be easy to fix your script in 5 minutes:

1. search-and-replace all "key_" in your code by "my_key_".

2. Define a var "my_key_a", "my_key_b" etc. for all keys you are using.

3. Start the following piece of code from your main function:

while(1) {
my_key_a = key_a;
my_key_b = key_b;
...
wait(1);
}

Then you can still use all your key code and it's even legal.


Drew Medina
Game Developer (Artist)
Personal & professional website
Deviant Art
My Blogspot
Re: 2D Movement Script (wall jumping, combat etc) [Re: Drew] #59913
10/27/06 10:25
10/27/06 10:25
Joined: Oct 2005
Posts: 26
B
Bananatech Offline
Newbie
Bananatech  Offline
Newbie
B

Joined: Oct 2005
Posts: 26

There is no need to change all of the keys in this script
It is legal to "compare" a value to "read only" keys as long as you do not try to write to the "read only" keys.
Only six keys need a new replacement.

var my_key_cuu = key_cuu;
var my_key_cud = key_cud;
var my_key_cul = key_cul;
var my_key_cur = key_cur;
var my_key_ctrl =key_ctrl;

var mouse_movement_direction[3];

FUNCTION handle_movement() {
IF (mouse_right == 1) {
IF (mouse_force.x > 0 || mouse_movement_direction.x == 1) { mouse_movement_direction.x = 1; my_key_cur = 1; }
IF (mouse_force.x < 0 || mouse_movement_direction.x == -1) { mouse_movement_direction.x = -1; my_key_cul = 1; }
}
IF (mouse_left == 1) { my_key_ctrl = 1; }
IF (mouse_force.y > 0) { my_key_cuu = 1; }
IF (mouse_force.y < 0) { my_key_cud = 1; }
IF (key_w == 1) { my_key_cuu = 1; }
IF (key_s == 1) { my_key_cud = 1; }
IF (key_a == 1) { my_key_cul = 1; }
IF (key_d == 1) { my_key_cur = 1; }
....
....
....


that's all.
Allways trust the compiler

Page 5 of 5 1 2 3 4 5

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