Solved Going Below Altitude in Z

Question that is answered or resolved.

maxman

Well-known member
I'm trying to spawn the platform below the value of altitude. I already set z for the stage.

Code:
z 109 243 189
file		data/levels/stage3.txt

However, when I negate the altitude value for going below, it doesn't spawn a little way down on hole at all.

spawn platbrdg
coords 914 209 -11 # 480 + 434 = 914; video resolution width + platform width
at 503 #1417; 1417 - 914 = 503;

Here's the platform entity:

Code:
name platbrdg
type none
antigravity 100
facing 1
subject_to_wall 0
#subject_to_hole 1
subject_to_gravity 1
subject_to_minz 0
subject_to_maxz 0
subject_to_platform 0
offscreenkill 1000000
animationscript data/scripts/Prscript.c

anim idle

	delay 100
	offset 1 114
	loop 1
	platform 1 114 30 -20 405 455 46 15
	frame data/chars/misc/plat/lv3brdg.png
	
anim spawn
	delay 10
	offset 1 114
	@cmd	dasher 0 -1 0
	platform 1 114 40 -10 395 445 46 15
	frame data/chars/misc/plat/lv3brdg.png
	@cmd	dasher 0 0 0
	platform 1 114 40 -10 395 445 46 15
	frame data/chars/misc/plat/lv3brdg.png

[attachment deleted by admin]
 
However, when I negate the altitude value for going below, it doesn't spawn a little way down on hole at all.

Hmm.... looks like your bridge platform isn't subjected to hole yet, that's why it returns to ground zero after being spawned underground like that
 
Thanks for (trying to) help, magggas. I tried both subject_to_minz and subject_to_maxz, with their values, but can't make it go deeper.

I tried using subject_to_hole, but same, can't go deeper.

I guess I will go with wall platforms so they can jump off from the rocks to the bridge. That means I will remove the bridge platform entity.

[attachment deleted by admin]
 
Yep. (Been there, done that.) I know how it's like and I did make so many walls for rafhot's Fantastic Four mod. Though making walls is easy, it was a lot of hard work I had to do.

I already put some walls in place. I'm gonna get 'em done properly.
 
I tried no_adjust_base a while ago, but still can't make it go deeper also.

I'm not sure if using script could work for platforms going deeper in altitude.
 
I've got what i think is a similar dilemma. Working in 2D only, I'm adding a breakable 16 x 16 platform directly over a hole. The walkable surface lines up perfectly with the Z axis. I originally tried to spawn the platform below the z axis by setting the altitude at -16.
When that failed ( It wound up spawning OVER of the surface of the hole anyway. ), I changed the Z axis of the platform spawn itself. At that point it did visually spawn in the proper area, but it no longer had substance. The player ( or any other entity ) would fall right through it. I don't think I'm doing anything wrong. regardless, Its not working. Any info that could help with this matter would be greatly appreciated.
 
SaintJudas said:
I've got what i think is a similar dilemma. Working in 2D only, I'm adding a breakable 16 x 16 platform directly over a hole. The walkable surface lines up perfectly with the Z axis. I originally tried to spawn the platform below the z axis by setting the altitude at -16.
When that failed ( It wound up spawning OVER of the surface of the hole anyway. ), I changed the Z axis of the platform spawn itself. At that point it did visually spawn in the proper area, but it no longer had substance. The player ( or any other entity ) would fall right through it. I don't think I'm doing anything wrong. regardless, Its not working. Any info that could help with this matter would be greatly appreciated.

when spawning platforms for 2D make sure the second value matches the z value of your stage.  The third value will control the altitude of your platform.

So if your level set was,

set MODE_1
musicoverlap 1
z 500 500
file data/levels/mode1.txt


In the level the would be.

spawn  platform1
coords  32 500 224
at      0


in this example the platform will spawn 224 above the z axis.

HTH
 
Vycks, White Dragon was referring to using spawnscript like this:

dalam.c
Code:
void main()
{// Script for setting very low base at spawn
    void self = getlocalvar("self");
    changeentityproperty(self, "base", -9999);
}

Save that in data/scripts folder
Declare it in header like this:

onspawnscript data/scripts/dalam.c

Don't forget to set no_adjust_base 1 too :)

Here's example of usage:
name Jembat
type none
setlayer 1
no_adjust_base 1
antigrab 100
subject_to_gravity 0
offscreenkill 3000
onspawnscript data/scripts/dalam.c


anim idle
loop 1
delay 8
offset 50 10
platform 50 10 -60 -60 60 60 20 10
frame data/chars/mechs/jembat1.png
frame data/chars/mechs/jembat1.png

and in game shot:



3 Jembats form a bridge above hole and Gunbot can walk over them smoothly from one side to other side
 
@ White Dragon: I hope my reply didn't come off sounding ungrateful. Such is NOT AT ALL the case. I Honestly just had no idea where to begin with spawn script, but your reply is definitely a step in the right direction.

@ BeasTie: Lol, I know that part. I thought I had explained as much beforehand. Still, It's appreciated.

@ BloodBane: This is exactly what i needed! I'm going to try it out right now. From there, I'm going to see if i can use the ladder script you gave me before. 
 
Bloodbane, White Dragon. I tried it today and the onspawnscript works like a charm. I didn't know what script to use 'til I saw a very simple script made by Bloodbane. Thank you guys so much for your time to help. :)
 
Agreed! It worked perfectly. I was even able to add a spike pit under the breakable platforms.
For the sake of the next guy to have this problem, I'll try to explain the last bit.
Until BloodBane shared the script, I was NOT AT ALL able to get my 16 pixel X 16 pixel platform to spawn under the level's Z axis (Inside the hole).
After using the script exactly as he described above, I was able to achieve success. By spawning my platform EQUAL TO the level's Z AXIS as normal, then setting it's spawn altitude to a the negative value I needed, everything worked perfectly.
To the next guy looking for answers, I hop eyou were able to find them here. Good Luck!  ;D
 
Back
Top Bottom