entity type panel movement in (y)/(Z)axis ??

jonsilva

New member
hello...
i was wandering if someone already figured a way
of setting an entity type panel or none with a scroll of 1
from moving offscreen when the player moves the camera position
by walking up or down...

the default gogo arrow in openbor seems to be working fine
it follows the screen in (x) and (y) but when you use a panel it
gets offscreen... this happens more often if the panel entity is smaller
than the level screen
 
I don't understand what you mean by this:

an entity type panel or none with a scroll of 1
from moving offscreen when the player moves the camera position
by walking up or down...

What's the corelation of "moving offscreen" with this?
 
i was trying the panel options
and i found out that if you use an entity type none and add scroll 1
it scroll with the same speed has panel
but theres still the problem when it moves up and down

Code:
name		Timer
type	            none
scroll                1     <--------------------move like panel
speed		10
setlayer	5000
#nomove		1 1
facing		1
alpha		2
lifespan	299
subject_to_gravity 0
palette		data/chars/misc/number/red.gif
animationscript data/scripts/escript.c

load		Timer2
load		Timer3
load		Timer4
load		Timer5
load		Dot

anim spawn
	delay	1
	loop	0
	offset	12 35
	frame	data/chars/misc/empty.gif
	delay	10000
	@cmd	spawnbind "Timer5" 0 0 0
	@cmd	spawnbind "Timer2" 25 0 0
	@cmd	spawnbind "Timer3" 50 0 0
	@cmd	spawnbind "Timer4" 82 0 0
	@cmd	spawnbind "Dot" 66 0 0
	frame	data/chars/misc/empty.gif

i have a level where iam using the custom timer from g.i joe
and the timer's position never stays in the same place,
sometimes it even disapears from the screen when the player dies
and has to continue with credits

in the g.i joe mod in the level were the timer appears
the level camera only scrolls left/right so it works fine...

i though of using this script
Code:
void targetCam(float Vy, int Tx, int Tz)
{// Targetting certain position before leaping there
//  Vy : Leaping speed
//  Tx : Leaping destination x coordinate
//  Tz : Leaping destination z coordinate
// Used with 'leap' or 'toss2'
    void self = getlocalvar("self");
    float x = getentityproperty(self, "x"); // Get entity's x coordinate
    float z = getentityproperty(self, "z"); // Get entity's z coordinate
    int XPos = openborvariant("xpos"); //Get screen edge's position
    int YPos = openborvariant("ypos"); // Get camera position
    Tx=Tx+XPos;
    Tz=Tz+YPos;


    if(Tx < x){
      changeentityproperty(self, "direction", 0); // Face left 
    } else {
      changeentityproperty(self, "direction", 1); // Face right
    }
    setlocalvar("x"+self, (Tx-x)/(20*Vy)); // Calculate Vx then store value in local variable
    setlocalvar("z"+self, (Tz-z)/(20*Vy)); // Calculate Vz then store value in local variable
}

to get the screen camera corrdinates and then use
"spawnbind" to bind it to screen position
but i cant seem to get it working....

( i think this is what the "gogo" arrow its using when appears in the screen )

 
That's strange. I usually use type panel and it follows camera even if the latter moves up or down.

As for gone during waiting for player to continue, I don't understand. I mean there seems to be something occurring during this state.
 
the (Z) value seemed to be what was making the panel offscreen

i was using
custentity runtime1
spawnframe 2 180 180 0 1

ive change it to
@cmd spawn02 "runtime1" 180 90 90

it seems to working now... the runtime1 is following the camera when the player moves down and up

i dont know if it works for all the levels because they have diferent area sizes...
i have been using some entities type text... but it would be better to use type panel to let the player move when the entity appears on screen...
but i dont know if 1 entity panel will work equally in all the levels


this is whats was happening...when runtime1 spawns
when the player was at the bottom of the level the
runtime1 -- spawned ok
when he was on the upper side of the level and moved down
the runtime1 moved up
ive used spawn02 "runtime1" 180 (90 90) to prevent the runtime1 do move up...!?!

timer.jpg
 
I've also encountered this problem spawning a panel that was going to be part of the GUI, it will move up when you scroll down.

EDIT: Realized I already have some screens of this in my post about fallout mod.  You can see in the two screens once the player walks down, the 'TURN COMBAT' icon on right side corner of screen changes position.


 
Well it seems I need to hard-coded this part next time because of the gravity.

Or you can use a temporary solution.

spawn yourentity
coords 100 4100 4000  # 100 100
at 0


Make sure to adjust offscreenkill.
 
i can't make it work...
ive tried to combine the targetcam and spawnbind script
its showing the cant compile script error

---------------//------------------------
void targetbind(void Name, float Vy, int Tx, int Tz)
{// Targetting certain position before binding there
//  Name : entity name to be spawned
//  Tx : Leaping destination x coordinate
//  Tz : Leaping destination z coordinate
    void self = getlocalvar("self");
    void Spawn;
    float x = getentityproperty(self, "x"); // Get entity's x coordinate
    float z = getentityproperty(self, "z"); // Get entity's z coordinate
    int XPos = openborvariant("xpos"); //Get screen edge's position
    int YPos = openborvariant("ypos"); // Get camera position
    Tx=Tx+XPos;
    Tz=Tz+YPos;


    if(Tx < x){
      changeentityproperty(self, "direction", 0); // Face left
    } else {
      changeentityproperty(self, "direction", 1); // Face right
    }
    setlocalvar("x"+self, (Tx-x)/(20*Vy)); // Calculate Vx then store value in local variable
    setlocalvar("z"+self, (Tz-z)/(20*Vy)); // Calculate Vz then store value in local variable
    Spawn = spawn01(Name, tx, tz, 0);
    bindentity(Spawn, tx, tz, 0, 0, 0);
}

-----------/-/----------------

anim spawn
loop 0
delay 10
offset 1 1
frame data/chars/misc/text/bonus/empty.gif
@cmd targetbind "rushold" 5 50 50
frame data/chars/misc/text/bonus/empty.gif
frame data/chars/misc/text/bonus/empty.gif
 
Well, you have case sensitive issue there. Tx is not same as tx in script same goes with Tz and tz.

Anyways, actually I was referring to gaining YPos as posted above and update z coordinate with it like this:

@script
    void self = getlocalvar("self");
    float x = getentityproperty(self, "x"); // Get entity's x coordinate
    float z = getentityproperty(self, "z"); // Get entity's z coordinate
    int YPos = openborvariant("ypos"); // Get camera position

  changeentityproperty(self, "position", x, z+YPos);   
@end_script

This is to be declared in Numbers IDLE.

Haven't tried this myself since I don't have wide levels.
 
i cant make it work...
ive used this entity
name wrmine
type enemy
nomove 1 1
scroll  1
alpha 2
facing  1
lifespan 20
subject_to_gravity 0
setlayer 3000




anim idle
loop 1
delay 20
offset 1 1
@script
    void self = getlocalvar("self");
    float x = getentityproperty(self, "x"); // Get entity's x coordinate
    float z = getentityproperty(self, "z"); // Get entity's z coordinate
    int YPos = openborvariant("ypos"); // Get camera position

  changeentityproperty(self, "position", x, z+YPos);   
@end_script
frame data/chars/misc/text/bonus/wmine01.gif
frame data/chars/misc/text/bonus/empty.gif
sound data/sounds/alarm2.wav
frame data/chars/misc/text/bonus/wmine01.gif
frame data/chars/misc/text/bonus/empty.gif
frame data/chars/misc/text/bonus/wmine01.gif
frame data/chars/misc/text/bonus/empty.gif
frame data/chars/misc/text/bonus/wmine01.gif
frame data/chars/misc/text/bonus/empty.gif
frame data/chars/misc/text/bonus/wmine01.gif
frame data/chars/misc/text/bonus/empty.gif


anim spawn
loop 0
delay 110
offset 1 1
frame data/chars/misc/text/bonus/empty.gif
frame data/chars/misc/text/bonus/empty.gif


#|edited by openBor Stats v 0.53
its an enemy with a scroll of 1 so it can be spawned in groups

spawn  wrmine
coords  100 120
at      0

when the "wrmine" spawns in level you only see 1 image then it disapears

mine.jpg


ive also change (t) in targetbind script its not showing any error
but when the entity spawns it doesnt seem to be binded to anything
i dont know if the screen camera coordinates can be used as an entity
and bind something to those coordinates

ive used the targetbind in and entity that spawns then spawn
a message type panel / text

frame data/chars/misc/car/choppa3/heli03.gif
@cmd targetbind "choppatlk" 5 1 1
frame data/chars/misc/car/choppa3/heli01.gif
 
Back
Top Bottom