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
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (degenerate_762, NewtraderX), 856 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19054 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Getting a pointer to another model entity #150792
08/28/07 17:16
08/28/07 17:16
Joined: Aug 2007
Posts: 17
T
Torr Offline OP
Newbie
Torr  Offline OP
Newbie
T

Joined: Aug 2007
Posts: 17
I'm new to 3D Gamestudio and was trying out the AI template scripts. I placed 2 NPCs with 1 being assigned the AIFPS01_Guard action and the other AIDumbBiped01. However, when I ran the level, the guard NPC doesn't attack the other one.
Code:
function	AIFPS01_Wait01()
{
// WAIT state
ifdef aiFPS01_show_health;
draw_text("WAIT",300,300,vector(100,100,255));
endif;

// Scan for player
if(plSelect_curr_ent != 0) // we need a player to scan for!


This is part of the code. Is plSelect_curr_ent a predefined pointer? How can I get the pointer for the other NPC?

Re: Getting a pointer to another model entity [Re: Torr] #150793
08/28/07 18:27
08/28/07 18:27
Joined: Jan 2007
Posts: 221
F
Fenriswolf Offline
Member
Fenriswolf  Offline
Member
F

Joined: Jan 2007
Posts: 221
Hi Torr,

plSelect_curr_ent is a pointer assigned to the active player entity.

As far as I know, the current templates doesn't support NPCs fighting against each other. However they can fight against the player.

So you need to add a player entity (plBiped01) to get some action.

Re: Getting a pointer to another model entity [Re: Fenriswolf] #150794
08/29/07 03:51
08/29/07 03:51
Joined: Aug 2007
Posts: 17
T
Torr Offline OP
Newbie
Torr  Offline OP
Newbie
T

Joined: Aug 2007
Posts: 17
Where is plSelect_curr_ent defined? I couldn't find it in aiFPS01.wdl.

I'm not interested in getting the NPCs to fight the player. My aim is NPC vs NPC and I'm using the template code as a learning guide. I'm looking through the manual again but still have no clue on how I can get a pointer to another model entity.

EDIT: Ok, just found out plSelect_curr_ent is defined in plSelect.wdl

Last edited by Torr; 08/29/07 03:58.

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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