Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, Grant, Neb), 908 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
connecting entities #3616
05/14/01 07:40
05/14/01 07:40

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



I am trying to write a simple script that will connect a sprite to a model using the ent_vertex command. I can't get it to work. The script I made dosen't produce errors but the sprite dosen't even appear on the screen or connect to the model. Here's my script

SYNONYM hitpoint {TYPE ENTITY; }

function hitpoint_init(){
If (me == null)
{me == hitpoint;}
my.pos = 304;
}

function melee_attack(){

While (player.frame == 10)
{ent_vertex(player.pos,304);//vertex # 304//
create(<hitpoint.pcx>,304,hitpoint_init);
break;}
}
Does anyone know how to modify this so It will work? If not can anyone give me an example of how to use ent_vertex.(other than the manuals example). Thanks I would be very grateful.

[This message has been edited by r598 (edited 14 May 2001).]


Re: connecting entities #3617
05/14/01 09:59
05/14/01 09:59
Joined: Mar 2001
Posts: 1,825
London, England
Keith B [Ambit] Offline
Expert
Keith B [Ambit]  Offline
Expert

Joined: Mar 2001
Posts: 1,825
London, England
The new Office level has an example of exactly how to do this... The following is a conversion of that code to fit your needs (hopefully) - I've used a version of this code to join together a multipart model successfully.

// place a sprite at the vertex number given by my.x
action attach_hitpoint
{
my.passable = on;
my.facing = on;
my.skill1 = my.x;
while (you) // prevent empty synonym error if parent entity was removed
{
if (you.invisible == on)
{my.invisible = on;}
else
{my.invisible = off;}
temp_ent = my;
my = you;
ent_vertex(temp_ent.x,temp_ent.skill1);
my = temp_ent;
wait(1);
}
remove(my);
}

Then just put

create (<hitpoint.pcx>,304,attach_hitpoint);

in the function or action you want to create the sprite... Hope that helps.


Re: connecting entities #3618
05/15/01 09:00
05/15/01 09:00

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A




Thanks alot!!! It works perfectly.


Moderated by  HeelX, Spirit 

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