Author |
Message |
Metalor
DieHard Mutant


Joined: 24 Aug 2005
Last Visit: 7:52 ago.
Topics: 95
Posts: 916
Location: California

|
|
 |
Tricob
Moderator


Joined: 14 Mar 2005
Last Visit: 2:58 ago.
Topics: 165
Posts: 8327
Location: Neo-traditions, Inc.

|
|
 |
Metalor
DieHard Mutant


Joined: 24 Aug 2005
Last Visit: 7:52 ago.
Topics: 95
Posts: 916
Location: California

|
Posted: Thu Aug 08, 2013 5:34 pm
Subject: Re: Player Blocking Code for SDL?
[ IP : Logged ]
|

  
|
|
Okay, so then, how do I do that?
I've heard the objects plane thingy mentioned elsewhere, but I'd need an example to understand exactly what you mean (I'm sorry, I've been working on this stuff all day, so my brain's fried). |
_________________ - Taking a hiatus from Wolfenstein for a while...
...But I'll be back, you can count on it!
|
|
 |
Tricob
Moderator


Joined: 14 Mar 2005
Last Visit: 2:58 ago.
Topics: 165
Posts: 8327
Location: Neo-traditions, Inc.

|
|
 |
Metalor
DieHard Mutant


Joined: 24 Aug 2005
Last Visit: 7:52 ago.
Topics: 95
Posts: 916
Location: California

|
Posted: Thu Aug 08, 2013 6:07 pm
Subject: Re: Player Blocking Code for SDL?
[ IP : Logged ]
|

  
|
|
Alright, I placed it at the bottom of TryMove(), and got these two errors:
error: `offset' was not declared in this scope
error: return-statement with no value, in function returning 'int'
Also, I knew that the "thing" being spawned was not an object, I'm just not familiar with creating things that refer to the objects plane. |
_________________ - Taking a hiatus from Wolfenstein for a while...
...But I'll be back, you can count on it!
|
|
 |
Tricob
Moderator


Joined: 14 Mar 2005
Last Visit: 2:58 ago.
Topics: 165
Posts: 8327
Location: Neo-traditions, Inc.

|
|
 |
Metalor
DieHard Mutant


Joined: 24 Aug 2005
Last Visit: 7:52 ago.
Topics: 95
Posts: 916
Location: California

|
Posted: Thu Aug 08, 2013 10:07 pm
Subject: Re: Player Blocking Code for SDL?
[ IP : Logged ]
|

  
|
|
I replaced all three instances of TryMove in ClipMove, and I added the "offset" code. The game didn't initially like that code, so I added:
::: CODE :::
unsigned offset;
to make up for it.
However, the code doesn't seem to function properly, as I can still move over the space marked by the blocker in an editor, however it seems to have an odd effect when placed near walls as it makes it possible to enter into the nearby wall and get stuck inside.
To elaborate, I placed the strings under these three sets of code:
::: CODE :::
ob->x = basex+xmove;
ob->y = basey+ymove;
...
ob->x = basex+xmove;
ob->y = basey;
...
ob->x = basex;
ob->y = basey+ymove;
|
_________________ - Taking a hiatus from Wolfenstein for a while...
...But I'll be back, you can count on it!
|
|
 |
Tricob
Moderator


Joined: 14 Mar 2005
Last Visit: 2:58 ago.
Topics: 165
Posts: 8327
Location: Neo-traditions, Inc.

|
|
 |
Metalor
DieHard Mutant


Joined: 24 Aug 2005
Last Visit: 7:52 ago.
Topics: 95
Posts: 916
Location: California

|
Posted: Fri Aug 09, 2013 6:54 pm
Subject: Re: Player Blocking Code for SDL?
[ IP : Logged ]
|

  
|
|
Well, I made the changes above and it still seems to do the same thing. In fact, the only thing the spaces seem to do is the opposite of what I'm trying to program them to do (I've gotten stuck inside of both walls and enemies now).
I'm not real keen on how this code works, but I'd assume it'd have something with playerobj in it or something to prevent the player entering inside. At least, that's what I'd guess off the top of my head. |
_________________ - Taking a hiatus from Wolfenstein for a while...
...But I'll be back, you can count on it!
|
|
 |
Chris
DieHard Wolfer


Joined: 11 Mar 2003
Last Visit: 14 Feb 2019
Topics: 55
Posts: 2169
Location: Canada

|
|
 |
Metalor
DieHard Mutant


Joined: 24 Aug 2005
Last Visit: 7:52 ago.
Topics: 95
Posts: 916
Location: California

|
Posted: Fri Aug 09, 2013 10:47 pm
Subject: Re: Player Blocking Code for SDL?
[ IP : Logged ]
|

  
|
|
Tried Chris' code and it worked perfectly. Thanks for both of your help! |
_________________ - Taking a hiatus from Wolfenstein for a while...
...But I'll be back, you can count on it!
|
|
 |
Tricob
Moderator


Joined: 14 Mar 2005
Last Visit: 2:58 ago.
Topics: 165
Posts: 8327
Location: Neo-traditions, Inc.

|
Posted: Sat Aug 10, 2013 3:46 pm
Subject: Re: Player Blocking Code for SDL?
[ IP : Logged ]
|

 
|
|
Thanks for the helping hand, Chris.  |
|
|
 |
|